spring cloud dataflow kubernetes部署传递属性

huangapple go评论64阅读模式
英文:

spring cloud dataflow kubernetes deployment pass property

问题

我有一个在Kubernetes中运行的Spring Cloud Data Flow应用程序。现在,我需要将新属性像"template metadata label enableIdentityHelper"一样作为流部署的一部分传递。以下是独立工作的部署yaml:

kind: Deployment
metadata:
  name: customapp
  labels:
    app: customapp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: customapp
  template:
    metadata:
      labels:
        app: customapp
        enableIdentityHelper: "true"
    spec:
      securityContext:
        runAsUser: 99
        fsGroup: 99

现在我需要将这些属性(如enableIdentityHelper、runAsUser、fsGroup等)作为流创建的一部分传递。流支持这个吗?如果支持,是不是像下面这样的方式?

deployer.client.kubernetes.template.metadata.labels.enableIdentityHelper=true
deployer.client.kubernetes.template.spec.securityContext.runAsUser=99
deployer.client.kubernetes.template.spec.securityContext.fsGroup=99
英文:

I have spring cloud dataflow app running in kubernetes . Now i need to pass new property like template metadata label enableIdentityHelper as part to stream deployment .Below is the deployment yaml which works standalone as below

DEPLOYMENT YAML

 kind: Deployment
    metadata:
      name: customapp
      labels:
        app: customapp
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: customapp
      template:
        metadata:
          labels:
            app: customapp
            enableIdentityHelper: "true"
        spec:
          securityContext:
          runAsUser: 99
          fsGroup: 99

Now i need to have this passed these properties (like enableIdentityHelper,runAsUser,fsGroup etc)as part of stream creation. Does stream support this ? If so is it something like below ?

   deployer.client.kubernetes.template.metadata.labels.enableIdentityHelper=true
   deployer.client.kubernetes.template.spec.securityContext.runAsUser=99
   deployer.client.kubernetes.template.spec.securityContext.fsGroup=99

答案1

得分: 1

你需要以deployer.<app-name>.kubernetes.<property-name>的形式传递部署属性。SCDF 使用的 Kubernetes 应用程序部署器使用部署属性列表。在你的情况下,你需要像这样传递:

deployer.<app>.kubernetes.deploymentLabels=myLabelName:myLabelValue

你可以参考如何传递部署标签的文档这里以及 Pod 安全上下文的文档这里

英文:

You need to pass the deployment properties in the form of deployer.<app-name>.kubernetes.<property-name>. Kubernetes app deployer used by SCDF uses a list of deployment properties. In your case, you need to pass like this:

deployer.<app>.kubernetes.deploymentLabels=myLabelName:myLabelValue

You can refer the documentation on how to pass the deployment label here and the pod security context here

huangapple
  • 本文由 发表于 2020年1月6日 02:30:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/59602968.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定