spring cloud dataflow kubernetes deployment pass property

1/5/2020

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
-- Ajith Kannan
spring-cloud-dataflow
spring-cloud-kubernetes
spring-cloud-stream

1 Answer

1/6/2020

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

-- Ilayaperumal Gopinathan
Source: StackOverflow