-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
33 lines (25 loc) · 1.01 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
########## K8s cluster
K1_CONFIG="./${PROVIDER}"
TF_CONFIG="./terraform" #relative from K1_CONFIG
######### KubeOne
k1-load-env:
test -d ${K1_CONFIG} && echo "[ok]" && echo "kubeone config folder found"
cd ${K1_CONFIG} && test -f ${K1_SSH_KEY} && chmod 600 ${K1_SSH_KEY} && eval `ssh-agent` && ssh-add ${K1_SSH_KEY} && echo "[ok] "|| echo "ssh key permission ..."
k1-tf-init:
cd ${K1_CONFIG} && cd ${TF_CONFIG} && \
terraform init
k1-tf-apply: k1-load-env k1-tf-init
cd ${K1_CONFIG} && cd ${TF_CONFIG} && \
terraform apply --auto-approve
k1-tf-destroy: k1-load-env
cd ${K1_CONFIG} && cd ${TF_CONFIG} && \
terraform destroy --auto-approve
k1-tf-refresh: k1-load-env
cd ${K1_CONFIG} && cd ${TF_CONFIG} && \
terraform refresh
k1-apply: k1-load-env
cd ${K1_CONFIG} && kubeone apply -m kubeone.yaml -t ${TF_CONFIG} --verbose --auto-approve
k1-reset: k1-load-env
cd ${K1_CONFIG} && kubeone reset -m kubeone.yaml -t ${TF_CONFIG} --verbose --auto-approve
k1-apply-addons: k1-load-env
kubectl apply -f ${K1_CONFIG}/addons