Skip to content

Commit

Permalink
Merge pull request #112 from jcpunk/label-workers
Browse files Browse the repository at this point in the history
Apply labels late for kind
  • Loading branch information
jcpunk authored Oct 31, 2023
2 parents 9764d84 + 4e7e059 commit 60791a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .makefile/kind-config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ ${MY_KIND_CLUSTER_CONFIG}: remove-kind-config get-kube-daq
@echo " extraMounts:" >> ${MY_KIND_CLUSTER_CONFIG}
@echo " - hostPath: ${MY_PERSISTENT_STORAGE}" >> ${MY_KIND_CLUSTER_CONFIG}
@echo " containerPath: /var/local-path-provisioner" >> ${MY_KIND_CLUSTER_CONFIG}
@echo " labels:" >> ${MY_KIND_CLUSTER_CONFIG}
@echo " node-role.kubernetes.io/worker: worker" >> ${MY_KIND_CLUSTER_CONFIG}
# @echo " labels:" >> ${MY_KIND_CLUSTER_CONFIG}
# @echo " node-role.kubernetes.io/worker: worker" >> ${MY_KIND_CLUSTER_CONFIG}
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ create-${KIND_CLUSTER_NAME}-cluster: test-shell-utils test-docker-is-working get
@echo ""
@kind create cluster --wait 10s --config ${MY_KIND_CLUSTER_CONFIG}
@echo ""
@echo "Setting role on worker(s)..."
@for node in $$(kubectl get nodes -o 'jsonpath={.items[*].metadata.name}'); do echo $${node} | grep -q worker; if [[ $$? -eq 0 ]]; then kubectl label node $${node} node-role.kubernetes.io/worker=worker; fi; done
@echo ""
@echo "Cleaning up unnecessary resources, please wait..."
kubectl delete storageclass standard --now=true --wait=true
kubectl delete namespace local-path-storage --now=true --wait=true
Expand Down

0 comments on commit 60791a9

Please sign in to comment.