generated from onedr0p/cluster-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ClusterTasks.yaml
81 lines (67 loc) · 2.82 KB
/
ClusterTasks.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
version: "3"
tasks:
verify:
desc: Verify flux meets the prerequisites
cmd: flux check --pre
install:
desc: Install Flux into your cluster
cmds:
- 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 {{.KUBERNETES_DIR}}/flux/vars/cluster-secrets.sops.yaml | kubectl apply -f -
- sops --decrypt {{.KUBERNETES_DIR}}/flux/vars/cluster-secrets-user.sops.yaml | kubectl apply -f -
- kubectl apply -f {{.KUBERNETES_DIR}}/flux/vars/cluster-settings.yaml
- kubectl apply -f {{.KUBERNETES_DIR}}/flux/vars/cluster-settings-user.yaml
- kubectl apply --kustomize {{.KUBERNETES_DIR}}/flux/config
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: "{{.ROOT_DIR}}/age.key"
reconcile:
desc: Force update Flux to pull in changes from your Git repository
cmd: flux reconcile -n flux-system kustomization cluster --with-source
hr-restart:
desc: Restart all failed Helm Releases
cmds:
- kubectl get hr --all-namespaces | grep False | awk '{print $2, $1}' | xargs -L1 bash -c 'flux suspend hr $0 -n $1'
- kubectl get hr --all-namespaces | grep False | awk '{print $2, $1}' | xargs -L1 bash -c 'flux resume hr $0 -n $1'
nodes:
desc: List all the nodes in your cluster
cmd: kubectl get nodes {{.CLI_ARGS | default "-o wide"}}
pods:
desc: List all the pods in your cluster
cmd: kubectl get pods {{.CLI_ARGS | default "-A"}}
kustomizations:
desc: List all the kustomizations in your cluster
cmd: kubectl get kustomizations {{.CLI_ARGS | default "-A"}}
helmreleases:
desc: List all the helmreleases in your cluster
cmd: kubectl get helmreleases {{.CLI_ARGS | default "-A"}}
helmrepositories:
desc: List all the helmrepositories in your cluster
cmd: kubectl get helmrepositories {{.CLI_ARGS | default "-A"}}
gitrepositories:
desc: List all the gitrepositories in your cluster
cmd: kubectl get gitrepositories {{.CLI_ARGS | default "-A"}}
certificates:
desc: List all the certificates in your cluster
cmds:
- kubectl get certificates {{.CLI_ARGS | default "-A"}}
- kubectl get certificaterequests {{.CLI_ARGS | default "-A"}}
ingresses:
desc: List all the ingresses in your cluster
cmd: kubectl get ingress {{.CLI_ARGS | default "-A"}}
resources:
desc: Gather common resources in your cluster, useful when asking for support
cmds:
- task: nodes
- task: kustomizations
- task: helmreleases
- task: helmrepositories
- task: gitrepositories
- task: certificates
- task: ingresses
- task: pods