diff --git a/k8s/README.md b/k8s/README.md index 05663e4..636a34e 100644 --- a/k8s/README.md +++ b/k8s/README.md @@ -22,6 +22,16 @@ NAMESPACE="datalab" kubectl patch deployment $DEPLOYMENT -n $NAMESPACE -p "{\"spec\": {\"template\": {\"metadata\": { \"labels\": { \"redeploy\": \"$( date +%s )\"}}}}}" ``` +## helm modify release data + +```sh +# see https://gist.github.com/DzeryCZ/c4adf39d4a1a99ae6e594a183628eaee +kubectl get secret sh.helm.release.v1.mailu.v8 -n mailu -o json | jq .data.release | tr -d '"' | base64 -d | base64 -d | gzip -d > tmp_v8_mailu +# edit as you like +kubcetl edit -n mailu secret sh.helm.release.v1.mailu.v8 +# delete the "release" stuff and copy and paste :) +``` + # Deployment (non persistent stuff) ## [ingress-nginx](https://github.com/kubernetes/ingress-nginx/tree/master/charts/ingress-nginx) @@ -446,9 +456,34 @@ Using the [mailu helm chart](https://github.com/Mailu/helm-charts/tree/master/ma ```sh helm repo add mailu https://mailu.github.io/helm-charts/ helm repo update +kubectl apply -f mailu/mailu.secret-key.secret.yml helm upgrade --install mailu mailu/mailu -n mailu -f mailu/mailu.secret.yml #helm upgrade --install mailu ../../mailu-helm-charts/mailu/ -n mailu -f mailu/mailu.secret.yml -helm template mailu ../../mailu-helm-charts/mailu/ -n mailu -f mailu/mailu.secret.yml +helm template mailu mailu/mailu -n mailu -f mailu/mailu.secret.yml +#helm template mailu ../../mailu-helm-charts/mailu/ -n mailu -f mailu/mailu.secret.yml +``` + +## SECRET_KEY + +There was an ERROR as follows: + +```sh +ERROR:root:Can't read SECRET_KEY from file: expected str, bytes or os.PathLike object, not NoneType +Traceback (most recent call last): + File "/config.py", line 8, in + system.set_env() + File "/app/venv/lib/python3.10/site-packages/socrate/system.py", line 35, in set_env + raise exc + File "/app/venv/lib/python3.10/site-packages/socrate/system.py", line 32, in set_env + secret_key = open(os.environ.get("SECRET_KEY_FILE"), "r").read().strip() +TypeError: expected str, bytes or os.PathLike object, not NoneTypew +``` + +The fix was to add the env variable as follows to the failing deployments: + +```sh + - name: SECRET_KEY + value: "fa5faeD9aegietaesahbiequ5Pe9au" ``` ### troubleshooting diff --git a/k8s/mailu/mailu.secret.yml b/k8s/mailu/mailu.secret.yml index a04f5c3..df15970 100644 --- a/k8s/mailu/mailu.secret.yml +++ b/k8s/mailu/mailu.secret.yml @@ -1,4 +1,7 @@ -mailuVersion: master +# DO NOT USE MASTER!!!! +#mailuVersion: master +# DO NOT USE MASTER!!! + hostnames: - mail.moritzgraf.de domain: moritzgraf.de