-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zsh_k8s
37 lines (33 loc) · 928 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
# shellcheck disable=SC2148
# vim: foldmethod=marker
##################### Source all k8s config files #####################
DOTKUBE_DIR="${HOME}/.kube"
if [ -d "${DOTKUBE_DIR}" ]; then
export KUBECONFIG="${DOTKUBE_DIR}/config"
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
else
echo "${DOTKUBE_DIR} is missing"
fi
#################### 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+=(
cilium
hubble
k3d
kustomize
minikube
)