33 lines
1.1 KiB
YAML
33 lines
1.1 KiB
YAML
version: '3'
|
|
|
|
tasks:
|
|
shell-*:
|
|
desc: run a shell on pod with app matching label (try `task shell-d20-functions`)
|
|
cmds:
|
|
# - test -n "{{.POD}}" || (echo "No pod found, try task list-apps" && exit 1)
|
|
- kubectl exec -it {{.POD}} -- bash
|
|
# && kubectl exec -it {{.POD}} -- bash || echo "No pod found"
|
|
# - kubectl exec -it {{.POD}} -- bash
|
|
vars:
|
|
POD:
|
|
sh: kubectl get pods -l app={{index .MATCH 0}} -o name | head -1
|
|
preconditions:
|
|
- kubectl cluster-info
|
|
- test -n "{{.POD}}"
|
|
list-apps:
|
|
desc: list all apps in the environment
|
|
cmds:
|
|
- kubectl get pods -o json | jq -r '[ .items[] | select (.metadata.labels.app != null) | .metadata.labels.app ] | unique[]'
|
|
# - kubectl get pods -o jsonpath='{range .items[*]}{.metadata.labels.app}{"\n"}{end}' | sort | uniq
|
|
preconditions:
|
|
- kubectl cluster-info
|
|
argocd:
|
|
desc: port forward argocd ui
|
|
cmds:
|
|
- kubectl port-forward -n argocd svc/argocd-server --address 0.0.0.0 12345:80
|
|
alloy:
|
|
desc: port forward alloy ui
|
|
cmds:
|
|
- kubectl port-forward -n grafana svc/alloy --address 0.0.0.0 12345:12345
|
|
|