refactor!: project updates (#1326)
* refactor!: flux is required again Signed-off-by: Devin Buhl <devin@buhl.casa> * fix: delimiter that chomps Signed-off-by: Devin Buhl <devin@buhl.casa> * fix: bootstrap_cloudflare logic Signed-off-by: Devin Buhl <devin@buhl.casa> * fix: update tests Signed-off-by: Devin Buhl <devin@buhl.casa> * fix: remove last quote Signed-off-by: Devin Buhl <devin@buhl.casa> * chore: update readme Signed-off-by: Devin Buhl <devin@buhl.casa> --------- Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
1 parent
04ff4ef994
commit
c17d543b21
93 files changed
+591
-755
No files matched your search
@@ -7,7 +7,7 @@ vars:
|
||||
PROMETHEUS_OPERATOR_VERSION: v0.71.2
|
||||
CLUSTER_SECRET_SOPS_FILE: "{{.KUBERNETES_DIR}}/flux/vars/cluster-secrets.sops.yaml"
|
||||
CLUSTER_SETTINGS_FILE: "{{.KUBERNETES_DIR}}/flux/vars/cluster-settings.yaml"
|
||||
GITHUB_DEPLOY_KEY_FILE: "{{.KUBERNETES_DIR}}/bootstrap/github-deploy-key.sops.yaml"
|
||||
GITHUB_DEPLOY_KEY_FILE: "{{.KUBERNETES_DIR}}/bootstrap/flux/github-deploy-key.sops.yaml"
|
||||
|
||||
tasks:
|
||||
|
||||
@@ -18,7 +18,7 @@ tasks:
|
||||
- kubectl apply --kubeconfig {{.KUBECONFIG_FILE}} --server-side --filename https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/{{.PROMETHEUS_OPERATOR_VERSION}}/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml
|
||||
- kubectl apply --kubeconfig {{.KUBECONFIG_FILE}} --server-side --filename https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/{{.PROMETHEUS_OPERATOR_VERSION}}/example/prometheus-operator-crd/monitoring.coreos.com_scrapeconfigs.yaml
|
||||
- kubectl apply --kubeconfig {{.KUBECONFIG_FILE}} --server-side --filename https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/{{.PROMETHEUS_OPERATOR_VERSION}}/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
|
||||
- kubectl apply --kubeconfig {{.KUBECONFIG_FILE}} --server-side --kustomize {{.KUBERNETES_DIR}}/bootstrap
|
||||
- kubectl apply --kubeconfig {{.KUBECONFIG_FILE}} --server-side --kustomize {{.KUBERNETES_DIR}}/bootstrap/flux
|
||||
- cat {{.AGE_FILE}} | kubectl -n flux-system create secret generic sops-age --from-file=age.agekey=/dev/stdin
|
||||
- sops --decrypt {{.CLUSTER_SECRET_SOPS_FILE}} | kubectl apply --kubeconfig {{.KUBECONFIG_FILE}} --server-side --filename -
|
||||
- kubectl apply --kubeconfig {{.KUBECONFIG_FILE}} --server-side --filename {{.CLUSTER_SETTINGS_FILE}}
|
||||
|
||||
@@ -26,10 +26,7 @@ tasks:
|
||||
|
||||
kubeconform:
|
||||
desc: Validate Kubernetes manifests with kubeconform
|
||||
cmd: |
|
||||
if [ -d "{{.KUBERNETES_DIR}}/flux" ]; then
|
||||
bash {{.KUBECONFORM_SCRIPT}} {{.KUBERNETES_DIR}}
|
||||
fi
|
||||
cmd: bash {{.KUBECONFORM_SCRIPT}} {{.KUBERNETES_DIR}}
|
||||
preconditions:
|
||||
- { msg: "Missing kubeconform script", sh: "test -f {{.KUBECONFORM_SCRIPT}}" }
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
version: "3"
|
||||
|
||||
vars:
|
||||
TALOS_DIR: "{{.KUBERNETES_DIR}}/talos"
|
||||
TALOS_DIR: "{{.KUBERNETES_DIR}}/bootstrap/talos"
|
||||
TALHELPER_SECRET_FILE: "{{.TALOS_DIR}}/talhelper.sops.yaml"
|
||||
TALHELPER_CONFIG_FILE: "{{.TALOS_DIR}}/talconfig.yaml"
|
||||
|
||||
@@ -21,7 +21,7 @@ tasks:
|
||||
- task: bootstrap-apply
|
||||
- task: bootstrap-install
|
||||
- task: fetch-kubeconfig
|
||||
- task: bootstrap-core-apps
|
||||
- task: bootstrap-apps
|
||||
- talosctl health --server=false
|
||||
|
||||
bootstrap-gensecret:
|
||||
@@ -61,14 +61,13 @@ tasks:
|
||||
preconditions:
|
||||
- { msg: "Missing talhelper config file", sh: "test -f {{.TALHELPER_CONFIG_FILE}}" }
|
||||
|
||||
bootstrap-core-apps:
|
||||
desc: Bootstrap Helm apps
|
||||
bootstrap-apps:
|
||||
desc: Bootstrap core apps needed for Talos
|
||||
dir: "{{.TALOS_DIR}}"
|
||||
cmds:
|
||||
- until kubectl wait --for=condition=Ready=False nodes --all --timeout=600s; do sleep 10; done
|
||||
- kubectl --kubeconfig {{.KUBECONFIG_FILE}} kustomize --enable-helm ./cilium | kubectl apply --kubeconfig {{.KUBECONFIG_FILE}} --server-side --filename -
|
||||
- kubectl --kubeconfig {{.KUBECONFIG_FILE}} kustomize --enable-helm ./kubelet-csr-approver | kubectl apply --kubeconfig {{.KUBECONFIG_FILE}} --server-side --filename -
|
||||
- until kubectl wait --for=condition=Ready nodes --all --timeout=600s; do sleep 10; done
|
||||
- until kubectl --kubeconfig {{.KUBECONFIG_FILE}} wait --for=condition=Ready=False nodes --all --timeout=600s; do sleep 10; done
|
||||
- helmfile --file ./apps/helmfile.yaml apply
|
||||
- until kubectl --kubeconfig {{.KUBECONFIG_FILE}} wait --for=condition=Ready nodes --all --timeout=600s; do sleep 10; done
|
||||
preconditions:
|
||||
- { msg: "Missing kubeconfig", sh: "test -f {{.KUBECONFIG_FILE}}" }
|
||||
|
||||
@@ -95,13 +94,13 @@ tasks:
|
||||
|
||||
soft-nuke:
|
||||
desc: Resets nodes back to maintenance mode so you can re-deploy again straight after
|
||||
prompt: "This will destroy your cluster and reset the nodes back to maintenance mode. Are you sure?"
|
||||
prompt: This will destroy your cluster and reset the nodes back to maintenance mode... continue?
|
||||
dir: "{{.TALOS_DIR}}"
|
||||
cmd: talhelper gencommand reset --extra-flags "--reboot --system-labels-to-wipe STATE --system-labels-to-wipe EPHEMERAL --graceful=false --wait=false" | bash
|
||||
|
||||
hard-nuke:
|
||||
desc: Resets nodes back completely and reboots them
|
||||
prompt: "This will destroy your cluster and reset the nodes. Are you sure?"
|
||||
prompt: This will destroy your cluster and reset the nodes... continue?
|
||||
dir: "{{.TALOS_DIR}}"
|
||||
cmd: talhelper gencommand reset --extra-flags "--reboot --graceful=false --wait=false" | bash
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ flux-bin
|
||||
go-task
|
||||
go-yq
|
||||
helm
|
||||
helmfile
|
||||
jq
|
||||
kubeconform
|
||||
kubectl-bin
|
||||
|
||||
@@ -7,6 +7,7 @@ brew "direnv"
|
||||
brew "fluxcd/tap/flux"
|
||||
brew "go-task/tap/go-task"
|
||||
brew "helm"
|
||||
brew "helmfile"
|
||||
brew "jq"
|
||||
brew "kubeconform"
|
||||
brew "kubernetes-cli"
|
||||
|
||||
@@ -56,6 +56,7 @@ tasks:
|
||||
- FiloSottile/age?as=age&type=script
|
||||
- fluxcd/flux2?as=flux&type=script
|
||||
- getsops/sops?as=sops&type=script
|
||||
- helmfile/helmfile?as=helmfile&type=script
|
||||
- jqlang/jq?as=jq&type=script
|
||||
- kubernetes-sigs/kustomize?as=kustomize&type=script
|
||||
- siderolabs/talos?as=talosctl&type=script
|
||||
|
||||
Reference in new issue
Block a user