kubernetes Pod yaml解析注释

 

 

{
    "kind": "Pod",(资源类型)
    "apiVersion": "v1",  (资源版本)
    "metadata": {
        "name": "app-tomcat", (名字,唯一)
        "namespace": "default", (命名空间默认default)
        "labels": {
            "name": "app-tomcat" (label做为标识,可以跟RC,Service关联对应)
        }
    },
    "spec": {
        "containers": [
            {
                "name": "app-tomcat", (自定义镜像名称)
                "image": "tomcat", (要拉取的镜像)
                "command": [   (运行容器时,要运行的命令)
                    "/bin/bash",
                    "/opt/apache-tomcat-7.0.57/bin/catalina.sh",
                    "run"
                ],
                "env": [  (环境变量K,V)
                    {
                        "name": "url_addr",
                        "value": "http://192.168.54.66:8080/paas/jsp/index.jsp"
                    }
                ],
                "resources": { (对容器资源限制)
                    "limits": {
                        "cpu": "1",
                        "memory": "1073741824"
                    },
                    "requests": {
                        "cpu": "100m",
                        "memory": "104857600"
                    }
                },
                "imagePullPolicy": "Always" (获取镜像策略Always,Never,IfNotPresent)
            }
        ],
        "restartPolicy": "Always", (pod重启策略,Always,OnFailure,Never)
        "dnsPolicy": "ClusterFirst",
        "nodeSelector": {  (选择将该pod调度到包含这些label的Node上)
            "group": "node1"
        }
    }
}

 

https://blog.csdn.net/bbwangj/article/details/81812675

 

 

上一篇:[2015编程之美] 第一场A


下一篇:设计模式-创建型模型