-
-
Notifications
You must be signed in to change notification settings - Fork 271
/
Taskfile.yaml
59 lines (53 loc) · 1.84 KB
/
Taskfile.yaml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: '3'
vars:
KUBECONFORM_SCRIPT: "{{.SCRIPTS_DIR}}/kubeconform.sh"
tasks:
apply-ks:
desc: Apply a Flux KS for a cluster [PATH=required]
cmd: >
flux build --namespace flux-system 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 = "flux-system")' -
| kubectl apply --server-side --field-manager=kustomize-controller --filename -
requires:
vars: [PATH]
vars:
KS:
sh: flux --namespace flux-system get kustomizations {{base .PATH}} 2>&1
preconditions:
- test -f {{.KUBERNETES_DIR}}/apps/{{.PATH}}/ks.yaml
- which flux kubectl yq
reconcile:
desc: Force update Flux to pull in changes from your Git repository
cmd: flux --namespace flux-system reconcile kustomization cluster --with-source
preconditions:
- test -f {{.KUBECONFIG}}
- which flux
kubeconform:
desc: Validate Kubernetes manifests with kubeconform
cmd: bash {{.KUBECONFORM_SCRIPT}} {{.KUBERNETES_DIR}}
preconditions:
- test -f {{.KUBECONFORM_SCRIPT}}
- which kubeconform
resources:
desc: Gather common resources in your cluster, useful when asking for support
cmds:
- for: { var: RESOURCE }
cmd: kubectl get {{.ITEM}} {{.CLI_ARGS | default "-A"}}
vars:
RESOURCE: >-
nodes
gitrepositories
kustomizations
helmrepositories
helmreleases
certificates
certificaterequests
ingresses
pods
preconditions:
- test -f {{.KUBECONFIG}}
- which kubectl