为什么我无法通过Jelastic安装清单附加外部IP?

时间:2020-03-16 04:10:38

标签: kubernetes jelastic

我有一个非常简单的jelastic安装清单,用于安装kubernetes集群:

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

  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: k8s-version
      type: string
      caption: k8s manifest version
      default: v1.16.3

  onInstall:
  - installKubernetes
  - attachIpToWorkerNodes

  actions:
    installKubernetes:
      install:
        jps: https://github.com/jelastic-jps/kubernetes/blob/${settings.k8s-version}/manifest.jps
        envName: ${settings.envName}
        displayName: ${settings.envName}
        settings:
          deploy: cc
          topo: ${settings.topo}
          dashboard: version2
          ingress-controller: Nginx
          storage: true
          api: true
          monitoring: true
          version: ${settings.k8s-version}
          jaeger: false
    attachIpToWorkerNodes:
    - forEach(node:nodes.cp):
      - jelastic.env.binder.AttachExtIp:
          envName: ${settings.envName}
          nodeId: ${@node.id}

如果安装该清单,则可以启动并运行群集,但辅助节点不会附加IPv4。安装该清单后,如果我另外安装以下更新清单,则它可以工作:

jpsVersion: 1.3
jpsType: update
application:
  id: attach-ext-ip
  name: Attach external IP
  version: 0.0

  onInstall:
  - attachIpToWorkerNodes

  actions:
    attachIpToWorkerNodes:
    - forEach(node:nodes.cp):
      - jelastic.env.binder.AttachExtIp:
          nodeId: ${@node.id}

我在安装清单中做错了什么?为什么IP不附加到我的工作程序节点上,而我是否在安装更新清单后执行该操作?

1 个答案:

答案 0 :(得分:1)

请注意,产品尚未提供“公共IP绑定”功能。它正在积极开发中,并将在我们的下一个版本中正式宣布。 在当前的稳定版本中,与其相关的某些功能可能无法正常工作。目前,不建议将其用于生产环境,但只能将其用于测试目的。 至于原始清单中的“ attachIpToWorkerNodes”操作,问题是所创建环境的“ nodes.cp”未在调用“ forEach”的范围内声明。该操作的正确版本是:

async componentDidMount(){
    await this.props.getParameteres4GAction()
}

如果您还有其他疑问,请告诉我们。