From 0eae920ce0bdc4dff5adbf97f064a3944c9141ed Mon Sep 17 00:00:00 2001 From: Junwei Zhao Date: Mon, 2 Dec 2019 14:42:48 +1100 Subject: [PATCH] Add some more about Kubernetes --- categories/devops/kubernetes.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/categories/devops/kubernetes.md b/categories/devops/kubernetes.md index 0faacba..2b6e1a9 100644 --- a/categories/devops/kubernetes.md +++ b/categories/devops/kubernetes.md @@ -63,15 +63,18 @@ spec: ## Some useful commands ```bash - kubectl config set-context context-name --namespace default-namespace-name #default active context kubectl config view #view config kubectl get nodes #get nodes kubectl get namespaces #get all namespaces kubectl get pods #get pods kubectl get deployments #get deployments +kubectl logs -f --tail 200 # tail logs from some pod kubectl get services #get services kubectl get ingress #get ingresses +kubectl get hpa # get horizontal auto scaling policies +kubectl get all # get all kinds of units +kubectl get secrets -o yaml #view a secret details with yaml format, fields are encrypted with base64 ``` @@ -169,3 +172,13 @@ template: https://blog.hasura.io/draft-vs-gitkube-vs-helm-vs-ksonnet-vs-metaparticle-vs-skaffold-f5aa9561f948/ +## Tools + +### Kubectx and kubens + +Switch faster between clusters and namespaces in kubectl https + +- kubectx for switching contexts +- kubens for switching namespaces + +Github page: https://github.com/ahmetb/kubectx