From ccb96fd76bcee8cc54f532d221f21ab85701ef90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Sto=CC=88ger?= Date: Thu, 14 Mar 2024 10:40:37 +0100 Subject: [PATCH] Updated coder config, added helm installation --- coder/Dockerfile | 12 +++++- coder/kubectl.alias.txt | 95 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 coder/kubectl.alias.txt diff --git a/coder/Dockerfile b/coder/Dockerfile index dd0f1d2..612056b 100644 --- a/coder/Dockerfile +++ b/coder/Dockerfile @@ -20,7 +20,13 @@ RUN curl https://pyenv.run | bash FROM sys_install as builder RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" -RUN install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl +RUN install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && \ + rm kubectl + +RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && \ + chmod 700 get_helm.sh && \ + ./get_helm.sh && \ + rm ./get_helm.sh FROM builder as prod @@ -32,10 +38,14 @@ RUN mkdir -p /home/coder/.config/code-server/ RUN echo "bind-addr: 127.0.0.1:8080\nauth: none\ncert: false" > /home/coder/.config/code-server/config.yaml RUN cat /home/coder/.config/code-server/config.yaml RUN kubectl +RUN helm help RUN echo "# pyenv" >> .bashrc RUN echo "export PATH=\"$HOME/.pyenv/bin:$PATH\"" >> .bashrc RUN echo "eval \"$(pyenv init --path)\"" >> .bashrc RUN echo "eval \"$(pyenv virtualenv-init -)\"" >> .bashrc +RUN echo "# k8s" >> .bashrc +RUN --mount=type=bind,src=./kubectl.alias.txt,target=./kubectl.alias.txt,readonly \ + cat kubectl.alias.txt >> .bashrc RUN python3 --version RUN pip3 --version diff --git a/coder/kubectl.alias.txt b/coder/kubectl.alias.txt new file mode 100644 index 0000000..e5b2532 --- /dev/null +++ b/coder/kubectl.alias.txt @@ -0,0 +1,95 @@ +alias k=kubectl +alias kaf='kubectl apply -f' +# alias kca='_kca(){ kubectl "$@" --all-namespaces; unset -f _kca; }; _kca' +alias kccc='kubectl config current-context' +alias kcdc='kubectl config delete-context' +alias kcgc='kubectl config get-contexts' +# alias kcn='kubectl config set-context --current --namespace' +alias kcp='kubectl cp' +alias kcsc='kubectl config set-context' +alias kcuc='kubectl config use-context' +alias kdcj='kubectl describe cronjob' +alias kdcm='kubectl describe configmap' +alias kdd='kubectl describe deployment' +alias kdds='kubectl describe daemonset' +alias kdel='kubectl delete' +alias kdelcj='kubectl delete cronjob' +alias kdelcm='kubectl delete configmap' +alias kdeld='kubectl delete deployment' +alias kdelds='kubectl delete daemonset' +alias kdelf='kubectl delete -f' +alias kdeli='kubectl delete ingress' +alias kdelj='kubectl delete job' +alias kdelno='kubectl delete node' +# alias kdelns='kubectl delete namespace' +alias kdelp='kubectl delete pods' +alias kdelpvc='kubectl delete pvc' +alias kdels='kubectl delete svc' +alias kdelsa='kubectl delete sa' +alias kdelsec='kubectl delete secret' +alias kdelss='kubectl delete statefulset' +alias kdi='kubectl describe ingress' +alias kdj='kubectl describe job' +alias kdno='kubectl describe node' +# alias kdns='kubectl describe namespace' +alias kdp='kubectl describe pods' +alias kdpvc='kubectl describe pvc' +alias kdrs='kubectl describe replicaset' +alias kds='kubectl describe svc' +alias kdsa='kubectl describe sa' +alias kdsec='kubectl describe secret' +alias kdss='kubectl describe statefulset' +alias kecj='kubectl edit cronjob' +alias kecm='kubectl edit configmap' +alias ked='kubectl edit deployment' +alias keds='kubectl edit daemonset' +alias kei='kubectl edit ingress' +alias kej='kubectl edit job' +alias keno='kubectl edit node' +# alias kens='kubectl edit namespace' +alias kep='kubectl edit pods' +alias kepvc='kubectl edit pvc' +alias kers='kubectl edit replicaset' +alias kes='kubectl edit svc' +alias kess='kubectl edit statefulset' +alias keti='kubectl exec -t -i' +alias kga='kubectl get all' +# alias kgaa='kubectl get all --all-namespaces' +alias kgcj='kubectl get cronjob' +alias kgcm='kubectl get configmaps' +# alias kgcma='kubectl get configmaps --all-namespaces' +alias kgd='kubectl get deployment' +# alias kgda='kubectl get deployment --all-namespaces' +alias kgds='kubectl get daemonset' +alias kgi='kubectl get ingress' +# alias kgia='kubectl get ingress --all-namespaces' +alias kgj='kubectl get job' +alias kgno='kubectl get nodes' +# alias kgns='kubectl get namespaces' +alias kgp='kubectl get pods' +# alias kgpa='kubectl get pods --all-namespaces' +# alias kgpall='kubectl get pods --all-namespaces -o wide' +alias kgpvc='kubectl get pvc' +# alias kgpvca='kubectl get pvc --all-namespaces' +alias kgrs='kubectl get replicaset' +alias kgs='kubectl get svc' +# alias kgsa='kubectl get svc --all-namespaces' +alias kgsec='kubectl get secret' +# alias kgseca='kubectl get secret --all-namespaces' +alias kgss='kubectl get statefulset' +# alias kgssa='kubectl get statefulset --all-namespaces' +alias kl='kubectl logs' +alias kl1h='kubectl logs --since 1h' +alias kl1m='kubectl logs --since 1m' +alias kl1s='kubectl logs --since 1s' +alias klf='kubectl logs -f' +alias klf1h='kubectl logs --since 1h -f' +alias klf1m='kubectl logs --since 1m -f' +alias klf1s='kubectl logs --since 1s -f' +alias kpf='kubectl port-forward' +alias krh='kubectl rollout history' +alias krsd='kubectl rollout status deployment' +alias krsss='kubectl rollout status statefulset' +alias kru='kubectl rollout undo' +alias ksd='kubectl scale deployment' +alias ksss='kubectl scale statefulset' \ No newline at end of file -- GitLab