Skip to content

Commit 00d3f9e

Browse files
committed
docs: Fix up labelling cluster correctly in README
1 parent 1ecd77d commit 00d3f9e

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ To create a cluster with [clusterctl](https://cluster-api.sigs.k8s.io/user/quick
2727
CNI at the same time, run:
2828

2929
```shell
30-
env POD_SECURITY_STANDARD_ENABLED=false \
31-
clusterctl generate cluster capi-quickstart \
32-
--flavor development \
33-
--kubernetes-version v1.27.2 \
34-
--control-plane-machine-count=1 \
35-
--worker-machine-count=1 | \
36-
kubectl label -f - --local --dry-run=client -oyaml capiext.labs.d2iq.io/cni=calico | \
37-
kubectl apply --server-side -f -
30+
clusterctl generate cluster capi-quickstart \
31+
--flavor development \
32+
--kubernetes-version v1.27.2 \
33+
--control-plane-machine-count=1 \
34+
--worker-machine-count=1 | \
35+
gojq --yaml-input --yaml-output \
36+
'. | (select(.kind=="Cluster").metadata.labels["capiext.labs.d2iq.io/cni"]|="calico")' | \
37+
kubectl apply --server-side -f -
3838
```
3939

4040
Wait until control plane is ready:

make/kind.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ kind.recreate: kind.delete kind.create
2626
.PHONY: kind.create
2727
kind.create: ## Creates new KinD cluster
2828
kind.create: ; $(info $(M) creating kind cluster - $(KIND_CLUSTER_NAME))
29-
(kind get clusters | grep -Eq '^$(KIND_CLUSTER_NAME)$$' && echo '$(KIND_CLUSTER_NAME) already exists') || \
29+
(kind get clusters 2>/dev/null | grep -Eq '^$(KIND_CLUSTER_NAME)$$' && echo '$(KIND_CLUSTER_NAME) already exists') || \
3030
env KUBECONFIG=$(KIND_KUBECONFIG) $(REPO_ROOT)/hack/kind/create-cluster.sh \
3131
--cluster-name $(KIND_CLUSTER_NAME) \
3232
--kindest-image $(KINDEST_IMAGE) \
@@ -36,7 +36,7 @@ kind.create: ; $(info $(M) creating kind cluster - $(KIND_CLUSTER_NAME))
3636
.PHONY: kind.delete
3737
kind.delete: ## Deletes KinD cluster
3838
kind.delete: ; $(info $(M) deleting kind cluster - $(KIND_CLUSTER_NAME))
39-
(kind get clusters | grep -Eq '^$(KIND_CLUSTER_NAME)$$' && kind delete cluster --name $(KIND_CLUSTER_NAME)) || \
39+
(kind get clusters 2>/dev/null | grep -Eq '^$(KIND_CLUSTER_NAME)$$' && kind delete cluster --name $(KIND_CLUSTER_NAME)) || \
4040
echo '$(KIND_CLUSTER_NAME) does not exist'
4141
rm -rf $(KIND_DIR)/$(KIND_CLUSTER_NAME)
4242

0 commit comments

Comments
 (0)