feat!: Refector directories and flux apps (#559)
This commit is contained in:
1 parent
a43e2325f1
commit
4e6edcc66a
163 files changed
+1194
-1060
No files matched your search
@@ -12,32 +12,32 @@ tasks:
|
||||
|
||||
init:
|
||||
desc: Install / Upgrade Ansible galaxy deps
|
||||
dir: provision/ansible
|
||||
dir: "{{.ANSIBLE_DIR}}"
|
||||
cmds:
|
||||
- ansible-galaxy install -r requirements.yml --roles-path ~/.ansible/roles --force
|
||||
- ansible-galaxy collection install -r requirements.yml --collections-path ~/.ansible/collections --force
|
||||
|
||||
list:
|
||||
desc: List all the hosts
|
||||
dir: provision/ansible
|
||||
dir: "{{.ANSIBLE_DIR}}"
|
||||
cmds:
|
||||
- ansible all -i {{.ANSIBLE_INVENTORY_DIR}}/hosts.yml --list-hosts
|
||||
|
||||
prepare:
|
||||
desc: Prepare all the k8s nodes for running k3s
|
||||
dir: provision/ansible
|
||||
dir: "{{.ANSIBLE_DIR}}"
|
||||
cmds:
|
||||
- ansible-playbook -i {{.ANSIBLE_INVENTORY_DIR}}/hosts.yml {{.ANSIBLE_PLAYBOOK_DIR}}/cluster-prepare.yml
|
||||
|
||||
install:
|
||||
desc: Install Kubernetes on the nodes
|
||||
dir: provision/ansible
|
||||
dir: "{{.ANSIBLE_DIR}}"
|
||||
cmds:
|
||||
- ansible-playbook -i {{.ANSIBLE_INVENTORY_DIR}}/hosts.yml {{.ANSIBLE_PLAYBOOK_DIR}}/cluster-installation.yml
|
||||
|
||||
nuke:
|
||||
desc: Uninstall Kubernetes on the nodes
|
||||
dir: provision/ansible
|
||||
dir: "{{.ANSIBLE_DIR}}"
|
||||
interactive: true
|
||||
cmds:
|
||||
- ansible-playbook -i {{.ANSIBLE_INVENTORY_DIR}}/hosts.yml {{.ANSIBLE_PLAYBOOK_DIR}}/cluster-nuke.yml
|
||||
@@ -45,24 +45,24 @@ tasks:
|
||||
|
||||
ping:
|
||||
desc: Ping all the hosts
|
||||
dir: provision/ansible
|
||||
dir: "{{.ANSIBLE_DIR}}"
|
||||
cmds:
|
||||
- ansible all -i {{.ANSIBLE_INVENTORY_DIR}}/hosts.yml --one-line -m 'ping'
|
||||
|
||||
uptime:
|
||||
desc: Uptime of all the hosts
|
||||
dir: provision/ansible
|
||||
dir: "{{.ANSIBLE_DIR}}"
|
||||
cmds:
|
||||
- ansible all -i {{.ANSIBLE_INVENTORY_DIR}}/hosts.yml --one-line -a 'uptime'
|
||||
|
||||
reboot:
|
||||
desc: Reboot all the k8s nodes
|
||||
dir: provision/ansible
|
||||
dir: "{{.ANSIBLE_DIR}}"
|
||||
cmds:
|
||||
- ansible-playbook -i {{.ANSIBLE_INVENTORY_DIR}}/hosts.yml {{.ANSIBLE_PLAYBOOK_DIR}}/cluster-reboot.yml
|
||||
|
||||
poweroff:
|
||||
desc: Shutdown all the k8s nodes
|
||||
dir: provision/ansible
|
||||
dir: "{{.ANSIBLE_DIR}}"
|
||||
cmds:
|
||||
- ansible kubernetes -i {{.ANSIBLE_INVENTORY_DIR}}/hosts.yml -a '/usr/bin/systemctl poweroff' --become
|
||||
@@ -11,11 +11,11 @@ tasks:
|
||||
install:
|
||||
desc: Install Flux into your cluster
|
||||
cmds:
|
||||
- kubectl apply --kustomize {{.CLUSTER_DIR}}/bootstrap/
|
||||
- kubectl apply --kustomize {{.KUBERNETES_DIR}}/bootstrap
|
||||
- cat {{.SOPS_AGE_KEY_FILE}} | kubectl -n flux-system create secret generic sops-age --from-file=age.agekey=/dev/stdin
|
||||
- sops --decrypt {{.CLUSTER_DIR}}/flux/vars/cluster-secrets.sops.yaml | kubectl apply -f -
|
||||
- kubectl apply -f {{.CLUSTER_DIR}}/flux/vars/cluster-settings.yaml
|
||||
- kubectl apply --kustomize {{.CLUSTER_DIR}}/flux/config
|
||||
- sops --decrypt {{.KUBERNETES_DIR}}/flux/vars/cluster-secrets.sops.yaml | kubectl apply -f -
|
||||
- kubectl apply -f {{.KUBERNETES_DIR}}/flux/vars/cluster-settings.yaml
|
||||
- kubectl apply --kustomize {{.KUBERNETES_DIR}}/flux/config
|
||||
- task: reconcile
|
||||
preconditions:
|
||||
- sh: test -f {{.SOPS_AGE_KEY_FILE}}
|
||||
@@ -27,8 +27,8 @@ tasks:
|
||||
reconcile:
|
||||
desc: Force update Flux to pull in changes from your Git repository
|
||||
cmds:
|
||||
- flux reconcile -n flux-system source git flux-cluster
|
||||
- flux reconcile -n flux-system kustomization flux-cluster
|
||||
- flux reconcile -n flux-system source git home-kubernetes
|
||||
- flux reconcile -n flux-system kustomization cluster
|
||||
|
||||
hr-restart:
|
||||
desc: Restart all failed Helm Releases
|
||||
|
||||
@@ -3,12 +3,12 @@ version: "3"
|
||||
|
||||
tasks:
|
||||
|
||||
encrypt:
|
||||
desc: encrypt sops file 'to use must include -- before path to file.' eg "task sops:encrypt -- file.yml"
|
||||
e:
|
||||
desc: Encrypt sops file 'to use must include -- before path to file.' eg "task sops:e -- file.yaml"
|
||||
cmds:
|
||||
- sops --encrypt --in-place {{.CLI_ARGS}}
|
||||
|
||||
decrypt:
|
||||
desc: decrypt sops file 'to use must include -- before path to file.' eg "task sops:decrypt -- file.yml"
|
||||
d:
|
||||
desc: Decrypt sops file 'to use must include -- before path to file.' eg "task sops:d -- file.yaml"
|
||||
cmds:
|
||||
- sops --decrypt --in-place {{.CLI_ARGS}}
|
||||
@@ -5,18 +5,18 @@ tasks:
|
||||
|
||||
init:
|
||||
desc: Initialize terraform dependencies
|
||||
dir: provision/terraform/cloudflare
|
||||
dir: "{{.TERRAFORM_DIR}}/cloudflare"
|
||||
cmds:
|
||||
- terraform init {{.CLI_ARGS}}
|
||||
|
||||
plan:
|
||||
desc: Show the changes terraform will make
|
||||
dir: provision/terraform/cloudflare
|
||||
dir: "{{.TERRAFORM_DIR}}/cloudflare"
|
||||
cmds:
|
||||
- terraform plan {{.CLI_ARGS}}
|
||||
|
||||
apply:
|
||||
desc: Apply the changes to Cloudflare
|
||||
dir: provision/terraform/cloudflare
|
||||
dir: "{{.TERRAFORM_DIR}}/cloudflare"
|
||||
cmds:
|
||||
- terraform apply {{.CLI_ARGS}}
|
||||
Reference in new issue
Block a user