Skip to content
Snippets Groups Projects
Verified Commit 9cf85285 authored by Sheogorath's avatar Sheogorath :european_castle:
Browse files

fix(kubeadm-init): Adjust the host names for the make-ssh magic

parent 9bd4fffa
No related branches found
No related tags found
1 merge request!2Draft: Makefile: Add all commands to deploy the kubernetes controlplane
.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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment