-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (29 loc) · 1.46 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
34
35
.ONESHELL: # Applies to every targets in the file!
DEFAULT_KUBECONFIG := ~/.kube/config
DEFAULT_GOAL := bootstrap
bootstrap: terraform-init terraform-plan terraform-apply kubeconfig k8s-apply
terraform-init:
@echo "Initializing Terraform configuration..."
@terraform -chdir=./terraform init
terraform-plan:
@echo "Planning Terraform configuration..."
@terraform -chdir=./terraform plan
terraform-apply:
@echo "Applying Terraform configuration..."
@terraform -chdir=./terraform apply -auto-approve
kubeconfig:
@echo "Fetching kubeconfig from Terraform and setting it as the default..."
@echo "Do you want to set the kubeconfig as the default at $(DEFAULT_KUBECONFIG)? [y/N] " && read ans && [ $${ans:-N} = y ]
@mkdir -p ~/.kube
@terraform -chdir=./terraform output -raw kubeconfig_content > $(DEFAULT_KUBECONFIG)
@echo "KUBECONFIG is set as the default at $(DEFAULT_KUBECONFIG)"
k8s-apply:
@echo "Applying Kubernetes configuration..."
kubectl apply -k ./k8s/infra/crds
kubectl kustomize --enable-helm ./k8s/infra/network/cilium | kubectl apply -f -
kubectl kustomize --enable-helm ./k8s/infra/security/cert-manager | kubectl apply -f -
kubectl kustomize ./k8s/infra/network/gateway | kubectl apply -f -
kubectl kustomize ./k8s/infra/network/cloudflare-ddns | kubectl apply -f -
kubectl kustomize ./k8s/apps/external/proxmox | kubectl apply -f -
kubectl kustomize ./k8s/apps/external/haos | kubectl apply -f -
kubectl kustomize ./k8s/apps/external/immich | kubectl apply -f -