-
Notifications
You must be signed in to change notification settings - Fork 349
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
Add image pull secrets to Jaeger resources #1103
Add image pull secrets to Jaeger resources #1103
Conversation
Signed-off-by: Saad Hussain <[email protected]>
Signed-off-by: Saad Hussain <[email protected]>
526ca5d
to
a425353
Compare
Signed-off-by: Saad Hussain <[email protected]>
4e207c5
to
a9db5be
Compare
Signed-off-by: Saad Hussain <[email protected]>
a9db5be
to
cbe0254
Compare
Codecov Report
@@ Coverage Diff @@
## master #1103 +/- ##
==========================================
+ Coverage 88.05% 88.10% +0.05%
==========================================
Files 86 86
Lines 5274 5297 +23
==========================================
+ Hits 4644 4667 +23
Misses 466 466
Partials 164 164
Continue to review full report at Codecov.
|
Signed-off-by: Saad Hussain <[email protected]>
pkg/inject/sidecar.go
Outdated
@@ -211,6 +211,7 @@ func container(jaeger *v1.Jaeger, dep *appsv1.Deployment) corev1.Container { | |||
// see https://github.com/jaegertracing/jaeger-operator/issues/334 | |||
sort.Strings(args) | |||
|
|||
dep.Spec.Template.Spec.ImagePullSecrets = util.RemoveDuplicatedImagePullSecrets(append(dep.Spec.Template.Spec.ImagePullSecrets, commonSpec.ImagePullSecrets...)) |
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.
We really should document this, as we are changing a deployment that isn't being managed by us.
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.
Hm now that you mention that, I wonder if we should change
dep.Spec.Template.Spec.ImagePullSecrets = util.RemoveDuplicatedImagePullSecrets(append(dep.Spec.Template.Spec.ImagePullSecrets, commonSpec.ImagePullSecrets...))
to
dep.Spec.Template.Spec.ImagePullSecrets = util.RemoveDuplicatedImagePullSecrets(append(dep.Spec.Template.Spec.ImagePullSecrets, jaeger.Spec.Agent.JaegerCommonSpec.ImagePullSecrets...))
i.e., don't use the imagePullSecrets from the commonSpec, but rather only the ones under the agent spec, so that we don't add all the imagePullSecrets for the rest of the jaeger components to a deployment which isn't managed by the jaeger-operator. We would only add an imagePullSecret to the deployment if someone specifically adds it to the agent spec, which would then be more justified since it would seem to be a more intentional decision.
If we do make that ^ change, do you think we should still document this?
If we should still document, do you mean adding a comment, adding a log message, or updating documentation?
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.
It should be a user documentation, probably under the sidecar part: https://www.jaegertracing.io/docs/1.18/operator/#auto-injecting-jaeger-agent-sidecars
Looks good to me! The only missing bits seems to be around the auto-provisioned ES and Kafka. Do you know whether their CRs also support customizing the image pull secret? |
@jpkrohling ahmm I'm not too sure actually... I'm admittedly not too familiar with them since I've only really used the agent, collector, and query. |
@Saad-Hussain1 would you be able to check that? This PR looks good to me, but it would be good to know in advance if we need to extend this feature to include ES/Kafka, or if this feature is complete. One more thing I'd like to ask: could you please open an issue to document this new field? |
@jpkrohling Alright I'll try to look into it. Is something missing from this issue: #1018? |
Sorry, I meant an issue on https://github.com/jaegertracing/documentation, so that we don't forget to let users know about this behavior. |
I just realized that we might not need this after all... Given that we already support overriding the service account, and service accounts might contain image pull secrets, one could achieve the goal of this PR by just setting the appropriate service account to the component/spec. Like: apiVersion: v1
kind: ServiceAccount
metadata:
name: my-sa
imagePullSecrets:
- name: my-pull-secret apiVersion: jaegertracing.io/v1
kind: "Jaeger"
metadata:
name: "my-jaeger"
spec:
serviceAccount: my-sa Or am I missing something? |
Signed-off-by: Saad Hussain <[email protected]>
bd3597d
to
98a61b4
Compare
Signed-off-by: Saad Hussain <[email protected]>
@jpkrohling :O I actually did not know about that, but it does seem that that works! The original response to the git issue also made me think that this wasn't supported in any way, but I didn't know that imagePullSecrets could be added to serviceAccounts. I guess majority of this PR is actually unnecessary then. The only issue I have remaining is with the agent sidecar. It doesn't seem like serviceAccounts are supported for it, probably because the original deployment might already be using its own serviceAccount? Perhaps I can make a new PR to add imagePullSecrets to the sidecar's Deployment? Like this: #1115 |
I'm closing this PR in favor of #1115. Hope you did have fun while working on this, though! |
Context: #1018
Adds support for k8s imagePullSecrets to Jaeger resources.
Associated PR to update documentation: jaegertracing/documentation#416