eziceice / blog

Personal blog for programming
4 stars 2 forks source link

Kubernetes #10

Open eziceice opened 4 years ago

eziceice commented 4 years ago

1. Introduction

1.1 基本概念

1.1.1 Master

1.1.2 Node

1.1.3 Pod

Pod

1.1.4 Label

1.1.5 ReplicationController

1.1.6 Deployment

1.1.7 Horizontal Pod Autoscaler

1.1.8 StatefulSet

1.1.9 Service

1.1.10 Job

1.1.11 Volume

1.1.12 Persistent Volume

1.1.13 Namespace

1.1.14 Annotation

1.1.15 ConfigMap

ConfigMap

eziceice commented 4 years ago

2. 常用命令

2.1 Container Runtime Interface(CRI)

CRI

2.2 Kubectl

   # RUN Shell In POD
   kubectl exec POD [-c CONTAINER][-i][-t][flags][-- COMMAND [args...]]
   # Expose a service
   kubectl expose
   # Foward a local port traffic to pod
   kubectl port-foward POD [LOCAL_PORT]:[POD_PORT]
   # Output format
   kubectl -o yaml/json
   # More output
   kubectl -o wide
   # Logs
   kubectl logs <pod-name>
   kubectl logs -f <pod-name> -c <container-name>
   # Edit resource in cmd
   kubectl edit deploy <deployment-name>
   # Copy file to host
   kubectl cp <pod-name>:<pod-directory>:/tmp
   # Show all available resources
   kubectl api-resources
eziceice commented 4 years ago

3. 深入掌握Pod

3.1 Pod的重要属性

mountPath -> 存储卷在容器内Mount的绝对路径,少于512个字符
ports -> 容器需要暴露的端口号列表,指的是对外的端口
containerPort -> 容器需要监听的端口号,指的是容器内服务运行的端口

3.2 Pod的基本用法

3.3 Static Pod

3.4 Pod容器共享Volume

3.5 Pod配置管理

3.5.1 ConfigMap

3.5.2 使用ConfigMap的限制条件

3.6 Downward API

3.7 Pod生命周期和重启策略

Status Description
Pending API Server已经创建了该Pod,但在Pod内还有一个或者多个容器的镜像没有创建
Running Pod内的所有容器都已经创建,且至少有一个容器处于运行状态,正在启动或者重启状态
Succeeded Pod内所有容器都成功执行后退出,并且不会再重启
Failed Pod内所有容器均已退出,但至少有一个容器退出为失败状态
Unknown 无法获取Pod的状态

3.8 Pod的健康检查和服务可用性检查

3.9 Pod调度

3.9.1 NodeSelector

3.9.2 NodeAffinity

3.9.3 PodAffinity

3.9.3.1 Taint and Tolerations

3.9.4 Pod Priority Preemption

3.9.5 DaemonSet

3.9.6 Job

3.9.7 自定义调度器

3.10 Init Container

3.11 Pod的升级和回滚

3.11.1 Deployment的升级

3.11.2 Deployment的升级

3.11.3 暂停和恢复Deployment的部署操作,以完成复杂的修改

3.11.4 使用kubectl rolling-update完成对RC的滚动升级

3.11.5 其他管理对象的更新策略

3.12 Pod的扩容

3.12.1 自动扩缩容机制

eziceice commented 4 years ago

4. 深入掌握Service

4.1 Service的基本用法

4.1.1 多端口Service

4.1.2 外部服务Service

4.2 Headless Service

4.3 从集群外部访问Pod或者Service

4.3.1 将Pod容器应用的端口号映射到物理机

4.3.1 将Service的端口号映射到物理机

4.4 CoreDNS

4.4.1 Pod级别的DNS配置

4.5 Ingress

eziceice commented 4 years ago

5. 核心组件运行机制

5.1 Kubernetes API Server原理解析

5.1.1 Kubernetes API Server概述

5.1.2 API Server架构解析

5.1.3 Kubernetes Proxy API接口

5.1.4 集群功能模块之间的通信

Structure

5.2 Controller Manager原理解析

5.3 Scheduler原理解析

5.4 Kubelet运行机制分析

5.4.1 节点管理

5.4.2 Pod管理

5.5 Kube-proxy 运行机制解析