Hi, i am just trying to understand using the flink...
# random
r
Hi, i am just trying to understand using the flink-k8s-operators, if i would like to use that, i don’t need to make a docker image, based on the example, is that correct?
s
You can directly use flnk operator helm chart to get started with. You can build your own image also if you want to do some customizations.
m
The operator usually works in most of the cases as-is, as @Sumit Nekar stated. It is a good practice to create your own flink image with a CI/CD pipeline based on a base flink image e.g.
flink:1.15
containing your application jar, and refer it in the FlinkDeployment custom resource.
👍 1
r
i am just wondering how to pass in secrets and environment variables, can you guys show me an more detailed example? thank you
s
Secrets and environment variables can be passed using podTemplates. https://nightlies.apache.org/flink/flink-kubernetes-operator-docs-main/docs/custom-resource/pod-template/ This is like a deployment’s spec section. You can set env variables and refer secrets
r
will take a look, thank you
s
Example :
Copy code
podTemplate:
    spec:
      containers:
        - name: flink-main-container
          ports:
            - containerPort: {{ .Values.monitoring.port }}
              name: prometheus
          env: 
          - name: DEPLOY_MODE
            value: {{ .Values.env }}
          - name: CONNECTION_KEY
            valueFrom:
              secretKeyRef:
                key: CONNECTION_KEY
                name: secret1
          - name: MY_POD_IP
            valueFrom:
              fieldRef:
                fieldPath: status.podIP
m
there’s a shortcut too, that you can use as a single config
kubernetes.secrets=mysecret:/path/to/secret
👍 2
this’ll automount the secret for you