inputs:
  agigatewayapp-instance-num:
    default: 1
    description: api-gateway的实例个数
    label: ''
    type: integer
  app-cpu-limit:
    default: 1
    description: 设置应用的最大CPU资源限制，单位为核数
    label: ''
  app-mem-limit:
    default: 2Gi
    description: '设置应用的最大内存限制,单位为GByte，如1Gi'
    label: ''
  cce-flavor-f:
    description: 集群规格
    label: ''
  cce-cluster-name:
    default: cpts-demo
    description: Demo应用所在CCE集群名称
    label: ''
  cce-subnetId:
    description: 部署Demo应用的子网ID
    label: ''
  cceversion:
    default: v1.11
    description: 集群版本
    label: ''
  cce-vpcId:
    description: 部署Demo应用的虚拟私有云ID
    label: ''
  cce-flavor:
    default: sn3.2xlarge.2
    description: 容器节点的规格
    label: ''
  cce-node-num:
    default: 1
    description: 创建每个类型节点的数量，模板带有两个节点池，填写1即为一共创建了2个节点
    label: ''
    type: integer
  EIP-Bandwidth:
    default: 5
    description: 带宽大小
    label: ''
  cce-sshKeyName:
    description: 创建节点登录时使用的密钥对，请妥善保存
    label: ''
  cce-nodepool-1_availabilityZone:
    description: 节点的可用区
    label: ''
  cce-nodepool-2_availabilityZone:
    description: 节点的可用区
    label: ''
  dao-service-instance-num:
    default: 1
    description: dao-service的实例个数
    label: ''
    type: integer
  product-service-instance-num:
    default: 1
    description: product-service的实例个数
    label: ''
    type: integer
  db-instance-num:
    default: 1
    description: 数据库的实例个数
    label: ''
    type: integer
  ui-service-instance-num:
    default: 1
    description: ui-service的实例个数
    label: ''
    type: integer
  user-service-instance-num:
    default: 1
    description: user-service的实例个数
    label: ''
    type: integer
  apmname:
    default: cpts-demo
    description: 调用链探针的名称
    label: ''
metadata:
  Designer:
    00d2d2ed-bf55-4bb4-b2be-d5e93c1ec857:
      source:
        id: 8caebad5-a34b-47ed-9cd4-f4de7578a2e7
      target:
        id: 3bce6f53-c4b7-4a6d-9276-5a958b56192e
      z: 2
    09f706bc-7dc4-495a-8b24-5d863faf70d3:
      source:
        id: b63afaa0-536e-40e6-ba45-6ebde25e95ad
      target:
        id: 16473a00-8e07-43ec-b3c1-b00abd1b9489
      z: 2
    11fd8344-ec66-48dc-999a-3de7e4ebae32:
      source:
        id: 16473a00-8e07-43ec-b3c1-b00abd1b9489
      target:
        id: 3bce6f53-c4b7-4a6d-9276-5a958b56192e
      z: 2
    16473a00-8e07-43ec-b3c1-b00abd1b9489:
      dependson:
        - 3bce6f53-c4b7-4a6d-9276-5a958b56192e
      parent: d90106bd-525d-4029-9035-65f526902cc8
      position:
        x: -70
        y: 460
      size:
        height: 60
        width: 60
      z: 2
    2a457eb1-7f7f-4efe-9d9f-6556505ee7b0:
      source:
        id: f7a501e2-36d9-466a-b5bf-1504473cb86f
      target:
        id: b5b49b16-9798-48ac-87b9-6654d4bf5067
      z: 2
    2f29b185-85a0-48d2-a1f1-ce518f7f1a29:
      source:
        id: 79bdca3c-11d7-49f3-b868-09e210559924
      target:
        id: 796ea365-3329-4c67-80df-9bf1ddeff4e4
      z: 2
    309666aa-acad-4162-b54a-6861d0edea11:
      dependson:
        - 16473a00-8e07-43ec-b3c1-b00abd1b9489
      parent: d90106bd-525d-4029-9035-65f526902cc8
      position:
        x: -70
        y: 340
      size:
        height: 60
        width: 60
      z: 2
    3b895628-b8dd-4e2a-a498-9d45583588d1:
      dependson:
        - fc5841c9-ae2f-473c-bcba-54576384f093
      parent: d90106bd-525d-4029-9035-65f526902cc8
      position:
        x: 260
        y: 340
      size:
        height: 60
        width: 60
      z: 2
    3bce6f53-c4b7-4a6d-9276-5a958b56192e:
      dependson:
        - 796ea365-3329-4c67-80df-9bf1ddeff4e4
      isassociatedwith:
        - 796ea365-3329-4c67-80df-9bf1ddeff4e4
      parent: d90106bd-525d-4029-9035-65f526902cc8
      position:
        x: 10
        y: 570
      size:
        height: 60
        width: 60
      z: 2
    428e42a5-0e25-40ac-8b9e-48ba747ae4f6:
      source:
        id: 8198f808-edcb-48f7-85f6-f7fd51676d4f
      target:
        id: 6e20c0d5-60a4-47d3-8eb7-4906e5e12ca0
      z: 2
    43e98219-748e-4cb3-9cb4-992e905000d9:
      source:
        id: 761c29dd-3efc-46cd-bdc8-84bdb2aebca9
      target:
        id: b5b49b16-9798-48ac-87b9-6654d4bf5067
      z: 2
    5d11e582-f1d9-4dd1-af24-e6898c3dc426:
      dependson:
        - 79bdca3c-11d7-49f3-b868-09e210559924
      parent: d90106bd-525d-4029-9035-65f526902cc8
      position:
        x: 410
        y: 340
      size:
        height: 60
        width: 60
      z: 2
    68889b4e-4484-4cac-84fc-bb514d683ae9:
      source:
        id: 309666aa-acad-4162-b54a-6861d0edea11
      target:
        id: 16473a00-8e07-43ec-b3c1-b00abd1b9489
      z: 2
    6e20c0d5-60a4-47d3-8eb7-4906e5e12ca0:
      dependson:
        - 3bce6f53-c4b7-4a6d-9276-5a958b56192e
      parent: d90106bd-525d-4029-9035-65f526902cc8
      position:
        x: -210
        y: 460
      size:
        height: 60
        width: 60
      z: 2
    6fe1cc54-869d-4bb2-b43c-a196d0cefb23:
      source:
        id: e9dfd189-9bbd-4d3a-bffd-5024b29c5483
      target:
        id: 8caebad5-a34b-47ed-9cd4-f4de7578a2e7
      z: 2
    761c29dd-3efc-46cd-bdc8-84bdb2aebca9:
      dependson:
        - b5b49b16-9798-48ac-87b9-6654d4bf5067
      parent: d90106bd-525d-4029-9035-65f526902cc8
      position:
        x: 570
        y: 340
      size:
        height: 60
        width: 60
      z: 2
    796ea365-3329-4c67-80df-9bf1ddeff4e4:
      parent: d90106bd-525d-4029-9035-65f526902cc8
      position:
        x: 190
        y: 580
      size:
        height: 60
        width: 60
      z: 2
    79bdca3c-11d7-49f3-b868-09e210559924:
      dependson:
        - 796ea365-3329-4c67-80df-9bf1ddeff4e4
      parent: d90106bd-525d-4029-9035-65f526902cc8
      position:
        x: 400
        y: 450
      size:
        height: 60
        width: 60
      z: 2
    8198f808-edcb-48f7-85f6-f7fd51676d4f:
      dependson:
        - 6e20c0d5-60a4-47d3-8eb7-4906e5e12ca0
      parent: d90106bd-525d-4029-9035-65f526902cc8
      position:
        x: -210
        y: 340
      size:
        height: 60
        width: 60
      z: 2
    83a8e18f-be8c-40d5-b83a-a7f2f8e475d8:
      source:
        id: ecf91468-21d6-4af8-bd6d-d88f07124f12
      target:
        id: 6e20c0d5-60a4-47d3-8eb7-4906e5e12ca0
      z: 2
    848321bd-332b-4a4a-a199-8fe5f205729e:
      source:
        id: b5b49b16-9798-48ac-87b9-6654d4bf5067
      target:
        id: 796ea365-3329-4c67-80df-9bf1ddeff4e4
      z: 2
    8caebad5-a34b-47ed-9cd4-f4de7578a2e7:
      dependson:
        - 3bce6f53-c4b7-4a6d-9276-5a958b56192e
      parent: d90106bd-525d-4029-9035-65f526902cc8
      position:
        x: 50
        y: 460
      size:
        height: 60
        width: 60
      z: 2
    980e1551-5e18-4f83-8e43-9d7db30f8f53:
      source:
        id: b9e416d5-936b-486b-b6bd-1dff65e5b533
      target:
        id: fc5841c9-ae2f-473c-bcba-54576384f093
      z: 2
    a08bb90d-71a2-4cce-a3f0-ffac5a5f280e:
      source:
        id: edd2c089-5a98-4b71-81ed-e9e03345e847
      target:
        id: 79bdca3c-11d7-49f3-b868-09e210559924
      z: 2
    b5b49b16-9798-48ac-87b9-6654d4bf5067:
      dependson:
        - 796ea365-3329-4c67-80df-9bf1ddeff4e4
      parent: d90106bd-525d-4029-9035-65f526902cc8
      position:
        x: 580
        y: 450
      size:
        height: 60
        width: 60
      z: 2
    b63afaa0-536e-40e6-ba45-6ebde25e95ad:
      policy:
        - 16473a00-8e07-43ec-b3c1-b00abd1b9489
      position:
        x: -90
        y: 230
      size:
        height: 60
        width: 60
      z: 1
    b9e416d5-936b-486b-b6bd-1dff65e5b533:
      policy:
        - fc5841c9-ae2f-473c-bcba-54576384f093
      position:
        x: 250
        y: 230
      size:
        height: 60
        width: 60
      z: 1
    c21a2f13-316e-469d-b482-bfacce352bf3:
      source:
        id: 3b895628-b8dd-4e2a-a498-9d45583588d1
      target:
        id: fc5841c9-ae2f-473c-bcba-54576384f093
      z: 2
    d65204e3-339b-4cb7-b4e0-ce843918c684:
      source:
        id: ee176582-e8d4-4046-ac9e-a75cf95c014b
      target:
        id: 8caebad5-a34b-47ed-9cd4-f4de7578a2e7
      z: 2
    d90106bd-525d-4029-9035-65f526902cc8:
      embeds:
        - 796ea365-3329-4c67-80df-9bf1ddeff4e4
        - fc5841c9-ae2f-473c-bcba-54576384f093
        - 3b895628-b8dd-4e2a-a498-9d45583588d1
        - 79bdca3c-11d7-49f3-b868-09e210559924
        - 5d11e582-f1d9-4dd1-af24-e6898c3dc426
        - b5b49b16-9798-48ac-87b9-6654d4bf5067
        - 761c29dd-3efc-46cd-bdc8-84bdb2aebca9
        - 3bce6f53-c4b7-4a6d-9276-5a958b56192e
        - 8caebad5-a34b-47ed-9cd4-f4de7578a2e7
        - e9dfd189-9bbd-4d3a-bffd-5024b29c5483
        - 6e20c0d5-60a4-47d3-8eb7-4906e5e12ca0
        - 8198f808-edcb-48f7-85f6-f7fd51676d4f
        - 16473a00-8e07-43ec-b3c1-b00abd1b9489
        - 309666aa-acad-4162-b54a-6861d0edea11
      position:
        x: -280
        y: 320
      size:
        height: 360
        width: 960
      z: 1
    e658353a-8e3f-4ddd-a0a6-242db6790428:
      source:
        id: 6e20c0d5-60a4-47d3-8eb7-4906e5e12ca0
      target:
        id: 3bce6f53-c4b7-4a6d-9276-5a958b56192e
      z: 2
    e8797032-7cd4-4c7c-a43f-f5040fb563ad:
      source:
        id: 3bce6f53-c4b7-4a6d-9276-5a958b56192e
      target:
        id: 796ea365-3329-4c67-80df-9bf1ddeff4e4
      z: 2
    e9dfd189-9bbd-4d3a-bffd-5024b29c5483:
      dependson:
        - 8caebad5-a34b-47ed-9cd4-f4de7578a2e7
      parent: d90106bd-525d-4029-9035-65f526902cc8
      position:
        x: 50
        y: 340
      size:
        height: 60
        width: 60
      z: 2
    ea4493bc-19c2-4155-8290-57abbe883ece:
      source:
        id: 5d11e582-f1d9-4dd1-af24-e6898c3dc426
      target:
        id: 79bdca3c-11d7-49f3-b868-09e210559924
      z: 2
    ecf91468-21d6-4af8-bd6d-d88f07124f12:
      policy:
        - 6e20c0d5-60a4-47d3-8eb7-4906e5e12ca0
      position:
        x: -220
        y: 230
      size:
        height: 60
        width: 60
      z: 1
    edd2c089-5a98-4b71-81ed-e9e03345e847:
      policy:
        - 79bdca3c-11d7-49f3-b868-09e210559924
      position:
        x: 400
        y: 230
      size:
        height: 60
        width: 60
      z: 1
    ee176582-e8d4-4046-ac9e-a75cf95c014b:
      policy:
        - 8caebad5-a34b-47ed-9cd4-f4de7578a2e7
      position:
        x: 40
        y: 230
      size:
        height: 60
        width: 60
      z: 1
    ee53c3c1-bc28-4af0-bdf3-65de12725ff0:
      source:
        id: fc5841c9-ae2f-473c-bcba-54576384f093
      target:
        id: 796ea365-3329-4c67-80df-9bf1ddeff4e4
      z: 2
    f7a501e2-36d9-466a-b5bf-1504473cb86f:
      policy:
        - b5b49b16-9798-48ac-87b9-6654d4bf5067
      position:
        x: 550
        y: 230
      size:
        height: 60
        width: 60
      z: 1
    fc5841c9-ae2f-473c-bcba-54576384f093:
      dependson:
        - 796ea365-3329-4c67-80df-9bf1ddeff4e4
      parent: d90106bd-525d-4029-9035-65f526902cc8
      position:
        x: 260
        y: 460
      size:
        height: 60
        width: 60
      z: 2
  relationships:
    16473a00-8e07-43ec-b3c1-b00abd1b9489:
      references:
        clusterId:
          get_reference: cce-cluseter
        dependency:
          - get_reference: cce-nodepool-2
    309666aa-acad-4162-b54a-6861d0edea11:
      references:
        clusterId:
          get_reference: cce-cluseter
        dependency:
          - get_reference: api-gateway-y3h4s
    3b895628-b8dd-4e2a-a498-9d45583588d1:
      references:
        clusterId:
          get_reference: cce-cluseter
        dependency:
          - get_reference: user-service-87g8d
    3bce6f53-c4b7-4a6d-9276-5a958b56192e:
      references:
        clusterId:
          get_reference: cce-cluseter
        dependency:
          - get_reference: cce-nodepool-1
    5d11e582-f1d9-4dd1-af24-e6898c3dc426:
      references:
        clusterId:
          get_reference: cce-cluseter
        dependency:
          - get_reference: shoppingmalldb-tycnl
    61686163-1fb8-426d-a8a0-9d88245c5800:
      references:
        targets:
          - products-service-wht0f
    6965b912-a54b-4c3f-bc03-044291a915ce:
      references:
        targets:
          - ui-service-jgyzt
    6e20c0d5-60a4-47d3-8eb7-4906e5e12ca0:
      references:
        clusterId:
          get_reference: cce-cluseter
        dependency:
          - get_reference: cce-nodepool-2
    761c29dd-3efc-46cd-bdc8-84bdb2aebca9:
      references:
        clusterId:
          get_reference: cce-cluseter
        dependency:
          - get_reference: dao-service-062c3
    796ea365-3329-4c67-80df-9bf1ddeff4e4:
      references:
        clusterId:
          get_reference: cce-cluseter
        publicIp: {}
        publicIp.id:
          - get_reference: vpcei17u
    79bdca3c-11d7-49f3-b868-09e210559924:
      references:
        clusterId:
          get_reference: cce-cluseter
        dependency:
          - get_reference: cce-nodepool-1
    8198f808-edcb-48f7-85f6-f7fd51676d4f:
      references:
        clusterId:
          get_reference: cce-cluseter
        dependency:
          - get_reference: products-service-wht0f
    88cdd09e-e0c1-44c4-85e1-faca8a597e3d:
      references:
        targets:
          - api-gateway-y3h4s
    8a1fa3a0-9ad8-41c2-a665-999ac1120452:
      references:
        targets:
          - dao-service-062c3
    8caebad5-a34b-47ed-9cd4-f4de7578a2e7:
      references:
        clusterId:
          get_reference: cce-cluseter
        dependency:
          - get_reference: cce-nodepool-2
    a4b78228-fb58-48ec-8453-175b8595a7cc:
      references:
        targets:
          - user-service-87g8d
    b5b49b16-9798-48ac-87b9-6654d4bf5067:
      references:
        clusterId:
          get_reference: cce-cluseter
        dependency:
          - get_reference: cce-nodepool-1
    b63afaa0-536e-40e6-ba45-6ebde25e95ad:
      references:
        targets:
          - api-gateway-y3h4s
    b9e416d5-936b-486b-b6bd-1dff65e5b533:
      references:
        targets:
          - user-service-87g8d
    d8e99ba2-fbe3-4652-bc71-acbf5394c863:
      references:
        targets:
          - shoppingmalldb-tycnl
    d90106bd-525d-4029-9035-65f526902cc8:
      references: {}
    e9dfd189-9bbd-4d3a-bffd-5024b29c5483:
      references:
        clusterId:
          get_reference: cce-cluseter
        dependency:
          - get_reference: ui-service-jgyzt
    ecf91468-21d6-4af8-bd6d-d88f07124f12:
      references:
        targets:
          - products-service-wht0f
    edd2c089-5a98-4b71-81ed-e9e03345e847:
      references:
        targets:
          - shoppingmalldb-tycnl
    ee176582-e8d4-4046-ac9e-a75cf95c014b:
      references:
        targets:
          - ui-service-jgyzt
    f7a501e2-36d9-466a-b5bf-1504473cb86f:
      references:
        targets:
          - dao-service-062c3
    fc5841c9-ae2f-473c-bcba-54576384f093:
      references:
        clusterId:
          get_reference: cce-cluseter
        dependency:
          - get_reference: cce-nodepool-1
node_templates:
  api-gateway-aj0ts:
    metadata:
      Designer:
        id: 309666aa-acad-4162-b54a-6861d0edea11
    properties:
      apiVersion: v1
      clusterId:
        get_reference: cce-cluseter
      k8sManifest:
        apiVersion: v1
        kind: Service
        metadata:
          labels:
            app: api-gateway
          name: api-gateway
          namespace: default
        spec:
          externalTrafficPolicy: Cluster
          ports:
            - port: 8080
              protocol: TCP
              targetPort: 8080
          selector:
            app: api-gateway
          sessionAffinity: None
          type: NodePort
      kind: Service
      name: api-gateway
      ports:
        - port: 8080
          protocol: TCP
          targetPort: 8080
      selector:
        app: api-gateway
      type: NodePort
    requirements:
      - dependency:
          node: api-gateway-y3h4s
      - clusterId:
          node: cce-cluseter
    type: HuaweiCloud.CCE.Service
  api-gateway-y3h4s:
    metadata:
      Designer:
        id: 16473a00-8e07-43ec-b3c1-b00abd1b9489
    properties:
      apiVersion: 'apps/v1'
      clusterId:
        get_reference: cce-cluseter
      k8sManifest:
        apiVersion: 'apps/v1'
        kind: Deployment
        metadata:
          annotations:
            'deployment.kubernetes.io/revision': '1'
          enable: true
          generation: 1
          labels:
            app: api-gateway
          name: api-gateway
        spec:
          progressDeadlineSeconds: 600
          replicas:
            get_input: agigatewayapp-instance-num
          revisionHistoryLimit: 10
          selector:
            matchLabels:
              app: api-gateway
          strategy:
            rollingUpdate:
              maxSurge: 1
              maxUnavailable: 1
            type: RollingUpdate
          template:
            metadata:
              labels:
                app: api-gateway
            spec:
              affinity:
                nodeAffinity:
                  requiredDuringSchedulingIgnoredDuringExecution:
                    nodeSelectorTerms:
                      - matchExpressions:
                          - key: node
                            operator: In
                            values:
                              - pool2
                podAntiAffinity:
                  requiredDuringSchedulingIgnoredDuringExecution:
                    - labelSelector:
                        matchExpressions:
                          - key: app
                            operator: In
                            values:
                              - api-gateway
                      numOfMatchingPods: '1'
                      topologyKey: 'kubernetes.io/hostname'
              containers:
                - image: >-
                    swr.cn-north-1.myhuaweicloud.com/hwstaff_z00330634/api-gateway:1.0
                  imagePullPolicy: Always
                  lifecycle: {}
                  name: api-gateway-image
                  resources:
                    limits:
                      cpu:
                        get_input: app-cpu-limit
                      memory:
                        get_input: app-mem-limit
                    requests:
                      cpu: 500m
                      memory: 1Gi
                  securityContext:
                    privileged: false
                    readOnlyRootFilesystem: false
                    runAsNonRoot: false
                  terminationMessagePath: '/dev/termination-log'
                  terminationMessagePolicy: File
                  volumeMounts:
                    - mountPath: '/var/log/apm'
                      name: api-gatewaypath
                      policy:
                        logs:
                          rotate: Daily
              dnsPolicy: ClusterFirst
              imagePullSecrets:
                - name: default-secret
              restartPolicy: Always
              schedulerName: default-scheduler
              securityContext:
                runAsNonRoot: false
              terminationGracePeriodSeconds: 30
              volumes:
                - hostPath:
                    path: '/var/paas/sys/log/api-gateway'
                    type: ''
                  name: api-gatewaypath
    requirements:
      - clusterId:
          node: cce-cluseter
      - dependency:
          node: cce-nodepool-2
    type: HuaweiCloud.CCE.Deployment
  cce-cluseter:
    metadata:
      Designer:
        id: d90106bd-525d-4029-9035-65f526902cc8
    properties:
      flavor:
        get_input: cce-flavor-f
      kubeProxyMode: iptables
      name:
        get_input: cce-cluster-name
      subnetId:
        get_input: cce-subnetId
      version:
        get_input: cceversion
      vpcId:
        get_input: cce-vpcId
    type: HuaweiCloud.CCE.Cluster
  cce-nodepool-1:
    metadata:
      Designer:
        id: 796ea365-3329-4c67-80df-9bf1ddeff4e4
    properties:
      clusterId:
        get_reference: cce-cluseter
      dataVolumes:
        - size: 100
          volumeType: SATA
      flavor:
        get_input: cce-flavor
      instances:
        get_input: cce-node-num
      labels:
        - key: node
          value: pool1
      name: cce-test1
      publicIp:
        eip:
          bandwidth:
            shareType: PER
            size:
              get_input: EIP-Bandwidth
          ipType: 5_bgp
      rootVolume:
        size: 40
        volumeType: SATA
      sshKeyName:
        get_input: cce-sshKeyName
      availabilityZone:
        get_input: cce-nodepool-1_availabilityZone
    requirements:
      - clusterId:
          node: cce-cluseter
    type: HuaweiCloud.CCE.NodePool
  cce-nodepool-2:
    metadata:
      Designer:
        id: 3bce6f53-c4b7-4a6d-9276-5a958b56192e
    properties:
      clusterId:
        get_reference: cce-cluseter
      dataVolumes:
        - size: 100
          volumeType: SATA
      flavor:
        get_input: cce-flavor
      instances:
        get_input: cce-node-num
      labels:
        - key: node
          value: pool2
      name: cce-test2
      publicIp:
        eip:
          bandwidth:
            shareType: PER
            size:
              get_input: EIP-Bandwidth
          ipType: 5_bgp
      rootVolume:
        size: 40
        volumeType: SATA
      sshKeyName:
        get_input: cce-sshKeyName
      availabilityZone:
        get_input: cce-nodepool-2_availabilityZone
    requirements:
      - dependency:
          node: cce-nodepool-1
      - clusterId:
          node: cce-cluseter
    type: HuaweiCloud.CCE.NodePool
  dao-service-062c3:
    metadata:
      Designer:
        id: b5b49b16-9798-48ac-87b9-6654d4bf5067
    properties:
      apiVersion: 'apps/v1'
      clusterId:
        get_reference: cce-cluseter
      k8sManifest:
        apiVersion: 'apps/v1'
        kind: Deployment
        metadata:
          annotations:
            'deployment.kubernetes.io/revision': '1'
          enable: true
          generation: 1
          labels:
            app: dao-service
          name: dao-service
        spec:
          progressDeadlineSeconds: 600
          replicas:
            get_input: dao-service-instance-num
          revisionHistoryLimit: 10
          selector:
            matchLabels:
              app: dao-service
          strategy:
            rollingUpdate:
              maxSurge: 1
              maxUnavailable: 1
            type: RollingUpdate
          template:
            metadata:
              labels:
                app: dao-service
            spec:
              affinity:
                nodeAffinity:
                  requiredDuringSchedulingIgnoredDuringExecution:
                    nodeSelectorTerms:
                      - matchExpressions:
                          - key: node
                            operator: In
                            values:
                              - pool1
                podAntiAffinity:
                  requiredDuringSchedulingIgnoredDuringExecution:
                    - labelSelector:
                        matchExpressions:
                          - key: app
                            operator: In
                            values:
                              - dao-service
                      numOfMatchingPods: '1'
                      topologyKey: 'kubernetes.io/hostname'
              containers:
                - image: >-
                    swr.cn-north-1.myhuaweicloud.com/hwstaff_z00330634/president-service:1.2
                  imagePullPolicy: Always
                  lifecycle: {}
                  name: dao-image
                  resources:
                    limits:
                      cpu:
                        get_input: app-cpu-limit
                      memory:
                        get_input: app-mem-limit
                    requests:
                      cpu: 1000m
                      memory: 2Gi
                  securityContext:
                    privileged: false
                    readOnlyRootFilesystem: false
                    runAsNonRoot: false
                  terminationMessagePath: '/dev/termination-log'
                  terminationMessagePolicy: File
                  volumeMounts:
                    - mountPath: '/var/log/apm'
                      name: dao-servicepath
                      policy:
                        logs:
                          rotate: Daily
              dnsPolicy: ClusterFirst
              imagePullSecrets:
                - name: default-secret
              restartPolicy: Always
              schedulerName: default-scheduler
              securityContext:
                runAsNonRoot: false
              terminationGracePeriodSeconds: 30
              volumes:
                - hostPath:
                    path: '/var/paas/sys/log/persistence-service'
                    type: ''
                  name: dao-servicepath
    requirements:
      - clusterId:
          node: cce-cluseter
      - dependency:
          node: cce-nodepool-1
    type: HuaweiCloud.CCE.Deployment
  dao-service-h32em:
    metadata:
      Designer:
        id: 761c29dd-3efc-46cd-bdc8-84bdb2aebca9
    properties:
      apiVersion: v1
      clusterId:
        get_reference: cce-cluseter
      k8sManifest:
        apiVersion: v1
        kind: Service
        metadata:
          labels:
            app: dao-service
          name: dao-service
        spec:
          externalTrafficPolicy: Cluster
          ports:
            - port: 8080
              protocol: TCP
              targetPort: 8080
          selector:
            app: dao-service
          sessionAffinity: None
          type: NodePort
      kind: Service
      name: dao-service
      ports:
        - port: 8080
          protocol: TCP
          targetPort: 8080
      selector:
        app: dao-service
      type: NodePort
    requirements:
      - dependency:
          node: dao-service-062c3
      - clusterId:
          node: cce-cluseter
    type: HuaweiCloud.CCE.Service
  products-service-wht0f:
    metadata:
      Designer:
        id: 6e20c0d5-60a4-47d3-8eb7-4906e5e12ca0
    properties:
      apiVersion: 'apps/v1'
      clusterId:
        get_reference: cce-cluseter
      k8sManifest:
        apiVersion: 'apps/v1'
        kind: Deployment
        metadata:
          annotations:
            'deployment.kubernetes.io/revision': '1'
          labels:
            app: products-service
          name: products-service
        spec:
          replicas:
            get_input: product-service-instance-num
          selector:
            matchLabels:
              app: products-service
          strategy:
            type: RollingUpdate
          template:
            metadata:
              labels:
                app: products-service
            spec:
              affinity:
                nodeAffinity:
                  requiredDuringSchedulingIgnoredDuringExecution:
                    nodeSelectorTerms:
                      - matchExpressions:
                          - key: node
                            operator: In
                            values:
                              - pool2
                podAntiAffinity:
                  requiredDuringSchedulingIgnoredDuringExecution:
                    - labelSelector:
                        matchExpressions:
                          - key: app
                            operator: In
                            values:
                              - products-service
                      numOfMatchingPods: '1'
                      topologyKey: 'kubernetes.io/hostname'
              containers:
                - image: >-
                    swr.cn-north-1.myhuaweicloud.com/hwstaff_z00330634/product-service:v1.1
                  imagePullPolicy: Always
                  name: products-service-image
                  resources:
                    limits:
                      cpu:
                        get_input: app-cpu-limit
                      memory:
                        get_input: app-mem-limit
                    requests:
                      cpu: 500m
                      memory: 1Gi
                  securityContext:
                    privileged: false
                    readOnlyRootFilesystem: false
                    runAsNonRoot: false
                  terminationMessagePath: '/dev/termination-log'
                  terminationMessagePolicy: File
                  volumeMounts:
                    - mountPath: '/var/log/apm'
                      name: products-servicepath
                      policy:
                        logs:
                          rotate: Daily
              dnsPolicy: ClusterFirst
              imagePullSecrets:
                - name: default-secret
              restartPolicy: Always
              schedulerName: default-scheduler
              securityContext:
                runAsNonRoot: false
              terminationGracePeriodSeconds: 30
              volumes:
                - hostPath:
                    path: '/var/paas/sys/log/products-service'
                    type: ''
                  name: products-servicepath
    requirements:
      - clusterId:
          node: cce-cluseter
      - dependency:
          node: cce-nodepool-2
    type: HuaweiCloud.CCE.Deployment
  products-service-y7vdw:
    metadata:
      Designer:
        id: 8198f808-edcb-48f7-85f6-f7fd51676d4f
    properties:
      apiVersion: v1
      clusterId:
        get_reference: cce-cluseter
      k8sManifest:
        apiVersion: v1
        kind: Service
        metadata:
          labels:
            app: products-service
          name: products-service
        spec:
          externalTrafficPolicy: Cluster
          ports:
            - port: 8080
              protocol: TCP
              targetPort: 8080
          selector:
            app: products-service
          sessionAffinity: None
          type: NodePort
      kind: Service
      name: products-service
      ports:
        - port: 8080
          protocol: TCP
          targetPort: 8080
      selector:
        app: products-service
      type: NodePort
    requirements:
      - dependency:
          node: products-service-wht0f
      - clusterId:
          node: cce-cluseter
    type: HuaweiCloud.CCE.Service
  shoppingmalldb-lus04:
    metadata:
      Designer:
        id: 5d11e582-f1d9-4dd1-af24-e6898c3dc426
    properties:
      apiVersion: v1
      clusterId:
        get_reference: cce-cluseter
      k8sManifest:
        apiVersion: v1
        kind: Service
        metadata:
          labels:
            app: shoppingmalldb
          name: shoppingmalldb
        spec:
          externalTrafficPolicy: Cluster
          ports:
            - port: 3306
              protocol: TCP
              targetPort: 3306
          selector:
            app: shoppingmalldb
          sessionAffinity: None
          type: NodePort
      kind: Service
      name: shoppingmalldb
      ports:
        - port: 3306
          protocol: TCP
          targetPort: 3306
      selector:
        app: shoppingmalldb
      type: NodePort
    requirements:
      - dependency:
          node: shoppingmalldb-tycnl
      - clusterId:
          node: cce-cluseter
    type: HuaweiCloud.CCE.Service
  shoppingmalldb-tycnl:
    metadata:
      Designer:
        id: 79bdca3c-11d7-49f3-b868-09e210559924
    properties:
      apiVersion: 'apps/v1'
      clusterId:
        get_reference: cce-cluseter
      k8sManifest:
        apiVersion: 'apps/v1'
        kind: Deployment
        metadata:
          annotations:
            'deployment.kubernetes.io/revision': '1'
          enable: true
          generation: 1
          labels:
            app: shoppingmalldb
          name: shoppingmalldb
        spec:
          progressDeadlineSeconds: 600
          replicas:
            get_input: db-instance-num
          revisionHistoryLimit: 10
          selector:
            matchLabels:
              app: shoppingmalldb
          strategy:
            rollingUpdate:
              maxSurge: 1
              maxUnavailable: 1
            type: RollingUpdate
          template:
            metadata:
              labels:
                app: shoppingmalldb
            spec:
              affinity:
                nodeAffinity:
                  requiredDuringSchedulingIgnoredDuringExecution:
                    nodeSelectorTerms:
                      - matchExpressions:
                          - key: node
                            operator: In
                            values:
                              - pool1
                podAntiAffinity:
                  requiredDuringSchedulingIgnoredDuringExecution:
                    - labelSelector:
                        matchExpressions:
                          - key: app
                            operator: In
                            values:
                              - shoppingmalldb
                      numOfMatchingPods: '1'
                      topologyKey: 'kubernetes.io/hostname'
              containers:
                - image: >-
                    swr.cn-north-1.myhuaweicloud.com/hwstaff_z00330634/shoppingmalldb:1.0
                  imagePullPolicy: Always
                  lifecycle: {}
                  name: shoppingmalldb-image
                  resources:
                    limits:
                      cpu:
                        get_input: app-cpu-limit
                      memory:
                        get_input: app-mem-limit
                    requests:
                      cpu: 500m
                      memory: 1Gi
                  securityContext:
                    privileged: false
                    readOnlyRootFilesystem: false
                    runAsNonRoot: false
                  terminationMessagePath: '/dev/termination-log'
                  terminationMessagePolicy: File
                  volumeMounts:
                    - mountPath: '/var/log/apm'
                      name: shoppingmalldbpath
                      policy:
                        logs:
                          rotate: Daily
              dnsPolicy: ClusterFirst
              imagePullSecrets:
                - name: default-secret
              restartPolicy: Always
              schedulerName: default-scheduler
              securityContext:
                runAsNonRoot: false
              terminationGracePeriodSeconds: 30
              volumes:
                - hostPath:
                    path: '/var/paas/sys/log/shoppingmalldb'
                    type: ''
                  name: shoppingmalldbpath
    requirements:
      - clusterId:
          node: cce-cluseter
      - dependency:
          node: cce-nodepool-1
    type: HuaweiCloud.CCE.Deployment
  ui-service-jgyzt:
    metadata:
      Designer:
        id: 8caebad5-a34b-47ed-9cd4-f4de7578a2e7
    properties:
      apiVersion: 'apps/v1'
      clusterId:
        get_reference: cce-cluseter
      k8sManifest:
        apiVersion: 'apps/v1'
        kind: Deployment
        metadata:
          annotations:
            'deployment.kubernetes.io/revision': '1'
          enable: true
          generation: 1
          labels:
            app: ui-service
            appgroup: null
          name: ui-service
        spec:
          progressDeadlineSeconds: 600
          replicas:
            get_input: ui-service-instance-num
          revisionHistoryLimit: 10
          selector:
            matchLabels:
              app: ui-service
          strategy:
            rollingUpdate:
              maxSurge: 1
              maxUnavailable: 1
            type: RollingUpdate
          template:
            metadata:
              labels:
                app: ui-service
            spec:
              affinity:
                nodeAffinity:
                  requiredDuringSchedulingIgnoredDuringExecution:
                    nodeSelectorTerms:
                      - matchExpressions:
                          - key: node
                            operator: In
                            values:
                              - pool2
                podAntiAffinity:
                  requiredDuringSchedulingIgnoredDuringExecution:
                    - labelSelector:
                        matchExpressions:
                          - key: app
                            operator: In
                            values:
                              - ui-service
                      numOfMatchingPods: '1'
                      topologyKey: 'kubernetes.io/hostname'
              containers:
                - image: >-
                    swr.cn-north-1.myhuaweicloud.com/hwstaff_z00330634/ui-service:1.0
                  imagePullPolicy: Always
                  lifecycle: {}
                  name: ui-service-image
                  resources:
                    limits:
                      cpu:
                        get_input: app-cpu-limit
                      memory:
                        get_input: app-mem-limit
                    requests:
                      cpu: 500m
                      memory: 1Gi
                  securityContext:
                    privileged: false
                    readOnlyRootFilesystem: false
                    runAsNonRoot: false
                  terminationMessagePath: '/dev/termination-log'
                  terminationMessagePolicy: File
                  volumeMounts:
                    - mountPath: '/var/log/apm'
                      name: ui-servicepath
                      policy:
                        logs:
                          rotate: Daily
              dnsPolicy: ClusterFirst
              imagePullSecrets:
                - name: default-secret
              restartPolicy: Always
              schedulerName: default-scheduler
              securityContext:
                runAsNonRoot: false
              terminationGracePeriodSeconds: 30
              volumes:
                - hostPath:
                    path: '/var/paas/sys/log/ui-service'
                    type: ''
                  name: ui-servicepath
    requirements:
      - clusterId:
          node: cce-cluseter
      - dependency:
          node: cce-nodepool-2
    type: HuaweiCloud.CCE.Deployment
  ui-service-m8u9x:
    metadata:
      Designer:
        id: e9dfd189-9bbd-4d3a-bffd-5024b29c5483
    properties:
      apiVersion: v1
      clusterId:
        get_reference: cce-cluseter
      k8sManifest:
        apiVersion: v1
        kind: Service
        metadata:
          creationTimestamp: null
          labels:
            app: ui-service
          name: ui-service
        spec:
          externalTrafficPolicy: Cluster
          ports:
            - port: 8080
              protocol: TCP
              targetPort: 8080
          selector:
            app: ui-service
          sessionAffinity: None
          type: NodePort
      kind: Service
      name: ui-service
      ports:
        - port: 8080
          protocol: TCP
          targetPort: 8080
      selector:
        app: ui-service
      type: NodePort
    requirements:
      - dependency:
          node: ui-service-jgyzt
      - clusterId:
          node: cce-cluseter
    type: HuaweiCloud.CCE.Service
  user-service-87g8d:
    metadata:
      Designer:
        id: fc5841c9-ae2f-473c-bcba-54576384f093
    properties:
      apiVersion: 'apps/v1'
      clusterId:
        get_reference: cce-cluseter
      k8sManifest:
        apiVersion: 'apps/v1'
        kind: Deployment
        metadata:
          annotations:
            'deployment.kubernetes.io/revision': '1'
          enable: true
          generation: 1
          labels:
            app: user-service
          name: user-service
        spec:
          progressDeadlineSeconds: 600
          replicas:
            get_input: user-service-instance-num
          revisionHistoryLimit: 10
          selector:
            matchLabels:
              app: user-service
          strategy:
            rollingUpdate:
              maxSurge: 1
              maxUnavailable: 1
            type: RollingUpdate
          template:
            metadata:
              labels:
                app: user-service
            spec:
              affinity:
                nodeAffinity:
                  requiredDuringSchedulingIgnoredDuringExecution:
                    nodeSelectorTerms:
                      - matchExpressions:
                          - key: node
                            operator: In
                            values:
                              - pool1
                podAntiAffinity:
                  requiredDuringSchedulingIgnoredDuringExecution:
                    - labelSelector:
                        matchExpressions:
                          - key: app
                            operator: In
                            values:
                              - user-service
                      numOfMatchingPods: '1'
                      topologyKey: 'kubernetes.io/hostname'
              containers:
                - image: >-
                    swr.cn-north-1.myhuaweicloud.com/hwstaff_z00330634/user-service:1.0
                  imagePullPolicy: Always
                  lifecycle: {}
                  name: user-service-image
                  resources:
                    limits:
                      cpu:
                        get_input: app-cpu-limit
                      memory:
                        get_input: app-mem-limit
                    requests:
                      cpu: 500m
                      memory: 1Gi
                  securityContext:
                    privileged: false
                    readOnlyRootFilesystem: false
                    runAsNonRoot: false
                  terminationMessagePath: '/dev/termination-log'
                  terminationMessagePolicy: File
                  volumeMounts:
                    - mountPath: '/var/log/apm'
                      name: user-servicepath
                      policy:
                        logs:
                          rotate: Daily
              dnsPolicy: ClusterFirst
              imagePullSecrets:
                - name: default-secret
              restartPolicy: Always
              schedulerName: default-scheduler
              securityContext:
                runAsNonRoot: false
              terminationGracePeriodSeconds: 30
              volumes:
                - hostPath:
                    path: '/var/paas/sys/log/user-service'
                    type: ''
                  name: user-servicepath
    requirements:
      - clusterId:
          node: cce-cluseter
      - dependency:
          node: cce-nodepool-1
    type: HuaweiCloud.CCE.Deployment
  user-service-kzbwr:
    metadata:
      Designer:
        id: 3b895628-b8dd-4e2a-a498-9d45583588d1
    properties:
      apiVersion: v1
      clusterId:
        get_reference: cce-cluseter
      k8sManifest:
        apiVersion: v1
        kind: Service
        metadata:
          labels:
            app: user-service
          name: user-service
        spec:
          externalTrafficPolicy: Cluster
          ports:
            - port: 8080
              protocol: TCP
              targetPort: 8080
          selector:
            app: user-service
          sessionAffinity: None
          type: NodePort
      kind: Service
      name: user-service
      ports:
        - port: 8080
          protocol: TCP
          targetPort: 8080
      selector:
        app: user-service
      type: NodePort
    requirements:
      - dependency:
          node: user-service-87g8d
      - clusterId:
          node: cce-cluseter
    type: HuaweiCloud.CCE.Service
policies:
  apmp1fw0:
    metadata:
      Designer:
        id: b9e416d5-936b-486b-b6bd-1dff65e5b533
    properties:
      name:
        get_input: apmname
    targets:
      - user-service-87g8d
    type: HuaweiCloud.APM.Pinpoint
  apmp1nzz:
    metadata:
      Designer:
        id: ecf91468-21d6-4af8-bd6d-d88f07124f12
    properties:
      name:
        get_input: apmname
    targets:
      - products-service-wht0f
    type: HuaweiCloud.APM.Pinpoint
  apmp2ui8:
    metadata:
      Designer:
        id: ee176582-e8d4-4046-ac9e-a75cf95c014b
    properties:
      name:
        get_input: apmname
    targets:
      - ui-service-jgyzt
    type: HuaweiCloud.APM.Pinpoint
  apmp36wz:
    metadata:
      Designer:
        id: f7a501e2-36d9-466a-b5bf-1504473cb86f
    properties:
      name:
        get_input: apmname
    targets:
      - dao-service-062c3
    type: HuaweiCloud.APM.Pinpoint
  apmp3f3y:
    metadata:
      Designer:
        id: b63afaa0-536e-40e6-ba45-6ebde25e95ad
    properties:
      name:
        get_input: apmname
    targets:
      - api-gateway-y3h4s
    type: HuaweiCloud.APM.Pinpoint
  apmps98a:
    metadata:
      Designer:
        id: edd2c089-5a98-4b71-81ed-e9e03345e847
    properties:
      name:
        get_input: apmname
    targets:
      - shoppingmalldb-tycnl
    type: HuaweiCloud.APM.Pinpoint
tosca_definitions_version: huaweicloud_tosca_version_1_0
