Hi everyone! How can we configure logback when usi...
# troubleshooting
r
Hi everyone! How can we configure logback when using flink-operator? The operator by default mounts
flink-conf.yaml
and
log4j-console.properties
under the path
/opt/flink/conf
If I try to mount a
logback-console.xml
like shown below, the job manager fails to start. Describing the pod shows -
Copy code
error during container init: error mounting "/var/lib/kubelet/pods/2d3a2ae7-a6c3-4748-8ea4-646448880edf/volume-subpaths/my-configmap/flink-main-container/0" to rootfs at "/opt/flink/conf/logback-console.xml": mount /var/lib/kubelet/pods/2d3a2ae7-a6c3-4748-8ea4-646448880edf/volume-subpaths/my-configmap/flink-main-container/0:/opt/flink/conf/logback-console.xml (via /proc/self/fd/6), flags: 0x5001, data: context="system_u:object_r:svirt_sandbox_file_t:s0:c696,c765": not a directory: unknown
I think this is because both the operator and I are trying to mount files to
/opt/flink/conf
If I specify a different path, pod starts running but complains saying -
Copy code
Caused by: java.io.FileNotFoundException: /opt/flink/conf/logback-console.xml (No such file or directory)
How do we get around this? We have several jobs. Each that would have their own logback settings so we want to be able to mount the settings to the correct path at the time of deployment. Here's my podTemplate for mounting. I have a separate configmap created for logback
Copy code
podTemplate:
    spec:
      containers:
        - name: flink-main-container
          imagePullPolicy: Always
          volumeMounts:
            - mountPath: /opt/flink/conf/logback-console.xml
              name: my-configmap
              subPath: logback-console.xml
      volumes:
        - name: my-configmap
          configMap:
            defaultMode: 420
            name: my-configmap
r
m
a
@Marco Villalobos do you know how to parse password/secret in flink-configuration not as a plain text?
m
I haven't done that before. However, my understanding is that it is already a solved problem within the Kubernetes tech stack. I won't have time today, but I'll try incorporate that practice into my configuration files when I have time. https://kubernetes.io/docs/concepts/configuration/secret/
a
That concept is there in k8s but not working with flink configs