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

fix(helm): Include option to use Redis with SSL #26663

Merged
merged 19 commits into from
Feb 9, 2024
Merged

fix(helm): Include option to use Redis with SSL #26663

merged 19 commits into from
Feb 9, 2024

Conversation

shakeelansari63
Copy link
Contributor

@shakeelansari63 shakeelansari63 commented Jan 18, 2024

SUMMARY

Updated Helm Chart to allow connection to Redis Server which enforce SSL connection. For example, Azure managed Redis Cache enforce connection through ssl only.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

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.

@shakeelansari63
Copy link
Contributor Author

I have user CACHE_REDIS_URL instead of CACHE_REDIS_HOST

Here are some sample examples of rendered templates..

1. No Password and No SSL

values.yaml
image

Rendered Template
1 no-password_no-ssl

2. With Password and No SSL

values.yaml
image

Rendered Template
2 password_no-ssl

3. No Password and With SSL (ssl_cert_reqs = CERT_NONE)

values.yaml
image

Rendered Template
3 no-password_ssl_cert-none

4. With Password and With SSL (ssl_cert_reqs = CERT_NONE)

values.yaml
image

Rendered Template
4 password_ssl_cert-none

5. With Password and With SSL (ssl_cert_reqs = CERT_OPTIONAL)

values.yaml
image

Rendered Template
5 password_ssl_cert-optional

@dpgaspar
Copy link
Member

can you please rebase if bump the chart version again to fix the conflict

@shakeelansari63
Copy link
Contributor Author

can you please rebase if bump the chart version again to fix the conflict

Sure, will do it shortly

@shakeelansari63
Copy link
Contributor Author

shakeelansari63 commented Jan 22, 2024

@dpgaspar , Rebased and bumped the chart version to 0.12.1

@shakeelansari63
Copy link
Contributor Author

So I have added 2 new Parameters in Values which will translate to 2 new Environment variables.
Also bumped up the chart version.

With Default Config

values.yaml
image

Generated secret-env.yaml
image

Generated secret-superset-config.yaml
Screenshot_20240126_155331

With modified config

values.yaml
image

Generated secret-env.yaml
image

Generated secret-superset-config.yaml
image

@shakeelansari63 shakeelansari63 changed the title Fix(Helm): Include option to use Redis with SSL fix(Helm): Include option to use Redis with SSL Jan 26, 2024
@shakeelansari63 shakeelansari63 changed the title fix(Helm): Include option to use Redis with SSL fix(helm): Include option to use Redis with SSL Jan 26, 2024
@shakeelansari63
Copy link
Contributor Author

Default Config without Redis SSL and Redis Password

values.yaml
image

Rendered secret-env.yaml
image

Rendered superset-config.py under secret-superset-config.yaml
image

Updated Config with Redis SSL and Redis Password

values.yaml
image

Rendered secret-env.yaml
image

Rendered superset-config.py under secret-superset-config.yaml
image

@shakeelansari63
Copy link
Contributor Author

Hey guys, can you please review the code and tell me if you feel anything else should be changed...

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.

Looking good. I just left one more comment and I think @dpgaspar has one as well

helm/superset/templates/_helpers.tpl Outdated Show resolved Hide resolved
@shakeelansari63
Copy link
Contributor Author

Hey guys, can you please suggest if any further change is needed?

@rusackas
Copy link
Member

rusackas commented Feb 8, 2024

Re-running CI, while @craig-rueda and @dpgaspar review the requested changes. 🤞

Copy link
Member

@dpgaspar dpgaspar left a comment

Choose a reason for hiding this comment

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

Almost there!

you need to update the README.md

 | supersetNode.connections.db_pass | string | `"superset"` |  |
 | supersetNode.connections.db_port | string | `"5432"` |  |
 | supersetNode.connections.db_user | string | `"superset"` |  |
+| supersetNode.connections.redis_cache_db | string | `"1"` |  |
+| supersetNode.connections.redis_celery_db | string | `"0"` |  |
 | supersetNode.connections.redis_host | string | `"{{ .Release.Name }}-redis-headless"` | Change in case of bringing your own redis and then also set redis.enabled:false |
 | supersetNode.connections.redis_port | string | `"6379"` |  |
+| supersetNode.connections.redis_ssl.enabled | bool | `false` |  |
+| supersetNode.connections.redis_ssl.ssl_cert_reqs | string | `"CERT_NONE"` |  |
+| supersetNode.connections.redis_user | string | `""` |  |
 | supersetNode.containerSecurityContext | object | `{}` |  |
 | supersetNode.deploymentAnnotations | object | `{}` | Annotations to be added to supersetNode deployment |
 | supersetNode.deploymentLabels | object | `{}` | Labels to be added to supersetNode deployment |

@shakeelansari63
Copy link
Contributor Author

Almost there!

you need to update the README.md

 | supersetNode.connections.db_pass | string | `"superset"` |  |
 | supersetNode.connections.db_port | string | `"5432"` |  |
 | supersetNode.connections.db_user | string | `"superset"` |  |
+| supersetNode.connections.redis_cache_db | string | `"1"` |  |
+| supersetNode.connections.redis_celery_db | string | `"0"` |  |
 | supersetNode.connections.redis_host | string | `"{{ .Release.Name }}-redis-headless"` | Change in case of bringing your own redis and then also set redis.enabled:false |
 | supersetNode.connections.redis_port | string | `"6379"` |  |
+| supersetNode.connections.redis_ssl.enabled | bool | `false` |  |
+| supersetNode.connections.redis_ssl.ssl_cert_reqs | string | `"CERT_NONE"` |  |
+| supersetNode.connections.redis_user | string | `""` |  |
 | supersetNode.containerSecurityContext | object | `{}` |  |
 | supersetNode.deploymentAnnotations | object | `{}` | Annotations to be added to supersetNode deployment |
 | supersetNode.deploymentLabels | object | `{}` | Labels to be added to supersetNode deployment |

Yes, Just saw the failed CI task and updated this.

@rusackas
Copy link
Member

rusackas commented Feb 8, 2024

Thanks for the quick turnaround. Go, CI, go!!!

@pull-request-size pull-request-size bot added size/XL and removed size/M labels Feb 8, 2024
@shakeelansari63
Copy link
Contributor Author

@rusackas , please trigger ci again , I had missed to update helm version in readme

@pull-request-size pull-request-size bot added size/M and removed size/XL labels Feb 8, 2024
@shakeelansari63
Copy link
Contributor Author

Yay .. All CI Checks finally completed 🥳

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.

LGTM!

@craig-rueda craig-rueda merged commit f59498f into apache:master Feb 9, 2024
28 of 29 checks passed
{{- if .Values.supersetNode.connections.redis_password }}
REDIS_PASSWORD: {{ .Values.supersetNode.connections.redis_password | quote }}
{{- end }}
REDIS_PORT: {{ .Values.supersetNode.connections.redis_port | quote }}
REDIS_PROTO: {{ if .Values.supersetNode.connections.redis_ssl.enabled }}"rediss"{{ else }}"redis"{{ end }}
Copy link

Choose a reason for hiding this comment

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

This has broken those w/o generating the default secret, which is a very common use case to manage secrets separately (rather than relying on the Helm chart).

This kind of backward compatibility should have been implemented somewhere else, and it's not a good practice not to even document/mention this feature/behavior change at all.

Copy link

Choose a reason for hiding this comment

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

The solution was to add the new REDIS_PROTO in the managed secret. However, it was a hassle to root cause it, due to lacking of documentation.

sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.0.0 labels Apr 17, 2024
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/M 🚢 4.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants