新增说明及示例文件

This commit is contained in:
2023-12-15 16:39:01 +08:00
committed by huty
parent 823b19c3f0
commit 3445c145aa
71 changed files with 4048 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
# Deployments 说明,官方文档: https://v1-22.docs.kubernetes.io/zh/docs/concepts/workloads/controllers/deployment
# API 版本
apiVersion: apps/v1
# 资源类型
kind: Deployments
# 元数据
metadata:
## 名称
name: 此 Deployments 的名称
## 命名空间
namespace: 此 Deployments 所属命名空间
## 标签
labels:
标签名1: 标签值1
标签名2: 标签值2
# 内容
spec:
## 指定副本数
replicas: 期望副本数
## 指定 Pod 选择器( 此 Deployments 需要管理哪些 Pods
selector:
### 指定标签选择器
matchLabels:
标签名1: 标签值1
标签名2: 标签值2
## 指定 Pod 模板
template:
### Pod 的元数据
metadata:
#### Pod 的标签(需要和上面 matchLabels 中配置的标签一致)
labels:
标签名1: 标签值1
标签名2: 标签值2
### Pod 的内容
spec:
#### Pod 的容器
containers:
##### 容器1
###### 容器1的名称
- name: 容器1的名称
###### 容器1使用的镜像
image: 容器1使用的镜像
###### 容器1使用的端口号
ports:
- containerPort: 80

View File

@@ -0,0 +1,28 @@
apiVersion: apps/v1
kind: Deployments
metadata:
name: example-nginx
namespace: demo
labels:
name: nginx
app: nginx
type: deployments
spec:
replicas: 3
selector:
matchLabels:
name: nginx
app: nginx
type: pod
template:
metadata:
labels:
name: nginx
app: nginx
type: pod
spec:
containers:
- name: nginx
image: nginx:1.23.3
ports:
- containerPort: 80