generated from onedr0p/cluster-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod.just
More file actions
66 lines (53 loc) · 2.62 KB
/
mod.just
File metadata and controls
66 lines (53 loc) · 2.62 KB
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
set quiet := true
set shell := ['bash', '-euo', 'pipefail', '-c']
kubernetes_dir := justfile_dir() + '/kubernetes'
[private]
default:
just -l kubernetes
[doc('Open a shell on a node')]
node-shell node:
kubectl debug node/{{ node }} -n default -it --image="mirror.gcr.io/alpine:latest" --profile sysadmin
kubectl delete pod -n default -l app.kubernetes.io/managed-by=kubectl-debug
[doc('Prune pods in Failed, Pending, or Succeeded state')]
prune-pods:
for phase in Failed Pending Succeeded; do \
kubectl delete pods -A --field-selector status.phase="$phase" --ignore-not-found=true; \
done
[doc('Read secret value from secret in plaintext')]
read-secret namespace secret key:
kubectl get secret '{{secret}}' -n '{{namespace}}' -o jsonpath='{.data.{{key}}}' | base64 --decode
[doc('Sync a single ExternalSecret')]
sync-es namespace secret:
@kubectl -n '{{namespace}}' annotate externalsecret '{{secret}}' force-sync="$(date +%s)" --overwrite
[doc('Sync All ExternalSecrets')]
sync-all-es:
kubectl get es --no-headers -A | while read -r ns name _; do \
kubectl -n "$ns" annotate --field-manager flux-client-side-apply --overwrite es "$name" force-sync="$(date +%s)"; \
done
[doc('Sync GitRepositories')]
sync-git:
kubectl get gitrepo --no-headers -A | while read -r ns name _; do \
kubectl -n "$ns" annotate --field-manager flux-client-side-apply --overwrite gitrepo "$name" reconcile.fluxcd.io/requestedAt="$(date +%s)"; \
done
[doc('Sync HelmReleases')]
sync-hr:
kubectl get hr --no-headers -A | while read -r ns name _; do \
kubectl -n "$ns" annotate --field-manager flux-client-side-apply --overwrite hr "$name" reconcile.fluxcd.io/requestedAt="$(date +%s)" reconcile.fluxcd.io/forceAt="$(date +%s)"; \
done
[doc('Sync Kustomizations')]
sync-ks:
kubectl get ks --no-headers -A | while read -r ns name _; do \
kubectl -n "$ns" annotate --field-manager flux-client-side-apply --overwrite ks "$name" reconcile.fluxcd.io/requestedAt="$(date +%s)"; \
done
[doc('Sync OCIRepositories')]
sync-oci:
kubectl get ocirepo --no-headers -A | while read -r ns name _; do \
kubectl -n "$ns" annotate --field-manager flux-client-side-apply --overwrite ocirepo "$name" reconcile.fluxcd.io/requestedAt="$(date +%s)"; \
done
[doc('Clear Rook Ceph Crash Reports')]
clear-ceph-crashes:
kubectl -n rook-ceph exec deploy/rook-ceph-tools -- ceph crash archive-all
kubectl -n rook-ceph exec deploy/rook-ceph-tools -- ceph status
[doc('Open a bash shell in the Rook Ceph tools pod')]
rook-console:
kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- /bin/bash