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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 #查看所有namespace的pods运行情况 kubectl get pods --all-namespaces #查看具体pods,记得后边跟namespace名字哦 kubectl get pods kubernetes-dashboard-76479d66bb-nj8wr --namespace=kube-system # 查看pods具体信息 kubectl get pods -o wide kubernetes-dashboard-76479d66bb-nj8wr --namespace=kube-system # 查看集群健康状态 kubectl get cs # 获取所有deployment kubectl get deployment --all-namespaces # 列出该 namespace 中的所有 pod 包括未初始化的 kubectl get pods --include-uninitialized # 查看deployment() kubectl get deployment nginx-app # 查看rc和servers kubectl get rc,services # 查看pods结构信息(重点,通过这个看日志分析错误) # 对控制器和服务,node同样有效 kubectl describe pods xxxxpodsname --namespace=xxxnamespace # 其他控制器类似吧,就是kubectl get 控制器 控制器具体名称 # 查看pod日志 kubectl logs $POD_NAME # 查看pod变量 kubectl exec my-nginx-5j8ok -- printenv | grep SERVICE # 集群 kubectl get cs # 集群健康情况 kubectl cluster-info # 集群核心组件运行情况 kubectl get namespaces # 表空间名 kubectl version # 版本 kubectl api-versions # API kubectl get events # 查看事件 kubectl get nodes //获取全部节点 kubectl delete node k8s2 //删除节点 kubectl rollout status deploy nginx-test # 创建 kubectl create -f .
1. Test center distribution CKA: Certified Kubernetes Administrator.
CNCF: Cloud Native Computing Foundation.
Knowledge point division:
5%: scheduling 5%: Logging/Monitoring 8%: Application Lifecycle Management 11%: Cluster 12%: Security 7%: Storage 10%: Troubleshooting 19%:Core Concepts 11%:Networking s12%:Installation, Configuration & Validation
1. kubeadm knowledge map Kubeadm is a tool to implement the k8s environment quickly. Also you don’t need to care about the configure environment, just know how to bootstrap it. Master the basically command to use kubeadm.
2. Kubeadm practice 2.1 The practice environment Google cloud instance
Linux system.
2.2 Environment configure Install container (Docker)
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 # 安装 Docker CE ## 设置仓库 ### 安装软件包以允许 apt 通过 HTTPS 使用存储库 apt-get update && apt-get install \ apt-transport-https ca-certificates curl software-properties-common ### 新增 Docker 的 官方 GPG 秘钥 curl -fsSL https://download.
Part 1: For this part, comprise of the basic knowledges including Cloud history, container technology and k8s etc.
1. Cloud Technology 1.1 The History Of Cloud computing https://skyao.io/learning-cloudnative/introduction/history.html
IaaS: Infrastructure as a service
PaaS: Platform as a service
SaaS: Software as a service
1.2 Cloud Native https://skyao.io/learning-cloudnative/introduction/background.html
1.3 DevOps And Strengths https://www.qikegu.com/docs/4262
https://skyao.io/learning-cloudnative/devops/
2. Container Technologies 2.1 Virtualization Technology Virtualization refers to the act of creating a virtual version of something, including virtual computer hardware platforms, storage devices, and computer network resources etc.
1. Background Up to now, perhaps you haven’t had to pass any kind of configuration data to the apps. Because almost all apps require configuration, which shouldn’t be baked into to the built app itself. This article shows two ways to pass the configuration data to the apps.
2. Secret Secret is for the information you’ve passed to the containers is sensitive. K8s provides a separate object called a Secret. There are 4 ways to create the Secret.
1. Background We always deploy the final version applications to the production env. There are several ways to ensure the release production stably and safety. Below sections are k8s deployment strategies.
2. The Strategies There are 4 ways to do the production release. 1) Rolling-update. 2) Recreate. 3) Blue/Green. 4) Canary. Below is the details.
Recreate Update
This is very clumsy way to update. Destory V1 application then create V2 application.