Skip to content
Snippets Groups Projects
shell_aliases.sh 1.31 KiB
Newer Older
#!/usr/bin/env bash
# Define custom bash functions that can be passed around to sub-envs
shopt -s expand_aliases

helm() {
  docker run -t --rm -e HELM_EXPERIMENTAL_OCI="$HELM_EXPERIMENTAL_OCI" -v $(pwd):/apps -w /apps -v ~/.kube:/root/.kube -v ~/.helm:/root/.helm -v ~/.config/helm:/root/.config/helm -v ~/.cache/helm:/root/.cache/helm alpine/helm:3.2.3 "$@"
}
export -f helm

David Hoese's avatar
David Hoese committed
helm_debug() {
  docker run -t --rm -e HELM_EXPERIMENTAL_OCI="$HELM_EXPERIMENTAL_OCI" -e KUBECONFIG="/root/.kube/config" -v $(pwd):/apps -v ~/.kube:/root/.kube -v ~/.helm:/root/.helm -v ~/.config:/root/.config -v ~/.cache:/root/.cache --entrypoint="" alpine/helm:3.2.3 "$@"
David Hoese's avatar
David Hoese committed
}
export -f helm_debug


helm_for_gcp() {
  docker run -t --rm -e HELM_EXPERIMENTAL_OCI="$HELM_EXPERIMENTAL_OCI" -e KUBECONFIG="/root/.kube/config" -v $(pwd):/apps -v ~/.kube:/root/.kube -v ~/.helm:/root/.helm -v ~/.config:/root/.config -v ~/.cache:/root/.cache alpine/helm:3.2.3 "$@"
}
export -f helm_for_gcp

kubectl() {
    docker run -a stdout --rm -v $(pwd):/apps -w /apps alpine/k8s:1.18.2 kubectl "$@"
}
export -f kubectl

kubectl_noattach() {
    docker run --rm -v $(pwd):/apps -w /apps alpine/k8s:1.18.2 kubectl "$@"
}
export -f kubectl_noattach

kubectl_stdin() {
    docker run -a stdin --rm -v $(pwd):/apps -w /apps alpine/k8s:1.18.2 kubectl "$@"
}
export -f kubectl_stdin