-
Notifications
You must be signed in to change notification settings - Fork 521
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
ServiceAccount binding not being generated in deployment #1758
Comments
Are you generating Deployment using JKube zero configuration mode or using your own fragment? For me, it seems to work for zero configuration mode but not when I'm using a Deployment fragment.
Are you sure about this? We have an integration test to verify this ServiceAccountIT |
I am using my own deployment.yaml fragment. Currenlty to work it out I am using |
I've observed ServiceAccountEnricher seems to only consider <configuration>
<resources>
<serviceAccounts>
<serviceAccount>
<name>my-existing-serviceaccount</name>
<deploymentRef>${project.artifactId}</deploymentRef>
</serviceAccount>
</serviceAccounts>
</resources>
... We need to make changes to ServiceAccountEnricher to consider |
We might want to deal with the ResourceConfig pojo and maybe remove the getServiceAccount getter, or evaluate how both configurations should be merged. |
…ountEnricher from handlers (eclipse-jkube#1758) Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity + Add IT `serviceaccountname-via-groovy-dsl` for `serviceAccount` resource configuration case Signed-off-by: Rohan Kumar <rohaan@redhat.com>
Since v1.11.0, Before v1.11.0, it used to work for zero configuration mode but not when user provides a deployment fragment. |
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. + Rename IT `serviceaccount-via-groovy-dsl` -> `serviceaccounts-via-groovy-dsl` for clarity Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…ountEnricher from handlers (eclipse-jkube#1758) + Currently `resources` > `serviceAccount` configuration option was being set in PodTemplateHandler, this worked for zero configuration option but not when user uses resource fragments. Move `serviceAccount` setting logic to ServiceAccountEnricher. Signed-off-by: Rohan Kumar <rohaan@redhat.com> Signed-off-by: Rohan Kumar <rohaan@redhat.com>
We moved I have checked with |
I've created #2196 for merging two configuration options. I think this issue can be closed. |
@nightswimmings : Sorry for the extremely late reply. We have released v1.13.0 which should contain fix for your ServiceAccount issue. Would appreciate if you could try it out whenever you get time.. |
Describe the bug
Even though documentation states https://www.eclipse.org/jkube/docs/kubernetes-maven-plugin#serviceaccount-generation
that one can bind the deployment to a serviceaccount by using
I just observed that there's no trace of such setting on the generated deployment.yml resource
The create approach, first described in the documentation, works fine but I have a preexisting serviceaccount so i dont want to generate it. I also tried using skpiCreate on the enricher with everything defined with ServiceAccounts, but still it fails
Eclipse JKube version
1.9.1
Component
Kubernetes Maven Plugin
Apache Maven version
3.6.1
Gradle version
No response
Steps to reproduce
Use a 1.9.1 JKube configuration with
the generated kubernates.yml/deployment.yml dont include serviceAccount on the spec
Expected behavior
deployment should contain the template.spec.serviceAccountName property with the value as per the definition in the POM plugin configuration section
Runtime
Kubernetes (vanilla)
Kubernetes API Server version
other (please specify in additional context)
Environment
macOS, other (please specify in additional context)
Eclipse JKube Logs
No response
Sample Reproducer Project
No response
Additional context
One can see the omission by inspecting generated descriptors, no need to test the integration with kubernetes
The text was updated successfully, but these errors were encountered: