Rayan Ahmed
03/30/2024, 1:46 AMflink-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 -
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 -
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
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-configmapMarco Villalobos
03/31/2024, 1:00 PMspec.logConfiguration. Example by me here:
https://github.com/minmay/understanding-apache-flink/blob/develop/conf/flink-operator-understanding-apache-flink.yaml
Documentation here: https://nightlies.apache.org/flink/flink-kubernetes-operator-docs-release-0.1/docs/custom-resource/reference/ and here https://nightlies.apache.org/flink/flink-kubernetes-operator-docs-main/docs/operations/metrics-logging/Rayan Ahmed
04/01/2024, 4:57 PMMarco Villalobos
04/01/2024, 8:26 PMakash patel
04/03/2024, 12:58 AMMarco Villalobos
04/03/2024, 4:27 PMakash patel
04/05/2024, 3:04 PM