diff --git a/utils/kubernetes-init.mk b/utils/kubernetes-init.mk index c43edcf21d31657fcf96dfda90e104f664bb3119..42eaf56cbca7f70bc22056d8015c58a22abb791b 100644 --- a/utils/kubernetes-init.mk +++ b/utils/kubernetes-init.mk @@ -1,19 +1,19 @@ .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 + ssh cp01.$(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 cp01.$(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-copy-config: ## Copy Kubernetes admin config from cp01 to the local machine + scp cp01.$(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 + ssh cp02.$(TF_VAR_dns_domain) $$(ssh cp01.$(TF_VAR_dns_domain) kubeadm token create --ttl 1h --print-join-command --certificate-key "$$(ssh cp01.$(TF_VAR_dns_domain) kubeadm init phase upload-certs --upload-certs | tail -1)" | tail -1) + ssh cp02.$(TF_VAR_dns_domain) systemctl enable kubelet.service + ssh cp03.$(TF_VAR_dns_domain) $$(ssh cp01.$(TF_VAR_dns_domain) kubeadm token create --ttl 1h --print-join-command --certificate-key "$$(ssh cp01.$(TF_VAR_dns_domain) kubeadm init phase upload-certs --upload-certs | tail -1)" | tail -1) + ssh cp03.$(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 taint nodes cp01.$(TF_VAR_dns_domain) node-role.kubernetes.io/master- kubectl-remove-all-master-taints: kubectl taint nodes --all node-role.kubernetes.io/master- || true