如何等待直到在Jelastic清单安装中创建env for appid?

时间:2020-03-02 06:20:05

标签: kubernetes jelastic

我有以下manifest

jpsVersion: 1.3
jpsType: install
application:
  id: shopozor-k8s-cluster
  name: Shopozor k8s cluster
  version: 0.0

  baseUrl: https://raw.githubusercontent.com/shopozor/services/dev

  settings:
    fields:
      - name: envName
        caption: Env Name
        type: string
        default: shopozor
      - name: topo
        type: radio-fieldset
        values:
          0-dev: '<b>Development:</b> one master (1) and one scalable worker (1+)'
          1-prod: '<b>Production:</b> multi master (3) with API balancers (2+) and scalable workers (2+)'
        default: 0-dev
      - name: version
        type: string
        caption: Version
        default: v1.16.3

  onInstall:
    - installKubernetes
    - enableSubDomains

  actions:
    installKubernetes:
      install:
        jps: https://github.com/jelastic-jps/kubernetes/blob/${settings.version}/manifest.jps
        envName: ${settings.envName}
        displayName: ${settings.envName}
        settings:
          deploy: cmd
          cmd: |-
            curl -fsSL ${baseUrl}/scripts/install_k8s.sh | /bin/bash
          topo: ${settings.topo}
          dashboard: version2
          ingress-controller: Nginx
          storage: true
          api: true
          monitoring: true
          version: ${settings.version}
          jaeger: false
    enableSubDomains:
      - jelastic.env.binder.AddDomains[cp]:
          domains: staging,api-staging,assets-staging,api,assets

不幸的是,当我运行该清单时,安装了k8s集群,但是无法创建子域(因为),因为:

[15:26:28 Shopozor.cluster:3]: enableSubDomains:  {"action":"enableSubDomains","params":{}}
[15:26:29 Shopozor.cluster:4]: api [cp]:  {"method":"jelastic.env.binder.AddDomains","params":{"domains":"staging,api-staging,assets-staging,api,assets"},"nodeGroup":"cp"}
[15:26:29 Shopozor.cluster:4]: ERROR: api.response: {"result":2303,"source":"JEL","error":"env for appid [5ce25f5a6988fbbaf34999b08dd1d47c] not created."}

在可以创建子域之前,可以使用哪些jelastic API方法执行必要的等待?

我当前的解决方法是将该清单分为两个清单:一个群集安装清单和一个用于创建子域的更新清单。但是,我希望所有内容都在同一清单中。

1 个答案:

答案 0 :(得分:1)

请更改此:

enableSubDomains:
  - jelastic.env.binder.AddDomains[cp]:
      domains: staging,api-staging,assets-staging,api,assets

至:

enableSubDomains:
  - jelastic.env.binder.AddDomains[cp]:
      envName: ${settings.envName}
      domains: staging,api-staging,assets-staging,api,assets