diff --git a/README.md b/README.md index 8fc7f8e..363b6b3 100644 --- a/README.md +++ b/README.md @@ -159,13 +159,13 @@ The helm values are very sparse to keep it simple. If you need more values to be The PVC allocates 100Mi and the PV is using a host path volume. -The helm chart assumes you have [cert manager](https://github.com/jetstack/cert-manager) deployed to have TLS certificates managed easily in your cluster. Feel free to remove the issuer and adjust the ingress if you're on AWS with EKS for example. +The helm chart assumes you have [cert manager](https://github.com/jetstack/cert-manager) deployed to have TLS certificates managed easily in your cluster. Feel free to remove the issuer and adjust the ingress if you're on AWS with EKS for example. To install cert-manager, I recommend using the ["kubectl apply" way](https://cert-manager.io/docs/installation/kubectl/) to install cert-manager. To get started, `cp helm-chart/values.yaml helm-chart/my-values.yaml` and adjust `password`, `fqdn` and `letsencryptmail` in your new `my-values.yaml`, then just run ``` bash cd helm-chart -helm upgrade --install chhoto-url -n chhoto-url --create-namespace -f my-values.yaml +helm upgrade --install chhoto-url . -n chhoto-url --create-namespace -f my-values.yaml ``` ## Instructions for CLI usage diff --git a/helm-chart/templates/pv.yml b/helm-chart/templates/pv.yml index 6bd7e99..2992e3f 100644 --- a/helm-chart/templates/pv.yml +++ b/helm-chart/templates/pv.yml @@ -10,4 +10,4 @@ spec: accessModes: - ReadWriteOnce hostPath: - path: /mnt/data/chhoto-data + path: {{ .Values.persistence.hostPath.path }} diff --git a/helm-chart/templates/secret.yml b/helm-chart/templates/secret.yml index 9d09d33..f5c684f 100644 --- a/helm-chart/templates/secret.yml +++ b/helm-chart/templates/secret.yml @@ -5,3 +5,6 @@ metadata: type: Opaque data: password: {{ .Values.password }} + {{- if .Values.api_key }} + api_key: {{ .Values.api_key }} + {{- end }} diff --git a/helm-chart/templates/sts.yml b/helm-chart/templates/sts.yml index db787cf..0c8ec29 100644 --- a/helm-chart/templates/sts.yml +++ b/helm-chart/templates/sts.yml @@ -23,8 +23,29 @@ spec: secretKeyRef: name: secret key: password + {{- if .Values.api_key }} + - name: api_key + valueFrom: + secretKeyRef: + name: secret + key: api_key + {{- end }} - name: db_url value: /db/urls.sqlite + - name: site_url + value: "{{ .Values.protocol }}://{{ .Values.fqdn }}" + - name: redirect_method + value: {{ .Values.redirect_method }} + - name: slug_style + value: {{ .Values.slug_style }} + - name: slug_length + value: "{{ .Values.slug_length }}" + - name: public_mode + value: {{ .Values.public_mode }} + {{- if .Values.cache_control_header }} + - name: cache_control_header + value: {{ .Values.cache_control_header }} + {{- end }} volumeMounts: - name: data mountPath: /db diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 97749e3..f6a9760 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -9,6 +9,19 @@ image: # please use a better password in your values and base64 encode it password: cGFzc3dvcmQ= +# if used, needs to be base64 encoded as well +# api_key: U0VDVVJFX0FQSV9LRVk= +persistence: + hostPath: + path: /mnt/data/chhoto-data + +redirect_method: PERMANENT +slug_style: Pair +slug_length: 8 +public_mode: Disable +# cache_control_header: "no-cache, private" + +protocol: https fqdn: your.short.link.url.com letsencryptmail: your.mail@address.com