feat(yaskfile): updates and reorganizations (#1607)

This commit is contained in:
Devin Buhl authored and GitHub committed 2024-10-17 15:45:45 -04:00
1 parent 50b6f98dd7
commit 7570388c32
17 files changed
+254 -268

No files matched your search

+37 -10
View File
@@ -7,6 +7,41 @@ vars:
tasks:
apply-ks:
desc: Apply a Flux Kustomization resource for a cluster
summary: |-
PATH: Path to the Flux Kustomization resource from the apps base dir (required, e.g. network/echo-server)
NS: Namespace the Flux Kustomization exists in (default: flux-system)
cmd: >
flux build --namespace {{.NS}} ks {{base .PATH}}
--kustomization-file {{.KUBERNETES_DIR}}/apps/{{.PATH}}/ks.yaml
--path {{.KUBERNETES_DIR}}/apps/{{.PATH}}
{{- if contains "not found" .KS }}--dry-run \{{ end }}
| yq 'with(select(.apiVersion == "kustomize.toolkit.fluxcd.io/v1" and .kind == "Kustomization"); .metadata.namespace = "{{.NS}}")' -
| kubectl apply --server-side --field-manager=kustomize-controller -f -
requires:
vars: [PATH]
vars:
NS: '{{.NS | default "flux-system"}}'
KS:
sh: flux --namespace {{.NS}} get kustomizations {{base .PATH}} 2>&1
preconditions:
- test -f {{.KUBERNETES_DIR}}/apps/{{.PATH}}/ks.yaml
reconcile:
desc: Force update Flux to pull in changes from your Git repository
cmd: flux reconcile --namespace flux-system kustomization cluster --with-source
preconditions:
- msg: Missing kubeconfig
sh: test -f {{.KUBECONFIG}}
kubeconform:
desc: Validate Kubernetes manifests with kubeconform
cmd: bash {{.KUBECONFORM_SCRIPT}} {{.KUBERNETES_DIR}}
preconditions:
- msg: Missing kubeconform script
sh: test -f {{.KUBECONFORM_SCRIPT}}
resources:
desc: Gather common resources in your cluster, useful when asking for support
cmds:
@@ -23,14 +58,6 @@ tasks:
certificaterequests
ingresses
pods
kubeconform:
desc: Validate Kubernetes manifests with kubeconform
cmd: bash {{.KUBECONFORM_SCRIPT}} {{.KUBERNETES_DIR}}
preconditions:
- msg: Missing kubeconform script
sh: test -f {{.KUBECONFORM_SCRIPT}}
reset:
internal: true
cmd: rm -rf {{.KUBERNETES_DIR}}
- msg: Missing kubeconfig
sh: test -f {{.KUBECONFIG}}