新增说明及示例文件

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,40 @@
# Jobs 说明,官方文档: https://v1-22.docs.kubernetes.io/zh/docs/concepts/workloads/controllers/job
# API 版本
apiVersion: apps/v1
# 资源类型
kind: Jobs
# 元数据
metadata:
## 名称
name: 此 Jobs 的名称
## 命名空间
namespace: 此 Jobs 所属命名空间
## 标签
labels:
标签名1: 标签值1
标签名2: 标签值2
# 内容
spec:
## 指定 Pod 模板(内容参考 Pod 的 Yaml
template:
### Pod 的内容
spec:
#### Pod 的容器
containers:
##### 容器1
###### 容器1的名称
- name: 容器1的名称
###### 容器1使用的镜像
image: 容器1使用的镜像
###### 容器1运行的命令
command:
- 命令1
- 命令2
#### 容器重启策略【Never不重启OnFailure失败时重启】
restartPolicy: 容器重启策略【Never不重启OnFailure失败时重启】
## 失败重试次数
backoffLimit: 4
## Pod 完成量(当成功的 Pod 个数达到次数时,该 Job 视为完成)
completions: Pod 完成量
## Pod 工作队列
parallelism: Pod 工作队列

View File

@@ -0,0 +1,18 @@
apiVersion: apps/v1
kind: Jobs
metadata:
name: example-pi
namespace: demo
labels:
name: example-pi
app: pi
type: job
spec:
template:
spec:
containers:
- name: pi
image: perl
command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
restartPolicy: Never
backoffLimit: 4