-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zsh_k8s
41 lines (35 loc) · 996 Bytes
/
.zsh_k8s
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
# shellcheck disable=SC2148
# vim: foldmethod=marker
if command -v kubectl &> /dev/null; then
export KUBECONFIG="${HOME}/.kube/config"
##################### Source all k8s config files #####################
export KUBECONFIG_DIRS=(
"${KUBECONFIG_DIRS[@]}"
"${HOME}/.k3d"
)
for dir in "${KUBECONFIG_DIRS[@]}"; do
if [[ -d ${dir} ]]; then
setopt NULL_GLOB
for config in "${dir}"/**/*.yaml; do
export KUBECONFIG="${KUBECONFIG}:${config}"
done
fi
done
#################### Settings for kubectl and Helm ####################
export HELM_DIFF_OUTPUT_CONTEXT=2
export HELM_DIFF_USE_UPGRADE_DRY_RUN=true
export KUBECTL_EXTERNAL_DIFF="colordiff -N -u"
############################# Completions #############################
X_COMPLETION_ZSH=(
"${X_COMPLETION_ZSH[@]}"
cilium
helm
hubble
k3d
kubectl
kustomize
minikube
)
else
echo "* kubectl is missing" >> "${TODOFILE}"
fi