-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
# yaml-language-server: $schema=https://taskfile.dev/schema.json | ||
version: "3" | ||
|
||
tasks: | ||
delete-failed-pods: | ||
desc: Deletes pods with Failed phase | ||
cmds: | ||
- task: _delete_pods_in_phase | ||
vars: | ||
PHASE: Failed | ||
|
||
delete-succeeded-pods: | ||
desc: Deletes pods with Succeeded phase | ||
cmds: | ||
- task: _delete_pods_in_phase | ||
vars: | ||
PHASE: Succeeded | ||
|
||
delete-pending-pods: | ||
desc: Deletes pods with Pending phase | ||
cmds: | ||
- task: _delete_pods_in_phase | ||
vars: | ||
PHASE: Pending | ||
|
||
_delete_pods_in_phase: | ||
desc: Deletes pods with a specific phase | ||
internal: true | ||
requires: | ||
vars: | ||
- PHASE | ||
cmds: | ||
- for: | ||
var: PHASE | ||
split: "," | ||
cmd: kubectl delete pods --field-selector status.phase={{.ITEM}} -A --ignore-not-found=true | ||
|
||
sync-externalsecret: | ||
desc: Sync ExternalSecret resource | ||
summary: | | ||
Args: | ||
NS: Namespace the PVC is in (default: default) | ||
NAME: ExternalSecret to sync (default: all secrets) | ||
silent: true | ||
vars: | ||
NS: '{{.NS | default "default"}}' | ||
NAME: '{{ .NAME | default "" }}' | ||
cmds: | ||
- | | ||
{{if eq .NAME ""}} | ||
kubectl get externalsecret.external-secrets.io --all-namespaces --no-headers -A | awk '{print $1, $2}' \ | ||
| xargs --max-procs=2 -n 2 bash -c 'echo "Namespace: $0, Name: $1"; kubectl --namespace $0 annotate externalsecret.external-secrets.io $1 force-sync=$(date +%s) --overwrite' | ||
{{else}} | ||
kubectl --namespace {{.NS}} annotate externalsecret.external-secrets.io {{.NAME}} force-sync=$(date +%s) --overwrite | ||
{{end}} | ||
preconditions: | ||
- sh: '{{if ne .NAME ""}}kubectl --namespace {{.NS}} get externalsecret {{.NAME}}{{end}}' | ||
msg: "ExternalSecret {{.NAME}} not found in namespace {{.NS}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
version: "3" | ||
|
||
vars: | ||
KUBERNETES_DIR: "{{.ROOT_DIR}}/terraform/talos" | ||
K8S_CLUSTER: '{{.K8S_CLUSTER | default "main"}}' | ||
|
||
includes: | ||
pre-commit: | ||
taskfile: .taskfiles/pre-commit | ||
dir: .taskfiles/pre-commit | ||
talos: | ||
taskfile: .taskfiles/talos | ||
dir: .taskfiles/talos | ||
kubernetes: | ||
taskfile: .taskfiles/kubernetes | ||
dir: .taskfiles/kubernetes | ||
|
||
tasks: | ||
default: | ||
silent: true | ||
cmds: | ||
- task -l |