Skip to content

Conversation

@msafwankarim
Copy link

Implementation for #176

Following is the flow

Copy value from source imagePullSecrets;
Set Pod Image Pull Secrets to template
Set the source value in values.yaml

Benifits

This would add the imagePullSecrets in pod spec by default. If there were any values in the imagePullSecrets field it will add them to values.yaml

sourceImagePullSecrets = []interface{}{}
}
specMap["imagePullSecrets"] = "{{ .Values.imagePullSecrets | default list | toJson }}"
values["imagePullSecrets"] = sourceImagePullSecrets
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what will happen if there are 2 pods with different imagePullSecrets in the chart?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently it will pickup the last one. Should we merge them into one list? Other option is to keep the list empty if we find more than one secrets. This will result in same behavior as not providing any secrets by default (i.e. current behavior)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont know what would be the best solution. maybe create a separate values for every pod. for example, image name is extracted to values per pod/container.

I just wanted to highligh that the current approch will lead to non-determenistic behaviour and data loss for cases with multiple deploymetns using different imagePullSecrets.

Copy link
Author

@msafwankarim msafwankarim Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've a scenario where I've manifests of multiple workloads all being fetched from private repo. Personally I think it will be annoying to provide same secret for N number of times. But I'll leave final decision to you. As long as we've a way to override this value from values.yml, I'm ok with it.

Other option I thought of was instead of keeping image-pull-secrets parameter boolean we make it an enum.

  1. Preserve (keep the current behavior that is already implemented)
  2. Merged (Add one pull secrets field in values.yml with all secrets to be used in all workloads)
  3. Indvidual (Have separate field for each workload)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants