Skip to content

Commit

Permalink
docs: Fix up labelling cluster correctly in README
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmidyson committed Aug 23, 2023
1 parent 1ecd77d commit 00d3f9e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions make/kind.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand All @@ -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)

Expand Down

0 comments on commit 00d3f9e

Please sign in to comment.