-
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
Support metadata labels in ScaledJob template #1311
Comments
This was supported in version 1.5 through scaledobject. Not sure why this got removed in version 2 ... |
Lines 67 to 69 in 50bec80
Would similar solution for And as a temporary workaround you can disable proxy injection on the namespace. |
Yeah something similar would work. I have 0 knowledge of Go unfortunately so not really able to submit a PR for this. Unfortunately my jobs are in the same namespace s my microservices so cannot disable injection at the namespace level. |
/assign I try to solve this issue. |
We have run into the same issue and having to go back to 1.5 as this is a show stopper for us, unless there is any other way of assigning labels for ScaledJob in 2.0? |
Reopening, since the problem is not fully solved: #1322 (comment) |
I've been testing this for a few hours and it seems that the metadata isn't being deserialized to the ScaledJob object. When I submit a scaledjob like this:
The resulting
I've looked at the api and tried debugging through it but can't seem to find why the metadata isn't being deserialized correctly. If someone points me to the correct location I can try to fix and create the PR. As a test i manually injected a label and an annotation into the spec of the createJob method, so I can verify that if we can get the data into the ScaledJob spec we can then add it to the pod spec. Cheers! |
I am using ArgoCD, and i have found that when i try to apply a ScaledJob with a metadata component it thinks that the metadata doen't exist even after a sync. On https://argoproj.github.io/argo-cd/user-guide/diffing/ it suggests that there could be a diff after syncing if
Is it possible that Keda appears to use the k8s job spec template I haven't found the source for Edit: Traced it to It looks like metadata is included properly, so maybe it is a serialization problem? |
It should come from the PodSpec type (variable name Template) under the JobSpec See : https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/api/batch/v1/types.go#L137 |
@zroubalik I am trying to debug this issue locally, but it is my first foray into the KEDA source (and crds and operators and go unfortunately) so i lack context. I have the local environment working and duplicating the issue; do you have any suggestions for where to begin the search? Is there any sort of post-processing for the crds, object translation, etc. that is a likely culprit? |
Discoveries so far:
|
Found a workaround:
Not a good solution since this file is generated, but will solve it if anyone needs a fix badly. |
Problem is controller-gen is not including anything in metadata from nested contructs: kubernetes-sigs/controller-tools#448 |
@fjmacagno great job! I was suspecting problems related to this setting. We can patch the CRD during the generation, same way it is done for #927 here: |
I have been running into similar issue when I try to run keda on minikube in windows environment. The version of keda installed is 2.13.1 and therefore should have this fix. I am using the below yml file(the relevant part) :
C:\sampleDocker>kubectl apply -f keda_sclaedjob.yml
|
in version 2.0
metadata
portion of ScaledJobtemplate
is ignored so it is impossible to setup a label for job to be createdUse-Case
To support managed identity in AKS, a label "aadpodidbinding" has to be added to the object that needs pods to be running under managed identity.
To use ScaledJob to create pods that run under managed identity, ScaledJob should support
metadata
section when defining job template.Specification
Allow adding labels to pod template using
metadata
sectionThe text was updated successfully, but these errors were encountered: