From f1cdfa0d4899d73f2b08082a72de23019754734c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20J=2E=20Salmer=C3=B3n-Garc=C3=ADa?= Date: Wed, 27 Mar 2019 13:01:23 +0100 Subject: [PATCH] [stable/parse] Add ingress rules (#12578) Signed-off-by: Javier J. Salmeron Garcia --- stable/parse/Chart.yaml | 2 +- stable/parse/README.md | 16 ++++++ stable/parse/templates/ingress.yaml | 65 +++++++++++++++++++++++++ stable/parse/values.yaml | 75 +++++++++++++++++++++++++++++ 4 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 stable/parse/templates/ingress.yaml diff --git a/stable/parse/Chart.yaml b/stable/parse/Chart.yaml index e2d68ad924..30d4909570 100644 --- a/stable/parse/Chart.yaml +++ b/stable/parse/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: parse -version: 6.1.2 +version: 6.2.0 appVersion: 3.1.3 description: Parse is a platform that enables users to add a scalable and powerful backend to launch a full-featured app for iOS, Android, JavaScript, Windows, Unity, and more. keywords: diff --git a/stable/parse/README.md b/stable/parse/README.md index 28de5da5f1..1a4b3377ff 100644 --- a/stable/parse/README.md +++ b/stable/parse/README.md @@ -84,6 +84,22 @@ The following table lists the configurable parameters of the Parse chart and the | `persistence.storageClass` | PVC Storage Class for Parse volume | `nil` (uses alpha storage class annotation) | | `persistence.accessMode` | PVC Access Mode for Parse volume | `ReadWriteOnce` | | `persistence.size` | PVC Storage Request for Parse volume | `8Gi` | +| `ingress.enabled` | Enable ingress controller resource | `false` | +| `ingress.annotations` | Ingress annotations | `[]` | +| `ingress.certManager` | Add annotations for cert-manager | `false` | +| `ingress.dashboard.hosts[0].name` | Hostname to your Parse Dashboard installation | `ghost.local` | +| `ingress.dashboard.hosts[0].path` | Path within the url structure | `/` | +| `ingress.dashboard.hosts[0].tls` | Utilize TLS backend in ingress | `false` | +| `ingress.dashboard.hosts[0].tlsHosts` | Array of TLS hosts for ingress record (defaults to `ingress.hosts[0].name` if `nil`) | `nil` | +| `ingress.dashboard.hosts[0].tlsSecret` | TLS Secret (certificates) | `ghost.local-tls-secret` | +| `ingress.server.hosts[0].name` | Hostname to your Parse Server installation | `ghost.local` | +| `ingress.server.hosts[0].path` | Path within the url structure | `/` | +| `ingress.server.hosts[0].tls` | Utilize TLS backend in ingress | `false` | +| `ingress.server.hosts[0].tlsHosts` | Array of TLS hosts for ingress record (defaults to `ingress.hosts[0].name` if `nil`) | `nil` | +| `ingress.server.hosts[0].tlsSecret` | TLS Secret (certificates) | `ghost.local-tls-secret` | +| `ingress.secrets[0].name` | TLS Secret Name | `nil` | +| `ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` | +| `ingress.secrets[0].key` | TLS Secret Key | `nil` | | `mongodb.usePassword` | Enable MongoDB password authentication | `true` | | `mongodb.password` | MongoDB admin password | `nil` | | `mongodb.persistence.enabled` | Enable MongoDB persistence using PVC | `true` | diff --git a/stable/parse/templates/ingress.yaml b/stable/parse/templates/ingress.yaml new file mode 100644 index 0000000000..2761e8277b --- /dev/null +++ b/stable/parse/templates/ingress.yaml @@ -0,0 +1,65 @@ +{{- if .Values.ingress.enabled }} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ template "parse.fullname" . }} + labels: + app: "{{ template "parse.fullname" . }}" + chart: "{{ template "parse.chart" . }}" + release: {{ .Release.Name | quote }} + heritage: {{ .Release.Service | quote }} + annotations: + {{- if .Values.ingress.certManager }} + kubernetes.io/tls-acme: "true" + {{- end }} + {{- range $key, $value := .Values.ingress.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} +spec: + rules: + {{- range .Values.ingress.dashbard.hosts }} + - host: {{ .name }} + http: + paths: + - path: {{ default "/" .path }} + backend: + serviceName: {{ template "parse.fullname" $ }} + servicePort: dashboard-http + {{- end }} + {{- range .Values.ingress.server.hosts }} + - host: {{ .name }} + http: + paths: + - path: {{ default "/" .path }} + backend: + serviceName: {{ template "parse.fullname" $ }} + servicePort: server-http + {{- end }} + tls: + {{- range .Values.ingress.dashboard.hosts }} + {{- if .tls }} + - hosts: + {{- if .tlsHosts }} + {{- range $host := .tlsHosts }} + - {{ $host }} + {{- end }} + {{- else }} + - {{ .name }} + {{- end }} + secretName: {{ .tlsSecret }} + {{- end }} + {{- end }} + {{- range .Values.ingress.server.hosts }} + {{- if .tls }} + - hosts: + {{- if .tlsHosts }} + {{- range $host := .tlsHosts }} + - {{ $host }} + {{- end }} + {{- else }} + - {{ .name }} + {{- end }} + secretName: {{ .tlsSecret }} + {{- end }} + {{- end }} +{{- end }} diff --git a/stable/parse/values.yaml b/stable/parse/values.yaml index 966a327484..2afc7d7bc3 100644 --- a/stable/parse/values.yaml +++ b/stable/parse/values.yaml @@ -141,6 +141,81 @@ dashboard: # memory: 512Mi # cpu: 300m +## Configure the ingress resource that allows you to access the +## Parse installation. Set up the URL +## ref: http://kubernetes.io/docs/user-guide/ingress/ +## +ingress: + ## Set to true to enable ingress record generation + enabled: false + + ## Set this to true in order to add the corresponding annotations for cert-manager + certManager: false + + ## Ingress annotations done as key:value pairs + ## For a full list of possible ingress annotations, please see + ## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/annotations.md + ## + ## If tls is set to true, annotation ingress.kubernetes.io/secure-backends: "true" will automatically be set + ## If certManager is set to true, annotation kubernetes.io/tls-acme: "true" will automatically be set + annotations: + # kubernetes.io/ingress.class: nginx + + dashboard: + ## The list of hostnames to be covered with this ingress record. + ## Most likely this will be just one host, but in the event more hosts are needed, this is an array + hosts: + - name: parse.local + path: / + + ## Set this to true in order to enable TLS on the ingress record + tls: false + + ## Optionally specify the TLS hosts for the ingress record + ## Useful when the Ingress controller supports www-redirection + ## If not specified, the above host name will be used + # tlsHosts: + # - www.parse.local + # - parse.local + + ## If TLS is set to true, you must declare what secret will store the key/certificate for TLS + tlsSecret: parse.local-tls + + server: + ## The list of hostnames to be covered with this ingress record. + ## Most likely this will be just one host, but in the event more hosts are needed, this is an array + hosts: + - name: parse-server.local + path: / + + ## Set this to true in order to enable TLS on the ingress record + tls: false + + ## Optionally specify the TLS hosts for the ingress record + ## Useful when the Ingress controller supports www-redirection + ## If not specified, the above host name will be used + # tlsHosts: + # - www.parse.local + # - parse.local + + ## If TLS is set to true, you must declare what secret will store the key/certificate for TLS + tlsSecret: parse.local-tls + + secrets: + ## If you're providing your own certificates, please use this to add the certificates as secrets + ## key and certificate should start with -----BEGIN CERTIFICATE----- or + ## -----BEGIN RSA PRIVATE KEY----- + ## + ## name should line up with a tlsSecret set further up + ## If you're using cert-manager, this is unneeded, as it will create the secret for you if it is not set + ## + ## It is also possible to create and manage the certificates outside of this helm chart + ## Please see README.md for more information + # - name: parse.local-tls + # key: + # certificate: + + ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ ##