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

refactor(helm): Allow chart operators to exclude the creation of the secret manifest #28308

Merged
merged 6 commits into from
May 3, 2024

Conversation

asaf400
Copy link
Contributor

@asaf400 asaf400 commented May 1, 2024

SUMMARY

Allow chart operators to exclude the creation of the secret manifest,
This would effectively support externally created secret - specifically for the template secret-env.yaml

From externally created sources such as sealed-secrets or external-secrets and others..

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

Copy link
Member

@craig-rueda craig-rueda left a comment

Choose a reason for hiding this comment

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

Looks good! You'll need to re-gen the chart readme and bump the chart version

@asaf400
Copy link
Contributor Author

asaf400 commented May 1, 2024

Looks good! You'll need to re-gen the chart readme and bump the chart version

Sure, will do, also verify, I'm suspicious of how helm would deal with the declaimer header, then the if,
Usually the if would be the top level 'item'.

I'll test that as well

@asaf400
Copy link
Contributor Author

asaf400 commented May 1, 2024

seems legit 👍

Locally against my PR branch with default values (explicit default for new parameter)

[root@LAPTOP-ASAF-T14 superset]# helm template . --set secretEnv.create=true -s templates/secret-env.yaml --debug
install.go:218: [debug] Original chart version: ""
install.go:235: [debug] CHART PATH: /opt/gits/superset/helm/superset

---
# Source: superset/templates/secret-env.yaml
apiVersion: v1
kind: Secret
metadata:
  name: release-name-superset-env
  namespace: default
  labels:
    app: release-name-superset
    chart: superset-0.12.9
    release: "release-name"
    heritage: "Helm"
type: Opaque
stringData:
    REDIS_HOST: "release-name-redis-headless"
    REDIS_USER: ""
    REDIS_PORT: "6379"
    REDIS_PROTO: "redis"
    REDIS_DB: "1"
    REDIS_CELERY_DB: "0"
    DB_HOST: "release-name-postgresql"
    DB_PORT: "5432"
    DB_USER: "superset"
    DB_PASS: "superset"
    DB_NAME: "superset"

And now with the new parameter as false:

[root@LAPTOP-ASAF-T14 superset]# helm template . --set secretEnv.create=false -s templates/secret-env.yaml --debug
install.go:218: [debug] Original chart version: ""
install.go:235: [debug] CHART PATH: /opt/gits/superset/helm/superset

Error: could not find template templates/secret-env.yaml in chart
helm.go:84: [debug] could not find template templates/secret-env.yaml in chart

@pull-request-size pull-request-size bot added size/S and removed size/XS labels May 1, 2024
@asaf400
Copy link
Contributor Author

asaf400 commented May 1, 2024

Done, bumped & generated

@john-bodley john-bodley added the review:checkpoint Last PR reviewed during the daily review standup label May 1, 2024
helm/superset/templates/secret-env.yaml Outdated Show resolved Hide resolved
@john-bodley john-bodley removed the review:checkpoint Last PR reviewed during the daily review standup label May 2, 2024
@rusackas rusackas merged commit 3e74ff1 into apache:master May 3, 2024
28 checks passed
dpgaspar pushed a commit to preset-io/superset that referenced this pull request May 6, 2024
@asaf400
Copy link
Contributor Author

asaf400 commented May 6, 2024

Just for future reference and search indexing,
For those using ArgoCD with the old versions of superset's helm chart and wish to use external secrets,
I have had limited success with ignoreDifferences:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: superset
  namespace: argocd
spec:
  ignoreDifferences:
    - kind: "Secret"
      group: "v1"
      jsonPointers:
        - /stringData/DB_HOST
        - /stringData/DB_NAME
        - /stringData/DB_PORT
        - /stringData/DB_PASS
        - /stringData/DB_USER
        - /stringData/REDIS_HOST
        - /stringData/
        - /data/DB_HOST
        - /data/DB_NAME
        - /data/DB_PORT
        - /data/DB_PASS
        - /data/DB_USER
        - /data/REDIS_HOST
        - /data
  project: default
  source:
    chart: superset
    repoURL: https://apache.github.io/superset
    targetRevision: 0.10.0

jzhao62 pushed a commit to jzhao62/superset that referenced this pull request May 16, 2024
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.1.0 labels Nov 27, 2024
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.49%. Comparing base (76d897e) to head (98fb6b6).
Report is 1094 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #28308   +/-   ##
=======================================
  Coverage   60.48%   60.49%           
=======================================
  Files        1931     1931           
  Lines       76236    76238    +2     
  Branches     8568     8566    -2     
=======================================
+ Hits        46114    46119    +5     
+ Misses      28017    28015    -2     
+ Partials     2105     2104    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/S 🚢 4.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants