Skip to content

Add helm chart#150

Open
jbagot wants to merge 11 commits into
GeeksCAT:masterfrom
jbagot:97-helm-chart
Open

Add helm chart#150
jbagot wants to merge 11 commits into
GeeksCAT:masterfrom
jbagot:97-helm-chart

Conversation

@jbagot
Copy link
Copy Markdown

@jbagot jbagot commented Oct 30, 2020

Description

Fix #97

Add helm chart. You need a myvalues.yaml file with some secrets to execute it.
Now uses uwsgi.
Postgresql and redis as a depencies charts.

Code formating

The code has to be well formatted following the formatting rules. For example in Python the code has to follow the PEP8.

Before create your PR, please make sure your code is well formatted and styled doing:

$ >> pre-commit run --all

@jbagot jbagot requested a review from XaviTorello October 30, 2020 17:20
@jbagot jbagot marked this pull request as draft October 30, 2020 17:40
@jbagot jbagot marked this pull request as ready for review October 31, 2020 19:39
@francescarpi francescarpi added the arch & CI arch team label Nov 1, 2020
@francescarpi francescarpi added this to the sprint 4 milestone Nov 1, 2020
Copy link
Copy Markdown

@XaviTorello XaviTorello left a comment

Choose a reason for hiding this comment

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

Well done @jbagot, I like it :)

Just a few things to make k8s v1.18+ compatible and fix the possibility to deploy it (some bugs, env vars and some patchs)

I'm going to submit some changes to make it work

command:
- invoke
- celery-queues
envFrom:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe liveness tests could be implemented via celery -b XXX inspect ping command (or something similar)

Comment thread helm/apf/templates/secrets.yaml Outdated
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
data:
BASE_URL: {{ .Values.baseurl | b64enc | quote }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why all those vars are stored as a Secret? Is there any added value that justifies it?

tls:
- secretName: {{ $fullName }}-cert
{{- end }}
rules:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Todo: review traefik

Comment thread helm/apf/templates/ingress.yaml Outdated
pathType: Prefix
backend:
service:
name: {{ $fullName }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread helm/apf/values.yaml Outdated
@@ -0,0 +1,79 @@
baseurl: https://nemperfeina.cat
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The case is not correct

Comment thread helm/apf/templates/secrets.yaml Outdated
POSTGRES_PASSWORD: {{ required "postgres password is needed" .Values.postgresql.postgresqlPassword | b64enc | quote }}
# Celery
CELERY_BROKER_PROTOCOL: {{ .Values.celery.broker.protocol | b64enc | quote }}
CELERY_BROKER_HOST: {{ printf "%s-redis-master" (include "apf.name" .) | b64enc | quote }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should be apf.fullname

Comment thread helm/apf/templates/secrets.yaml Outdated
# Postgres
POSTGRES_DB: {{ .Values.postgresql.postgresqlDatabase | b64enc | quote }}
POSTGRES_USER: {{ .Values.postgresql.postgresqlUsername | b64enc | quote }}
POSTGRES_HOST: {{ printf "%s-postgresql" (include "apf.name" .) | b64enc | quote }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should be apf.fullname

Comment thread helm/apf/templates/secrets.yaml Outdated
# Telegram
TELEGRAM_TOKEN: {{ .Values.notifications.telegram.token | b64enc | quote }}
NOTIF_TELEGRAM_ENABLED: {{ .Values.notifications.telegram.enabled | b64enc | quote }}
TELEGRAM_CHAT_IDS: {{ .Values.notifications.telegram.chatIds | b64enc | quote }} No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There are more env vars needed to deploy the NPF (twitter, sentry, ...)

Comment thread tasks.py
@@ -52,8 +52,8 @@ def uwsgi(

command_args = [
"uwsgi",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

uWSGI is not currently integrated into the env, maybe it's better to handle it in another PR

@XaviTorello
Copy link
Copy Markdown

I commited some changes to your PR to make it works, feel free to rollback or continue patching it @jbagot :)

When this PR is ready, a massive git mv helm/apf helm/npf should be performed before merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch & CI arch team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Helm Chart for APF backend

3 participants