mirror of
https://github.com/outbackdingo/home-ops.git
synced 2026-01-27 10:19:11 +00:00
feat: add scripts
This commit is contained in:
@@ -3,6 +3,31 @@ version: "3"
|
||||
|
||||
tasks:
|
||||
|
||||
verify:
|
||||
desc: Verify flux meets the prerequisites
|
||||
cmds:
|
||||
- flux check --pre
|
||||
|
||||
install:
|
||||
desc: Install Flux into your cluster
|
||||
cmds:
|
||||
- kubectl apply --kustomize {{.CLUSTER_DIR}}/bootstrap/
|
||||
- cat {{.SOPS_AGE_KEY_FILE}} | kubectl -n flux-system create secret generic sops-age --from-file=age.agekey=/dev/stdin
|
||||
- kubectl apply --kustomize {{.CLUSTER_DIR}}/flux/flux-system/
|
||||
- task: reconcile
|
||||
preconditions:
|
||||
- sh: test -f {{.SOPS_AGE_KEY_FILE}}
|
||||
msg: |
|
||||
Age key file is not found. Did you forget to create it?
|
||||
vars:
|
||||
SOPS_AGE_KEY_FILE: ~/.config/sops/age/keys.txt
|
||||
|
||||
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
|
||||
|
||||
list-dockerhub:
|
||||
desc: What dockerhub images are running in my cluster
|
||||
cmds:
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
---
|
||||
version: "3"
|
||||
|
||||
vars:
|
||||
PROJECT_DIR:
|
||||
sh: "git rev-parse --show-toplevel"
|
||||
CLUSTER_DIR: "{{.PROJECT_DIR}}/cluster"
|
||||
ANSIBLE_DIR: "{{.PROJECT_DIR}}/provision/ansible"
|
||||
TERRAFORM_DIR: "{{.PROJECT_DIR}}/provision/terraform"
|
||||
|
||||
includes:
|
||||
ansible: .taskfiles/AnsibleTasks.yml
|
||||
backup: .taskfiles/BackupTasks.yml
|
||||
|
||||
20
hack/deploy.sh
Executable file
20
hack/deploy.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Configure the control-plane nodes
|
||||
talosctl apply-config -i -n k8s-control01 -f ../talos/clusterconfig/cluster01-k8s-control01.dfw.56k.sh.yaml
|
||||
talosctl apply-config -i -n k8s-control02 -f ../talos/clusterconfig/cluster01-k8s-control02.dfw.56k.sh.yaml
|
||||
talosctl apply-config -i -n k8s-control03 -f ../talos/clusterconfig/cluster01-k8s-control03.dfw.56k.sh.yaml
|
||||
|
||||
# Configure the worker nodes
|
||||
talosctl apply-config -i -n k8s-worker01 -f ../talos/clusterconfig/cluster01-k8s-worker01.dfw.56k.sh.yaml
|
||||
talosctl apply-config -i -n k8s-worker02 -f ../talos/clusterconfig/cluster01-k8s-worker02.dfw.56k.sh.yaml
|
||||
talosctl apply-config -i -n k8s-worker03 -f ../talos/clusterconfig/cluster01-k8s-worker03.dfw.56k.sh.yaml
|
||||
|
||||
# talosctl --talosconfig=./talosconfig config endpoint k8s-control01 k8s-control02 k8s-control03
|
||||
# talosctl config merge ./talosconfig
|
||||
|
||||
# It will take a few minutes for the nodes to spin up with the configuration. Once ready, execute
|
||||
# talosctl --talosconfig=./talosconfig bootstrap -n k8s-control01
|
||||
|
||||
# It will then take a few more minutes for Kubernetes to get up and running on the nodes. Once ready, execute
|
||||
# talosctl --talosconfig=./talosconfig kubeconfig -n k8s-control01
|
||||
14
hack/reset.sh
Executable file
14
hack/reset.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Reset the worker nodes first since the path to them is through the control plane nodes
|
||||
talosctl reset --graceful=false --reboot -n k8s-control01 -e k8s-control01
|
||||
talosctl reset --graceful=false --reboot -n k8s-control02 -e k8s-control02
|
||||
talosctl reset --graceful=false --reboot -n k8s-control03 -e k8s-control03
|
||||
|
||||
echo "Waiting for workers to reset... ^C to stop here"
|
||||
sleep 5
|
||||
|
||||
# Reset the control plane nodes
|
||||
talosctl reset --graceful=false --reboot -n k8s-worker01 -e k8s-worker01
|
||||
talosctl reset --graceful=false --reboot -n k8s-worker02 -e k8s-worker02
|
||||
talosctl reset --graceful=false --reboot -n k8s-worker03 -e k8s-worker03
|
||||
Reference in New Issue
Block a user