Kubernetes集群管理

Kubernetes简介

Kubernetes(K8s)是一个开源的容器编排平台。

部署应用

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
spec:
  replicas: 3
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
    spec:
      containers:
      - name: myapp
        image: myapp:latest
        ports:
        - containerPort: 3000

核心概念

  • Pod:最小部署单元
  • Service:服务发现和负载均衡
  • Deployment:应用部署管理