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

[helm/affinity] - Updates to iam jupyter operator charts #5

Merged
merged 3 commits into from
Jul 12, 2024

Conversation

tyu0912
Copy link
Contributor

@tyu0912 tyu0912 commented Jul 12, 2024

Hi guys, I made a couple updates to the helm chart for iam , jupyter, and operator services. Details are below. Let me know what you guys think.

Update 1: Introduced with blocks to simplify addition of objects like resources, volumeMounts, and affinity. The with block provides scoping and also will take into account with a variable exists so no need for additional conditionals.

{{- with .Values.iam.resources }}
resources: {{- toYaml . | nindent 12 }}
{{- end }}

Update 2: Replaced environment variable specification to using a loop. This essentially removes the manual need to specify environment variables in both the values.yaml file and the deployment.yaml file making the chart easier to maintain and more dynamic.

{{- if or .Values.iam.env .Values.iam.envValueFrom }}
env:
  {{- range $key, $value := .Values.iam.envValueFrom }}
  - name: {{ $key }}
    valueFrom: {{- $value | toYaml | nindent 16 }}
  {{- end }}
  {{- range $key, $value := .Values.iam.env }}
  - name: {{ $key }}
    value: {{ $value | quote }}
  {{- end }}
{{- end }}

Update 3: Introduced helm unittests action and actual tests to confirm my changes. Details for the package can be found here https://github.com/helm-unittest/helm-unittest. The flow right now is that unittest will be via Github Actions every time a PR is opened, re-opened, etc.

Update 4: Set a default for namespace where if you specify such a value, it will take that. Otherwise, it will take the one defined in the release. Similarly patched up a role in operator helm chart that had a TODO.

Update 5: Patched in iam chart where the traefik middleware was being deployed all the time. Updated it so it only deploys if traefik is the ingressclass.

@tyu0912 tyu0912 force-pushed the helm/affinity branch 2 times, most recently from df7fc07 to a903240 Compare July 12, 2024 13:36
@tyu0912 tyu0912 marked this pull request as ready for review July 12, 2024 13:38
@echarles
Copy link
Member

Update 1: Introduced with blocks to simplify addition of objects like resources, volumeMounts, and affinity. The with block provides scoping and also will take into account with a variable exists so no need for additional conditionals.

Looks great.

Update 2: Replaced environment variable specification to using a loop. This essentially removes the manual need to specify environment variables in both the values.yaml file and the deployment.yaml file making the chart easier to maintain and more dynamic.

Much better, the manual process was tedious. Thank you so much 💯

Update 3: Introduced helm unittests action and actual tests to confirm my changes. Details for the package can be found here https://github.com/helm-unittest/helm-unittest. The flow right now is that unittest will be via Github Actions every time a PR is opened, re-opened, etc.

Excellent.

Update 4: Set a default for namespace where if you specify such a value, it will take that. Otherwise, it will take the one defined in the release. Similarly patched up a role in operator helm chart that had a TODO.

We have not been good at defaults, so yes, this is great.

Update 5: Patched in iam chart where the traefik middleware was being deployed all the time. Updated it so it only deploys if traefik is the ingressclass.

Awesome (actually the value should be datalayer-traefik I see you make the correct change in the PR)

Copy link
Member

@echarles echarles left a comment

Choose a reason for hiding this comment

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

LGTM Thx @tyu0912

@echarles echarles merged commit 6555b1f into main Jul 12, 2024
2 checks passed
@echarles echarles deleted the helm/affinity branch July 12, 2024 13:56
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