创建app

最近更新时间: 2019-11-02 11:43:07

POST /v2/applications/{projectName} 请求body

{
"name": "demoapp",
"imageRef": "nginx:1.7.9",
"resources": {
"cpu": "0.1",
"mem": "256Mi",
"disk":"1Gi",
"gpu":"0"
  },
"instanceNum": 2,
"cmd": "sleep 10000",
"dockerEnv": [
    {
"name": "PATH1",
"value": "/bin"
    },
    {
"name": "PATH2",
"value": "/usr/bin"
    }
  ],
"portMappings": [
    {
"protocol": "tcp",
"containerPort": 8088
    },
    {
"protocol": "udp",
"containerPort": 9999
    }
  ],
"dockerLogDir": "/log/dir",
"dockerDataDir": "/data/dir",
"volumes": "rbd1:/data/rbd1,rbd2:/data/rbd2",
"networkType": 0,
"userName":"Jack",
"scale": {
"minReplicas": 1,
"maxReplicas": 5,
"targetCPUUtilization": 50
  },
"configMap":[
    {
"type": "Volume",
"name": "special-config",
"key": ["game-config", "game-config2.conf"],
"mountPath": "/etc/config"
    },
    {
"type": "Env",
"name": "special-config2",
"key": ["HELLO", "WORLD"]
    }
  ],
"secret":[
    {
"type": "Volume",
"name": "special-config",
"key": ["game-config", "game-config2.conf"],
"mountPath": "/etc/config"
    },
    {
"type": "Env",
"name": "special-config2",
"key": ["HELLO", "WORLD"]
    }
  ],
"internalVolumes": [{
"allocateMode": "new",
"fsType": "ext4",
"volumeSize": 1,
"mountPath": "/data"
  }],
"nodeLabels":{
"key1":"value1",
"key2":"value2"
  }
}

返回

{
"AppID": "033613b240a2986011223370c94d1519147a0479d7a0eb6e88bb5ce20282be05",
"Cmd": "/bin/bash",
"Created": "2016-09-28T17:29:22+08:00",
"DockerDataDir": "/log/dir",
"DockerLogDir": "/log/dir",
"Environments": [
    {
"name": "PATH1",
"value": "/bin"
    },
    {
"name": "PATH2",
"value": "/usr/bin"
    }
  ],
"Image": "nginx:1.7.9",
"InstanceNum": 2,
"InstanceSummary": "",
"Name": "demoapp",
"PortsInfo": [
    {
"protocol": "tcp",
"containerPort": 8088
    },
    {
"protocol": "udp",
"containerPort": 9999
    }
  ],
"ProjectID": "abcdefg",
"ProjectName": "default",
"Status": "RUNNING",
"Username": "Jack",
"ResInfo": {
"cpu": "0.1",
"mem": "256Mi",
"disk":"1Gi"
  },
"NetworkType": 0,
"Type": "Deployment",
"scale": {
"minReplicas": 1,
"maxReplicas": 5,
"targetCPUUtilization": 50
  },
"configMap":[
    {
"type": "Volume",
"name": "special-config",
"key": ["game-config", "game-config2.conf"],
"mountPath": "/etc/config"
    },
    {
"type": "Env",
"name": "special-config2",
"key": ["HELLO", "WORLD"]
    }
  ],
"secret":[
    {
"type": "Volume",
"name": "special-config",
"key": ["game-config", "game-config2.conf"],
"mountPath": "/etc/config"
    },
    {
"type": "Env",
"name": "special-config2",
"key": ["HELLO", "WORLD"]
    }
  ],
"internalVolumes": [{
"allocateMode": "new",
"fsType": "ext4",
"volumeSize": 1,
"mountPath": "/data"
  }],
"nodeLabels":{
"key1":"value1",
"key2":"value2"
  }
}