美文网首页
Deploy docker app to kubernetes

Deploy docker app to kubernetes

作者: spacecrane | 来源:发表于2017-08-25 17:10 被阅读0次

    http://10.175.172.157:50000/api/v1/namespaces/test/services

    {
     "kind": "Service",
     "apiVersion": "v1",
     "metadata": {
      "name": "spacecrane1",
      "namespace": "test",
      "labels": {
       "application-spacecrane": "spacecrane1"
      }
     },
     "spec": {
      "ports": [{
       "protocol": "TCP",
       "targetPort": 80,
       "port":80
         
      }],
      "selector": {
       "application-spacecrane": "spacecrane1"
      },
      "type": "NodePort",
      "sessionAffinity": "None",
      "externalTrafficPolicy": "Cluster"
     },
     "status": {
      "loadBalancer": {
       
      }
     }
    }


    http://10.175.172.157:50000/apis/apps/v1beta1/namespaces/test/deployments/

    {
     "kind": "Deployment",
     "apiVersion": "apps/v1beta1",
     "metadata": {
      "name": "hy3",
      "namespace": "test",
      "labels": {
       "test-app": "hy3"
      }
     },
     "spec": {
      "replicas": 2,
      "selector": {
       "matchLabels": {
        "test-app": "hy3"
       }
      },
      "template": {
       "metadata": {
        "labels": {
         "test-app": "hy3"
        }
       },
       "spec": {
        "containers": [{
         "name": "hy3",
         "image": "docker.io/dannadocker2017/spacecrane:v1.6",
         "ports": [{
          "containerPort": 8822,
          "protocol": "TCP"
         }]
        
        }]
       }
      },
      "revisionHistoryLimit": 10
     }
    }

    相关文章

      网友评论

          本文标题:Deploy docker app to kubernetes

          本文链接:https://www.haomeiwen.com/subject/ovxpdxtx.html