-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add Jenny's Helm chart #5
base: main
Are you sure you want to change the base?
Conversation
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.
Nice work, really good model!
A few general remarks:
- some files are missing an EOF newline
- labels and annotations seem a bit inconsistent, which makes them harder to use
{{- include "jenny.envs" . | nindent 12 }} | ||
- name: "UWSGI_PORT" | ||
value: "{{ .Values.django.port }}" | ||
{{- if .Values.persistence.enabled }} |
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 would align this with its closing {{- end }}
, for readability. WDYT?
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 remove this part.
port: {{ .Values.django.port }} | ||
httpHeaders: | ||
- name: "Host" | ||
value: "{{ .Values.ingress.host}}" |
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 think ingress should have a default host
value
jenny/templates/_helpers.tpl
Outdated
service: app | ||
{{- end }} | ||
|
||
{{- define "jenny.envs" -}} |
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.
nit:
{{- define "jenny.envs" -}} | |
{{/* | |
Environment variables | |
*/}} | |
{{- define "jenny.envs" -}} |
{{- end }} | ||
{{- end }} | ||
|
||
{{- define "django.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.
nit:
{{- define "django.imagePullSecrets" -}} | |
{{/* | |
ImagePullSecrets | |
*/}} | |
{{- define "django.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.
🥇 nice work, thanks! 🙏
jenny/templates/jobs.yaml
Outdated
{{- if $.Values.commonLabels }} | ||
{{ toYaml $.Values.commonLabels | nindent 4 }} | ||
{{- end }} | ||
app.kubernetes.io/component: jenny |
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.
What is this label used for?
If useful, could we use a helper definition to specify it?
jenny/values.yaml
Outdated
- "jenny-app" | ||
topologyKey: kubernetes.io/hostname | ||
|
||
autoscaling: |
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.
Should we provide a HorizontalPodAutoscaler
?
value: "{{ .Values.django.db.host }}" | ||
- name: "DB_PORT" | ||
value: "{{ .Values.django.db.port }}" | ||
{{- range $key, $val := .Values.env.secret }} |
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 linting this chart, a warning seems to be raised because of this line. It is resolved when adding an empty default value as so:
env:
secret: []
jenny/values.yaml
Outdated
podAnnotations: {} | ||
|
||
service: | ||
port: 8080 |
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.
This service port isn't used by any template, should it be removed?
metadata: | ||
name: "{{ template "jenny.fullname" . }}-nginx" |
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.
We're missing common labels and annotations here. Is that OK?
Rework Warren Helm chart based on the work done on Jenny Helm chart in PR openfun/charts#5 Changes done in this commit: - Jobs for database migration or static collection are abstracted into a single job template - Env variables are now processed in the helper template - Removed unused HorizontalPodAutoscaler - Add startup probes for migration checks - Migration jobs are now executed post helm installation/upgrade - Removed unnecessary security context variables - Add a nginx container alongside warren-app to serve static files - Rework postgresql values to have a functional Helm chart on a local cluster - Update Helm chart README.md
Rework Warren Helm chart based on the work done on Jenny Helm chart in PR openfun/charts#5 Changes done in this commit: - Jobs for database migration or static collection are abstracted into a single job template - Env variables are now processed in the helper template - Removed unused HorizontalPodAutoscaler - Add startup probes for migration checks - Migration jobs are now executed post helm installation/upgrade - Removed unnecessary security context variables - Add a nginx container alongside warren-app to serve static files - Rework postgresql values to have a functional Helm chart on a local cluster - Update Helm chart README.md
Rework Warren Helm chart based on the work done on Jenny Helm chart in PR openfun/charts#5 Changes done in this commit: - Jobs for database migration or static collection are abstracted into a single job template - Env variables are now processed in the helper template - Removed unused HorizontalPodAutoscaler - Add startup probes for migration checks - Migration jobs are now executed post helm installation/upgrade - Removed unnecessary security context variables - Add a nginx container alongside warren-app to serve static files - Rework postgresql values to have a functional Helm chart on a local cluster - Update Helm chart README.md
Rework Warren Helm chart based on the work done on Jenny Helm chart in PR openfun/charts#5 Changes done in this commit: - Jobs for database migration or static collection are abstracted into a single job template - Env variables are now processed in the helper template - Removed unused HorizontalPodAutoscaler - Add startup probes for migration checks - Migration jobs are now executed post helm installation/upgrade - Removed unnecessary security context variables - Add a nginx container alongside warren-app to serve static files - Rework postgresql values to have a functional Helm chart on a local cluster - Update Helm chart README.md
items: | ||
- key: config | ||
path: nginx.conf | ||
name: "{{ .Chart.Name }}-nginx" |
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.
name: "{{ .Chart.Name }}-nginx" | |
name: "{{ template "jenny.fullname" . }}-nginx" |
jenny/templates/deployment.yaml
Outdated
command: | ||
- "python" | ||
- "manage.py" | ||
- "collectstatic" | ||
- "--no-input" |
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.
It seems that the Django SECRET_KEY is needed to execute this command.
We should probably add the env variables to the initContainer. WDYT?
jenny/templates/ingress.yaml
Outdated
{{- end }} | ||
spec: | ||
ingressClassName: {{ .Values.ingress.class_name }} | ||
{{- if $.Values.ingress.tls.enable }} |
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 $.Values.ingress.tls.enable }} | |
{{- if $.Values.ingress.tls.enabled }} |
Ingore the tgz build with the command helm package.
This annotations need to be add to use the cert-manager for certificate request.
The host is not mandatory in the ingress definition but for an HTTP app it's a best pratice to use an host instead of an IP. And the host is mandatory for HTTPS.
Add the possibility to enable the HTTPS and to set the certificate name.
The Jenny image is build to ensure the user cannot write in the app dir. Allow to change the running user is not required.
Django required to collect the static and service with a HTTP server. We add an Nginx container in the pods and add an init container to collect this statics. And use an ephemeral volume for static instead of a persistent one.
Fix when create a list of job in the same template and ensure to run the job after the install to avoid missing resource.
This allow from the values to add environment variable from secret to configure Jenny's app.
Ensure to ingore previous helm package in the next helm package.
For the Django app we use the hearbeat add by the lib dockerflow for the liveness and readiness probes Use Nginx status page for liveness probe. And check migration for the startup probe.
Rework Warren Helm chart based on the work done on Jenny Helm chart in PR openfun/charts#5 Changes done in this commit: - Jobs for database migration or static collection are abstracted into a single job template - Env variables are now processed in the helper template - Removed unused HorizontalPodAutoscaler - Add startup probes for migration checks - Migration jobs are now executed post helm installation/upgrade - Removed unnecessary security context variables - Add a nginx container alongside warren-app to serve static files - Rework postgresql values to have a functional Helm chart on a local cluster - Update Helm chart README.md
jenny/templates/configmap.yaml
Outdated
allow 127.0.0.1; | ||
deny all; |
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.
allow 127.0.0.1; | |
deny all; |
Rework Warren Helm chart based on the work done on Jenny Helm chart in PR openfun/charts#5 Changes done in this commit: - Jobs for database migration or static collection are abstracted into a single job template - Env variables are now processed in the helper template - Removed unused HorizontalPodAutoscaler - Add startup probes for migration checks - Migration jobs are now executed post helm installation/upgrade - Removed unnecessary security context variables - Add a nginx container alongside warren-app to serve static files - Rework postgresql values to have a functional Helm chart on a local cluster - Update Helm chart README.md
Rework Warren Helm chart based on the work done on Jenny Helm chart in PR openfun/charts#5 Changes done in this commit: - Jobs for database migration or static collection are abstracted into a single job template - Env variables are now processed in the helper template - Removed unused HorizontalPodAutoscaler - Add startup probes for migration checks - Migration jobs are now executed post helm installation/upgrade - Removed unnecessary security context variables - Add a nginx container alongside warren-app to serve static files - Rework postgresql values to have a functional Helm chart on a local cluster - Update Helm chart README.md
Rework Warren Helm chart based on the work done on Jenny Helm chart in PR openfun/charts#5 Changes done in this commit: - Jobs for database migration or static collection are abstracted into a single job template - Env variables are now processed in the helper template - Removed unused HorizontalPodAutoscaler - Add startup probes for migration checks - Migration jobs are now executed post helm installation/upgrade - Removed unnecessary security context variables - Add a nginx container alongside warren-app to serve static files - Rework postgresql values to have a functional Helm chart on a local cluster - Update Helm chart README.md
Rework Warren Helm chart based on the work done on Jenny Helm chart in PR openfun/charts#5 Changes done in this commit: - Jobs for database migration or static collection are abstracted into a single job template - Env variables are now processed in the helper template - Removed unused HorizontalPodAutoscaler - Add startup probes for migration checks - Migration jobs are now executed post helm installation/upgrade - Removed unnecessary security context variables - Add a nginx container alongside warren-app to serve static files - Rework postgresql values to have a functional Helm chart on a local cluster - Update Helm chart README.md
This PR add the Helm chart from Jenny. A Django base app.