Skip to content
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

charts/csi-powermax: Migrate reverse proxy config from ConfigMap to Secret #608

Open
wants to merge 82 commits into
base: release-v1.14.0
Choose a base branch
from

Conversation

lukeatdell
Copy link

@lukeatdell lukeatdell commented Jan 14, 2025

Is this a new chart?

No

What this PR does / why we need it:

Migration of the reverse proxy configuration from a ConfigMap to a Secret allows customers to utilize password vaults and CSM-Authorization with the csi reverse proxy.

Which issue(s) is this PR associated with:

Special notes for your reviewer:

  • key, secretName, has been added.
    • If the parameter is empty, the reverse proxy configmap will be created. Otherwise, the user must create the new secret.
    • Limitation: If the user wishes to upgrade and continue using the configmap approach, the user must use the new helm chart and set the secretName value to an empty string, otherwise the default value will be used from the csireverseproxy helm chart values file and the driver will attempt to use the reverse proxy secret.
  • environment variable, X_CSI_POWERMAX_ENDPOINT, has been removed because, now that the reverse proxy is a requirement for installing csi-powermax, it appears to no longer be in use.
  • deprecation notices have been added to deprecated parameters in the values file. Templates have been updated to use the values only if the new secretName is not being used.

Checklist:

  • Chart Version bumped
  • Title of the PR starts with the chart name (e.g. [charts_dir/mychartname]) if applicable

@@ -20,31 +20,50 @@ spec:
image: {{ required "Must provided an image for reverseproxy container." .Values.image }}
imagePullPolicy: Always
env:
{{- $useRevProxySecret := not (empty .Values.secretName) }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Clever way to set this parameter without having to explicitly provide it in the values files.

Copy link
Author

Choose a reason for hiding this comment

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

So, the caveat here is, if the user is using their old values file during an upgrade, which does not have secretName in it, the new csireverseproxy values file will provide the default value and try to deploy with the new secret.
As far as I was able to find, there isn't a way to avoid this behavior unless we set secretName: "" in the default csireverseproxy values file.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can use hasKey along with the current condition in the helm template to check if Values.secretName exists (https://helm.sh/docs/chart_template_guide/function_list/#haskey). Then it will still work even if they are using the old values file.

@@ -1,7 +1,17 @@
{{- /*
Deprecation notice: use of reverseproxy-config ConfigMap is deprecated and will
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice use of deprecation comments throughout. Will help when we remove these parameters in a future release.

# Name of the reverseproxy secret as a Kubernetes resource.
# Default value: "powermax-reverseproxy-secret"
# Example: "powermax-reverseproxy-secret"
secretName: powermax-reverseproxy-secret
Copy link
Collaborator

Choose a reason for hiding this comment

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

This value can be empty by default to support backwards compatibility with the ConfigMap. If a customer upgrades without creating a Secret, this will attempt to mount the Secret.

Copy link
Author

Choose a reason for hiding this comment

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

ah yep. I just mentioned this in response to your comment above.
I was in favor of keeping it empty as well, but was unsure.

Will amend!

- update default value for secretName in both values files.
- update secret-configMap switching logic to check for existing secretName key, for better backward compat.
@lukeatdell lukeatdell requested a review from tdawe January 17, 2025 21:39
# PowerMax endpoints.
# Default value: ""
# Example: "powermax-reverseproxy-secret"
secretName: ""
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Why not reuse the defaultCredentialsSecret and make this a boolean that indicates whether to use the secret or configMap approach?

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.

7 participants