例子:
apiVersion: v1
kind: Podmetadata:
name: hello-world
spec :
restartPolicy:OnFailure
containers:
- name : hello
images: "alpine:3.7"
command: ["bin/echo","hello","world"]
apiversion :声明kubernates API版本目前是V1
kind:声明API对象类型这里是POD,
metadata:设置POD的元数据
name:表示POD的名称,POD名称在namespace内必须是唯一
spec:配置POD的具体规格
restartPolicy:POD的重启策略
containers:POD容器规格,数组形式,每一项定义一个容器
-name:指定容器名字,POD中唯一
images:指定容器镜像
command:容器启动命令
参考kubernates实战