-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathk8s.justfile
More file actions
24 lines (22 loc) · 918 Bytes
/
k8s.justfile
File metadata and controls
24 lines (22 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
default:
@just --justfile {{ justfile() }} --list
# Gets all pods the given service is associated with
service-pods service $namespace='':
#!/usr/bin/env bash
set -euo pipefail
if [[ -n "$namespace" ]]; then
namespace="-n $namespace"
fi
kubectl ${namespace} get endpoints {{ service }} -o jsonpath='{.subsets[*].addresses[*].ip}' \
| tr ' ' '\n' \
| xargs -I % kubectl ${namespace} get pods --field-selector=status.podIP=%
# Gets the diff between two deployment revisions
rollout-revision-diff deployment rev1 rev2 $namespace='':
#!/usr/bin/env bash
set -euo pipefail
if [[ -n "$namespace" ]]; then
namespace="-n $namespace"
fi
delta \
<(kubectl ${namespace} rollout history deployment {{ deployment }} --revision {{ rev1 }}) \
<(kubectl ${namespace} rollout history deployment {{ deployment }} --revision {{ rev2 }}); true