diff --git a/README.md b/README.md index ac1aa40ca..9068df13d 100644 --- a/README.md +++ b/README.md @@ -27,14 +27,14 @@ To create a cluster with [clusterctl](https://cluster-api.sigs.k8s.io/user/quick CNI at the same time, run: ```shell -env POD_SECURITY_STANDARD_ENABLED=false \ - clusterctl generate cluster capi-quickstart \ - --flavor development \ - --kubernetes-version v1.27.2 \ - --control-plane-machine-count=1 \ - --worker-machine-count=1 | \ - kubectl label -f - --local --dry-run=client -oyaml capiext.labs.d2iq.io/cni=calico | \ - kubectl apply --server-side -f - +clusterctl generate cluster capi-quickstart \ + --flavor development \ + --kubernetes-version v1.27.2 \ + --control-plane-machine-count=1 \ + --worker-machine-count=1 | \ +gojq --yaml-input --yaml-output \ + '. | (select(.kind=="Cluster").metadata.labels["capiext.labs.d2iq.io/cni"]|="calico")' | \ +kubectl apply --server-side -f - ``` Wait until control plane is ready: diff --git a/make/kind.mk b/make/kind.mk index 6901f15cd..a4976d98e 100644 --- a/make/kind.mk +++ b/make/kind.mk @@ -26,7 +26,7 @@ kind.recreate: kind.delete kind.create .PHONY: kind.create kind.create: ## Creates new KinD cluster kind.create: ; $(info $(M) creating kind cluster - $(KIND_CLUSTER_NAME)) - (kind get clusters | grep -Eq '^$(KIND_CLUSTER_NAME)$$' && echo '$(KIND_CLUSTER_NAME) already exists') || \ + (kind get clusters 2>/dev/null | grep -Eq '^$(KIND_CLUSTER_NAME)$$' && echo '$(KIND_CLUSTER_NAME) already exists') || \ env KUBECONFIG=$(KIND_KUBECONFIG) $(REPO_ROOT)/hack/kind/create-cluster.sh \ --cluster-name $(KIND_CLUSTER_NAME) \ --kindest-image $(KINDEST_IMAGE) \ @@ -36,7 +36,7 @@ kind.create: ; $(info $(M) creating kind cluster - $(KIND_CLUSTER_NAME)) .PHONY: kind.delete kind.delete: ## Deletes KinD cluster kind.delete: ; $(info $(M) deleting kind cluster - $(KIND_CLUSTER_NAME)) - (kind get clusters | grep -Eq '^$(KIND_CLUSTER_NAME)$$' && kind delete cluster --name $(KIND_CLUSTER_NAME)) || \ + (kind get clusters 2>/dev/null | grep -Eq '^$(KIND_CLUSTER_NAME)$$' && kind delete cluster --name $(KIND_CLUSTER_NAME)) || \ echo '$(KIND_CLUSTER_NAME) does not exist' rm -rf $(KIND_DIR)/$(KIND_CLUSTER_NAME)