-
Notifications
You must be signed in to change notification settings - Fork 191
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
FEATURE : Add full support for imagePullSecrets #368
FEATURE : Add full support for imagePullSecrets #368
Conversation
@@ -5,6 +5,9 @@ | |||
nameOverride: "" | |||
fullnameOverride: "" | |||
|
|||
global: |
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.
I don't see anything that refers to those values.
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.
rabbitmq, postgresql, and minio dependencies use these global values. If you build the dependencies and expand the archives you will see it in each of their chart values. It's generally good to include imagePullSecrets as a global value option so it can be shared with all dependent charts, avoiding redundant configuration.
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.
I believe it works for RP dependencies when referred here (e.g. rabbitmq)
rabbitmq:
global:
imagePullSecrets: []
Template: https://github.com/bitnami/charts/blob/main/bitnami/rabbitmq/templates/_helpers.tpl#L25
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.
global.imagePullSecrets
doesn't resolve your issue. It's only RP value, and it doesn't have any relation with the chart dependencies. I don't see any profits from this change. We already have global value .Values.imagePullSecrets
. Switch from .Values.imagePullSecrets
to .Values.global.imagePullSecrets
nothing changes.
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.
You can add YAML anchors for deps imagePullSecrets
from our .Values.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.
Since the dependent charts are including a block for
global:
imagePullSecrets: []
then setting this value in the RP values will ensure it is passed down to all of the dependencies.
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.
If you set this global imagePullSecrets value and template the chart you will see it is getting rendered in any relevant Deployments or StatefulSets for the dependent charts.
See example:
~ helm template reportportal --set "global.imagePullSecrets={regcred}" -n reportportal
Sample snippet of rendered dependency:
---
# Source: reportportal/charts/minio/templates/standalone/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: release-name-minio
namespace: reportportal
labels:
app.kubernetes.io/name: minio
helm.sh/chart: minio-6.7.7
app.kubernetes.io/instance: release-name
app.kubernetes.io/managed-by: Helm
spec:
strategy:
type: Recreate
selector:
matchLabels:
app.kubernetes.io/name: minio
app.kubernetes.io/instance: release-name
template:
metadata:
labels:
app.kubernetes.io/name: minio
helm.sh/chart: minio-6.7.7
app.kubernetes.io/instance: release-name
app.kubernetes.io/managed-by: Helm
spec:
imagePullSecrets:
- name: regcred <----- applied via the global value to the MinIO chart dependency
serviceAccountName: release-name-minio
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.
See an example in another Helm chart here: https://github.com/kubeshop/helm-charts/blob/develop/charts/testkube/values.yaml#L5-L18
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.
Since the dependent charts are including a block for
global: imagePullSecrets: []
then setting this value in the RP values will ensure it is passed down to all of the dependencies.
I've got it.
However, why are there {{ .Values.global.imagePullSecrets }}
and {{ .Values.imagePullSecrets }}
in the Values file? What is the profit of using both? Do you have cases when you use different imagePullSecrets for deps charts and RP?
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.
When I provide {{ .Values.global.imagePullSecrets }}
in my Value chart, I expect this value to be used in all my templates, not only sub-charts. Isn't that so?
4535e64
to
5780380
Compare
It seems that currently only some of the ReportPortal Deployments and StatefulSets support imagePullSecrets which may be required in some cases to pull images from private registries. From what I can see it needs to also be supported for the dependent Helm charts below:
These changes should ensure imagePullSecrets can be applied to all ReportPortal components and all components required in the dependent charts.