Closed yoep closed 4 years ago
already covered under https://github.com/spring-cloud/spring-cloud-deployer-kubernetes/issues/389
@yoep Now that the changes are merged you should be able to see the job specific annotations set.
Also, remember that you don't have to set spring.cloud.scheduler
properties explicitly as the task platform account properties are expected to be applied into both deployer
and scheduler
during the SCDF server startup.
Thanks!
Hi @ilayaperumalg
It seems like it's still not working correctly for schedules when using global scheduler config with jobAnnotations. When applying the following scheduler global config, it doesn't get applied to the job spec within the scheduled CronJob:
The following configuration is applied to the configuration of the dataflow server (not individual tasks):
spring:
cloud:
dataflow:
task:
platform:
kubernetes:
accounts:
default:
jobAnnotations: sidecar.istio.io/inject:true,sidecar.istio.io/rewriteAppHTTPProbers:true
kubernetes:
enabled: true
deployer:
kubernetes:
podAnnotations: sidecar.istio.io/inject:true,sidecar.istio.io/rewriteAppHTTPProbers:true
jobAnnotations: sidecar.istio.io/inject:true,sidecar.istio.io/rewriteAppHTTPProbers:true
scheduler:
kubernetes:
jobAnnotations: sidecar.istio.io/inject:true,sidecar.istio.io/rewriteAppHTTPProbers:true
It results in the following CronJob resource:
kind: CronJob
apiVersion: batch/v1beta1
metadata:
name: example-schedule
annotations:
sidecar.istio.io/inject: 'true'
sidecar.istio.io/rewriteAppHTTPProbers: 'true'
spec:
schedule: 15 0/3 * * 1-5
concurrencyPolicy: Allow
suspend: false
jobTemplate:
metadata:
creationTimestamp: null
spec:
template:
metadata:
creationTimestamp: null
spec:
restartPolicy: Never
containers:
- name: example
...
As you can see above, the annotations get applied to the metadata.annotations
of the CronJob, but not to the spec.jobTemplate.metadata.annotations
of the jobTemplate (which is what I expect to actually happen).
We're using spring-cloud-deployer-kubernetes version 2.5.0.
Kind regards, yoep
We're using Service Mesh within our cluster and need to apply some annotations on scheduled Pods by the CronJob within Kubernetes. When configuring
jobAnnotations
underspring.cloud.scheduler.kubernetes
, they're not being applied to the created Schedule by theKubernetesScheduler
. When configuringjobAnnotations
underspring.cloud.deployer.kubernetes
, they're being correctly applied to the Task byKubernetesTaskLauncher
.Example configuration:
Expected result:
Actual result: