Last active
March 13, 2024 13:36
-
-
Save jonashackt/df283eb3f5ed587ee1f93cbcfc23be08 to your computer and use it in GitHub Desktop.
Revisions
-
jonashackt revised this gist
Mar 13, 2024 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ k9s cheatsheet: https://www.hackingnote.com/en/cheatsheets/k9s/ # CLI enhancements https://discuss.kubernetes.io/t/kubectl-tips-and-tricks/192 -
jonashackt revised this gist
Dec 20, 2022 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -180,3 +180,5 @@ Bare metal Kubernetes: https://www.siderolabs.com/platform/bare-metal-kubernetes K8s simple deployment tooling (simpler than Argo and Flux): https://werf.io/ KubeCon 2022 Recordings: https://www.youtube.com/playlist?list=PLj6h78yzYM2MCEgkd8zH0vJWF7jdQ-GRR VMWare Tanzu on a Laptop: https://tanzu.vmware.com/developer/guides/tanzu-application-platform-local-devloper-install/ (and in GitHub Actions etc.) -
jonashackt revised this gist
Dec 20, 2022 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -177,4 +177,6 @@ Docker Desktop alternatives: https://podman-desktop.io/ Bare metal Kubernetes: https://www.siderolabs.com/platform/bare-metal-kubernetes-sidero/ K8s simple deployment tooling (simpler than Argo and Flux): https://werf.io/ KubeCon 2022 Recordings: https://www.youtube.com/playlist?list=PLj6h78yzYM2MCEgkd8zH0vJWF7jdQ-GRR -
jonashackt revised this gist
Dec 20, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -177,3 +177,4 @@ Docker Desktop alternatives: https://podman-desktop.io/ Bare metal Kubernetes: https://www.siderolabs.com/platform/bare-metal-kubernetes-sidero/ KubeCon 2022 Recordings: https://www.youtube.com/playlist?list=PLj6h78yzYM2MCEgkd8zH0vJWF7jdQ-GRR -
jonashackt revised this gist
Dec 20, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -175,5 +175,5 @@ Telepresence alternative: https://gefyra.dev/ Docker Desktop alternatives: https://podman-desktop.io/ Bare metal Kubernetes: https://www.siderolabs.com/platform/bare-metal-kubernetes-sidero/ -
jonashackt revised this gist
Dec 20, 2022 . 1 changed file with 16 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -161,3 +161,19 @@ kubectl run hostnames --image=k8s.gcr.io/serve_hostname \ kubectl describe nodes # Awesome tools Cluster in cluster: https://www.vcluster.com/ & https://github.com/loft-sh/vcluster https://github.com/ahmetb/kubectl-tree Deployment abstraction above Helm: https://www.acorn.io/ https://microk8s.io/ Telepresence alternative: https://gefyra.dev/ Docker Desktop alternatives: https://podman-desktop.io/ -
jonashackt revised this gist
Dec 20, 2022 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,8 @@ https://discuss.kubernetes.io/t/kubectl-tips-and-tricks/192 krew as the Kubernetes CLI (kubectl) plugin manager helps to install all the tools: https://krew.sigs.k8s.io/ #### kubectl autocompletion Install kubectl -
jonashackt revised this gist
Dec 13, 2021 . 1 changed file with 13 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -67,6 +67,9 @@ Now this could all look like this: [](https://asciinema.org/a/441785) For evaluation tools ee https://learnk8s.io/validating-kubernetes-yaml #### kubeval Install via homebrew (see https://www.kubeval.com/installation/): @@ -79,6 +82,16 @@ brew install kubeval Now use `kubeval your-yaml-to-check.yaml` #### kubescore Install via homebrew (see https://github.com/zegl/kube-score#installation): `brew install kube-score` Run with ``` kube-score score your-yaml-to-check.yaml ``` # K8s cluster ### See logs of K8s cluster -
jonashackt revised this gist
Dec 13, 2021 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -67,6 +67,18 @@ Now this could all look like this: [](https://asciinema.org/a/441785) #### kubeval Install via homebrew (see https://www.kubeval.com/installation/): ``` brew tap instrumenta/instrumenta brew install kubeval ``` Now use `kubeval your-yaml-to-check.yaml` # K8s cluster ### See logs of K8s cluster -
jonashackt revised this gist
Oct 14, 2021 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -63,6 +63,10 @@ kubeon kubeoff ``` Now this could all look like this: [](https://asciinema.org/a/441785) # K8s cluster ### See logs of K8s cluster -
jonashackt revised this gist
Oct 13, 2021 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,7 @@ # CLI enhancements https://discuss.kubernetes.io/t/kubectl-tips-and-tricks/192 #### kubectl autocompletion Install kubectl -
jonashackt revised this gist
Oct 13, 2021 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # CLI enhancements #### kubectl autocompletion Install kubectl @@ -39,7 +39,7 @@ $(brew --prefix)/opt/fzf/install Now your `kubectx` and `kubens` are super powered as interactive mode :) #### kube-ps1 https://github.com/jonmosco/kube-ps1: -
jonashackt revised this gist
Oct 13, 2021 . 1 changed file with 13 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,18 @@ # CLI enhancements # kubectl autocompletion Install kubectl then configure autocompletion as stated in the docs: https://kubernetes.io/docs/tasks/tools/install-kubectl-macos/#optional-kubectl-configurations-and-plugins with adding the following to your ~/.zshrc or ~/.bashrc: ``` ### kubectl autocompletion & alias k source <(kubectl completion zsh) alias k=kubectl complete -F __start_kubectl k ``` #### kubectx & kubens https://github.com/ahmetb/kubectx: Install via brew: `brew install kubectx` -
jonashackt revised this gist
Oct 13, 2021 . 1 changed file with 13 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,19 @@ kubectx kubectx k3d ``` #### kubectx interactive mode If you want a fancy interactive mode, you need to install https://github.com/junegunn/fzf#using-homebrew ``` brew install fzf # To install useful key bindings and fuzzy completion: $(brew --prefix)/opt/fzf/install ``` Now your `kubectx` and `kubens` are super powered as interactive mode :) ### kube-ps1 https://github.com/jonmosco/kube-ps1: -
jonashackt revised this gist
Oct 13, 2021 . 1 changed file with 24 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,7 @@ # CLI enhancements #### kubectx & kubens https://github.com/ahmetb/kubectx: Install via brew: `brew install kubectx` Now run it and switch with ease: @@ -11,6 +13,28 @@ kubectx kubectx k3d ``` ### kube-ps1 https://github.com/jonmosco/kube-ps1: install via: ``` brew install kube-ps1 # now source kube-ps1.sh in your ~/.zshrc or ~/.bashrc. Therefore add the following 2 lines to them: source "/usr/local/opt/kube-ps1/share/kube-ps1.sh" PS1='$(kube_ps1)'$PS1 ``` Now you should already see the current k8s context & namespace inside your prompt: ``` # switch on and off kubeon kubeoff ``` # K8s cluster ### See logs of K8s cluster -
jonashackt revised this gist
Oct 13, 2021 . 1 changed file with 7 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,14 @@ # CLI enhancements https://github.com/ahmetb/kubectx: Install via brew: `brew install kubectx` Now run it and switch with ease: ``` # list all contexts kubectx # switch kubectx k3d ``` # K8s cluster -
jonashackt revised this gist
Oct 13, 2021 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,11 @@ # CLI enhancements https://github.com/ahmetb/kubectx: Install via brew: ``` brew install kubectx ``` # K8s cluster ### See logs of K8s cluster -
jonashackt revised this gist
Aug 31, 2018 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -56,6 +56,7 @@ kubectl run hostnames --image=k8s.gcr.io/serve_hostname \ --replicas=3 ``` `kubectl expose deployment hostnames --port=80 --target-port=9376` # Worker -
jonashackt renamed this gist
Aug 31, 2018 . 1 changed file with 28 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,51 +1,66 @@ # K8s cluster ### See logs of K8s cluster https://kubernetes.io/docs/tasks/debug-application-cluster/debug-cluster/#looking-at-logs ### show k8s api-server logging sudo journalctl -u kube-apiserver --follow see https://kubernetes.io/docs/reference/kubectl/cheatsheet/ ### Retrieve cluster info kubectl cluster-info dump ### every component with namespace kube-system kubectl get all --namespace kube-system ### every component kubectl get all --all-namespaces # etcd ### get all etcd entries ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1:2379 --cacert=/etc/etcd/ca.pem --cert=/etc/etcd/kube-apiserver.pem --key=/etc/etcd/kube-apiserver-key.pem get / --prefix --keys-only # Networking kubectl get nodes --output json ### Flannel logging kubectl logs -n kube-system kube-flannel-ds-cw7kf -c kube-flannel kubectl get pod kube-flannel-ds-cw7kf --namespace kube-system -o yaml ### Kube-DNS kubectl describe pods -l k8s-app=kube-dns -n kube-system kubectl get nodes --output=jsonpath='{range .items[*]}{.status.addresses[?(@.type=="InternalIP")].address} {.spec.podCIDR} {"\n"}{end}' ### Debug kube-dns see https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/ kubectl logs --namespace=kube-system $(kubectl get pods --namespace=kube-system -l k8s-app=kube-dns -o name | head -1) -c kubedns kubectl logs --namespace=kube-system $(kubectl get pods --namespace=kube-system -l k8s-app=kube-dns -o name | head -1) -c dnsmasq kubectl logs --namespace=kube-system $(kubectl get pods --namespace=kube-system -l k8s-app=kube-dns -o name | head -1) -c sidecar ### CoreDNS kubectl describe pod/coredns-65db874f4f-lz5hl --namespace kube-system ### DNS see https://kubernetes.io/docs/tasks/debug-application-cluster/debug-service/#does-the-service-work-by-ip ``` kubectl run hostnames --image=k8s.gcr.io/serve_hostname \ --labels=app=hostnames \ --port=9376 \ --replicas=3 ``` # Worker ### K8s nodes in State NotReady kubectl describe nodes -
jonashackt revised this gist
Aug 26, 2018 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -37,6 +37,8 @@ kubectl get nodes --output=jsonpath='{range .items[*]}{.status.addresses[?(@.typ ## see https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/ kubectl logs --namespace=kube-system $(kubectl get pods --namespace=kube-system -l k8s-app=kube-dns -o name | head -1) -c kubedns kubectl logs --namespace=kube-system $(kubectl get pods --namespace=kube-system -l k8s-app=kube-dns -o name | head -1) -c dnsmasq kubectl logs --namespace=kube-system $(kubectl get pods --namespace=kube-system -l k8s-app=kube-dns -o name | head -1) -c sidecar # CoreDNS kubectl describe pod/coredns-65db874f4f-lz5hl --namespace kube-system -
jonashackt revised this gist
Aug 26, 2018 . 1 changed file with 13 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -33,5 +33,17 @@ kubectl describe pods -l k8s-app=kube-dns -n kube-system kubectl get nodes --output=jsonpath='{range .items[*]}{.status.addresses[?(@.type=="InternalIP")].address} {.spec.podCIDR} {"\n"}{end}' ## Debug kube-dns ## see https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/ kubectl logs --namespace=kube-system $(kubectl get pods --namespace=kube-system -l k8s-app=kube-dns -o name | head -1) -c kubedns # CoreDNS kubectl describe pod/coredns-65db874f4f-lz5hl --namespace kube-system # Worker ### K8s nodes in State NotReady kubectl describe nodes -
jonashackt renamed this gist
Aug 23, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
jonashackt revised this gist
Aug 15, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ # See logs of K8s cluster https://kubernetes.io/docs/tasks/debug-application-cluster/debug-cluster/#looking-at-logs # show k8s api-server logging sudo journalctl -u kube-apiserver --follow #see https://kubernetes.io/docs/reference/kubectl/cheatsheet/ # Retrieve cluster info -
jonashackt revised this gist
Aug 15, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ # See logs of K8s cluster https://kubernetes.io/docs/tasks/debug-application-cluster/debug-cluster/#looking-at-logs #see https://kubernetes.io/docs/reference/kubectl/cheatsheet/ # Retrieve cluster info -
jonashackt revised this gist
Aug 14, 2018 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,6 +9,11 @@ kubectl get all --namespace kube-system # every component kubectl get all --all-namespaces # etcd ## get all etcd entries ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1:2379 --cacert=/etc/etcd/ca.pem --cert=/etc/etcd/kube-apiserver.pem --key=/etc/etcd/kube-apiserver-key.pem get / --prefix --keys-only # Networking kubectl get nodes --output json -
jonashackt revised this gist
Jun 21, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,9 @@ kubectl cluster-info dump # every component with namespace kube-system kubectl get all --namespace kube-system # every component kubectl get all --all-namespaces # Networking kubectl get nodes --output json -
jonashackt revised this gist
Jun 21, 2018 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,4 +17,7 @@ kubectl get pod kube-flannel-ds-cw7kf --namespace kube-system -o yaml # Kube-DNS kubectl describe pods -l k8s-app=kube-dns -n kube-system kubectl get nodes --output=jsonpath='{range .items[*]}{.status.addresses[?(@.type=="InternalIP")].address} {.spec.podCIDR} {"\n"}{end}' # CoreDNS kubectl describe pod/coredns-65db874f4f-lz5hl --namespace kube-system -
jonashackt revised this gist
Jun 21, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,9 @@ kubectl cluster-info dump # every component with namespace kube-system kubectl get all --namespace kube-system # Networking kubectl get nodes --output json # Flannel logging kubectl logs -n kube-system kube-flannel-ds-cw7kf -c kube-flannel -
jonashackt revised this gist
Jun 20, 2018 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,4 +12,6 @@ kubectl logs -n kube-system kube-flannel-ds-cw7kf -c kube-flannel kubectl get pod kube-flannel-ds-cw7kf --namespace kube-system -o yaml # Kube-DNS kubectl describe pods -l k8s-app=kube-dns -n kube-system kubectl get nodes --output=jsonpath='{range .items[*]}{.status.addresses[?(@.type=="InternalIP")].address} {.spec.podCIDR} {"\n"}{end}' -
jonashackt revised this gist
Jun 20, 2018 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,4 +7,9 @@ kubectl cluster-info dump kubectl get all --namespace kube-system # Flannel logging kubectl logs -n kube-system kube-flannel-ds-cw7kf -c kube-flannel kubectl get pod kube-flannel-ds-cw7kf --namespace kube-system -o yaml # Kube-DNS kubectl describe pods -l k8s-app=kube-dns -n kube-system
NewerOlder