-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ScaledJob: Support metadata annotations for ephemeral volume claims #6259
base: main
Are you sure you want to change the base?
Conversation
0a2a958
to
2e104a0
Compare
Signed-off-by: Dimitri Pertin <[email protected]>
2e104a0
to
ebb2775
Compare
Thanks for the fix! He have merged this PR, and I'd say that it will fix the current issue too. Could you double check it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dpertin any update please?
Hi @JorTurFer @zroubalik - ephemeral:
volumeClaimTemplate:
metadata:
annotations:
annotaion: annotation
labels:
label: label
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
name: ephemeral-volume kubectl apply --dry-run=server -f scaledjoboutput.yaml
Error from server (BadRequest): error when creating "scaledjoboutput.yaml": ScaledJob in version "v1alpha1" cannot be handled as a ScaledJob: strict decoding error: unknown field "spec.jobTargetRef.template.spec.volumes[2].ephemeral.volumeClaimTemplate.metadata.annotations", unknown field "spec.jobTargetRef.template.spec.volumes[2].ephemeral.volumeClaimTemplate.metadata.labels" |
Could you share a demo ScaledJob to test it on my local? |
@JorTurFer ---
apiVersion: keda.sh/v1alpha1
kind: ScaledJob
metadata:
labels:
name: godummy
name: godummy
namespace: default
spec:
failedJobsHistoryLimit: 2
jobTargetRef:
activeDeadlineSeconds: 7200
backoffLimit: 1
completions: 1
parallelism: 1
template:
metadata:
annotations: null
spec:
containers:
- command:
- -c
- job
env: null
image: godummy:main
imagePullPolicy: Always
name: godummy-container
volumeMounts:
- mountPath: /app/data/
name: ephemeral-volume
- mountPath: /tmp
name: tmp
- mountPath: /etc/ssl/certs/app-ca.pem
name: vol-app-ca
readOnly: true
subPath: app-ca.pem
imagePullSecrets:
- name: registry-secret
restartPolicy: Never
volumes:
- emptyDir: {}
name: tmp
- name: vol-app-ca
secret:
secretName: app-ca
- ephemeral:
volumeClaimTemplate:
metadata:
annotations:
annotaion: annotaion
labels:
label: label
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
name: ephemeral-volume
maxReplicaCount: 1
minReplicaCount: 0
pollingInterval: 30
successfulJobsHistoryLimit: 3
triggers:
- authenticationRef:
kind: ClusterTriggerAuthentication
name: trigger
metadata:
bootstrapServers: bootstrapServer1:9092,bootstrapServer2:9092,bootstrapServer3:9092
consumerGroup: infra
lagThreshold: "10000"
scaleToZeroOnInvalidOffset: "true"
topic: godummy-job
type: kafka |
Helm chart doesn't work, there are missing changes related with that CRD in the chart. The problem is solved in KEDA repo, but helm chart is still not working. @zroubalik @wozniakjan , we should ensure that the CRDs are updated during the helm release process, probably I made some mistake during last release and the CRD isn't correctly placed there I think that this PR isn't required as this repo is fixed |
thanks @JorTurFer for your help |
Add
x-kubernetes-preserve-unknown-fields
to ScaledJob CRD in order to support metadata in ephemeral volume claimsBased on #1311
Previously, ArgoCD used to see a diff, bypassed the error but kept the application "OutOfSync":

Yet a warning was triggered:
unknown field "spec.jobTargetRef.template.spec.volumes[5].ephemeral.volumeClaimTemplate.metadata.annotations"
Now the change is applied, the desired block is part of the "live manifest" and the application is "Synced":

Checklist
Fixes #6254