0

I have the following 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

Unfortunately, when I run that manifest, the k8s cluster gets installed, but the subdomains cannot be created (yet), because:

[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."}

What jelastic API methods can I use to perform the necessary waiting until subdomain creation is possible?

My current workaround is to split that manifest into two manifests: one cluster installation manifest and one update manifest creating the subdomains. However, I'd like to have everything in the same manifest.

Laurent Michel
  • 1,069
  • 3
  • 14
  • 29

1 Answers1

1

Please change this:

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

to:

enableSubDomains:
  - jelastic.env.binder.AddDomains[cp]:
      envName: ${settings.envName}
      domains: staging,api-staging,assets-staging,api,assets
Virtuozzo
  • 1,993
  • 1
  • 10
  • 13