Select Git revision
jest.config.ts
kubernetes-init.mk 1.58 KiB
.PHONY: kubeadm-init
kubeadm-init:
ssh node01.$(TF_VAR_dns_domain) kubeadm init --control-plane-endpoint "api.$(TF_VAR_dns_domain):6443" --upload-certs --pod-network-cidr "192.168.0.0/16"
ssh node01.$(TF_VAR_dns_domain) systemctl enable kubelet.service
kubeadm-copy-config: ## Copy Kubernetes admin config from node01 to the local machine
scp node01.$(TF_VAR_dns_domain):/etc/kubernetes/admin.conf /root/.kube/config
kubeadm-join-masters:
ssh node02.$(TF_VAR_dns_domain) $$(ssh node01.$(TF_VAR_dns_domain) kubeadm token create --ttl 1h --print-join-command --certificate-key "$$(ssh node01.$(TF_VAR_dns_domain) kubeadm init phase upload-certs --upload-certs | tail -1)" | tail -1)
ssh node02.$(TF_VAR_dns_domain) systemctl enable kubelet.service
ssh node03.$(TF_VAR_dns_domain) $$(ssh node01.$(TF_VAR_dns_domain) kubeadm token create --ttl 1h --print-join-command --certificate-key "$$(ssh node01.$(TF_VAR_dns_domain) kubeadm init phase upload-certs --upload-certs | tail -1)" | tail -1)
ssh node03.$(TF_VAR_dns_domain) systemctl enable kubelet.service
kubectl-remove-first-master-taints:
kubectl taint nodes node01.$(TF_VAR_dns_domain) node-role.kubernetes.io/master-
kubectl-remove-all-master-taints:
kubectl taint nodes --all node-role.kubernetes.io/master- || true
kubectl-delete-wrong-subnet:
kubectl get pods --all-namespaces -o wide | grep 10.85. | awk '{print "-n " $$1 " " $$2}' | xargs -L 1 kubectl delete pod
kubernetes-install: kubeadm-init kubeadm-copy-config kubectl-remove-first-master-taints flux-bootstrap kubeadm-join-masters kubectl-remove-all-master-taints kubectl-delete-wrong-subnet