Pod-Level Customization
On this page
Ververica Platform lets you define custom Kubernetes settings for the pods that run your Flink jobs. Use Kubernetes pod templates to attach labels, annotations, and volume mounts, and to configure JobManager and TaskManager pods independently. For example, you can add sidecar containers for logging, monitoring, or security proxies.
Pod-level customization is configured through the deployment YAML under spec.template.spec.kubernetes, using the kubernetes.jobManagerPodTemplate and kubernetes.taskManagerPodTemplate fields. Each accepts a full Kubernetes pod spec, so you can configure the JobManager and TaskManager pods independently.
The kubectl commands on this page require the deployment to be in a running state. If the deployment has not been started, no pods exist and the commands return no results.
Labels
Attach Kubernetes labels to a pod. Labels are useful for monitoring selectors, network policies, and cost allocation.
1kubernetes:
2 jobManagerPodTemplate:
3 metadata:
4 labels:
5 team: data-engineering
6 env: production
7 taskManagerPodTemplate:
8 metadata:
9 labels:
10 team: data-engineering
11 env: productionTo verify that labels are applied:
1kubectl -n <NAMESPACE> get pod \
2 -l deploymentName=<DEPLOYMENT_NAME> \
3 --show-labelsAnnotations
Attach Kubernetes annotations to a pod. Annotations are commonly used for Prometheus scraping configuration, sidecar injectors such as Istio or Vault, and tooling metadata.
1kubernetes:
2 jobManagerPodTemplate:
3 metadata:
4 annotations:
5 monitoring.example.com/scrape: "true"
6 taskManagerPodTemplate:
7 metadata:
8 annotations:
9 monitoring.example.com/scrape: "true"To verify that annotations are applied:
1kubectl -n <NAMESPACE> describe pod \
2 -l deploymentName=<DEPLOYMENT_NAME>,component=jobmanagerVolume Mounts
Mount additional volumes into a pod. Define the volume under spec.volumes and reference it from the main Flink container's volumeMounts (the main container is named flink-main-container).
1kubernetes:
2 jobManagerPodTemplate:
3 spec:
4 volumes:
5 - name: shared-data
6 emptyDir: {}
7 containers:
8 - name: flink-main-container
9 volumeMounts:
10 - name: shared-data
11 mountPath: /opt/flink/shared-data
12 taskManagerPodTemplate:
13 spec:
14 volumes:
15 - name: shared-data
16 emptyDir: {}
17 containers:
18 - name: flink-main-container
19 volumeMounts:
20 - name: shared-data
21 mountPath: /opt/flink/shared-dataTo verify that volumes are mounted:
1kubectl -n <NAMESPACE> describe pod \
2 -l deploymentName=<DEPLOYMENT_NAME>,component=jobmanager \
3 | grep -A4 "shared-data"Component-Specific Labels
Apply labels to one component only:
1kubernetes:
2 jobManagerPodTemplate:
3 metadata:
4 labels:
5 role: jobmanager-custom
6 taskManagerPodTemplate:
7 metadata:
8 labels:
9 role: taskmanager-customSidecar Containers
Add sidecar containers to run alongside the Flink process. Sidecars are useful for log shippers, monitoring agents, and security proxies, without requiring changes to the Flink image.
The image field is required for each sidecar container.
1kubernetes:
2 jobManagerPodTemplate:
3 spec:
4 containers:
5 - name: monitoring-sidecar
6 image: nginx:alpine
7 env:
8 - name: MONITORING_TARGET
9 value: jobmanager
10 taskManagerPodTemplate:
11 spec:
12 containers:
13 - name: monitoring-sidecar
14 image: nginx:alpine
15 env:
16 - name: MONITORING_TARGET
17 value: taskmanagerTo verify that sidecar containers are running:
1# Check that both containers are ready (2/2)
2kubectl -n <NAMESPACE> get pods \
3 -l deploymentName=<DEPLOYMENT_NAME>
4
5# Inspect the sidecar on the JobManager pod
6kubectl -n <NAMESPACE> describe pod \
7 -l deploymentName=<DEPLOYMENT_NAME>,component=jobmanager \
8 | grep -A10 "monitoring-sidecar:"
9
10# Inspect the sidecar on the TaskManager pod
11kubectl -n <NAMESPACE> describe pod \
12 -l deploymentName=<DEPLOYMENT_NAME>,component=taskmanager \
13 | grep -A10 "monitoring-sidecar:"Complete Configuration Example
The following YAML shows all supported pod customization options combined under spec.template.spec.kubernetes:
1spec:
2 template:
3 spec:
4 kubernetes:
5 jobManagerPodTemplate:
6 metadata:
7 labels:
8 team: data-engineering
9 env: production
10 annotations:
11 monitoring.example.com/purpose: my-flink-job
12 spec:
13 volumes:
14 - name: shared-data
15 emptyDir: {}
16 containers:
17 - name: flink-main-container
18 volumeMounts:
19 - name: shared-data
20 mountPath: /opt/flink/shared-data
21 - name: monitoring-sidecar
22 image: nginx:alpine
23 env:
24 - name: MONITORING_TARGET
25 value: jobmanager
26 taskManagerPodTemplate:
27 metadata:
28 labels:
29 team: data-engineering
30 env: production
31 annotations:
32 monitoring.example.com/purpose: my-flink-job
33 spec:
34 volumes:
35 - name: shared-data
36 emptyDir: {}
37 containers:
38 - name: flink-main-container
39 volumeMounts:
40 - name: shared-data
41 mountPath: /opt/flink/shared-data
42 - name: monitoring-sidecar
43 image: nginx:alpine
44 env:
45 - name: MONITORING_TARGET
46 value: taskmanager