例子:
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實戰