Adds stable/drupal ingress support (#813)

* Add Drupal chart ingress

* Bump stable/drupal minor version for new ingress feature

* stable/drupal Ingress template

* Change NOTES to only print hostname if a hostname is set (ingress can be set without it)

* Comment out Values.ingress.hostname by default

* Fix indentation

* Fix indentation on comments. Note we should clea up the wordpress chart, as this indentation problem came from there initially

* Add ingress.annotations to README table

* Fix markdown table spacing. Not a bug, but for consistency sake
This commit is contained in:
Scott Rigby
2017-04-12 11:25:54 -07:00
committed by Sean Knox
parent 34782e2d84
commit 47786d3038
5 changed files with 71 additions and 6 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: drupal
version: 0.4.6
version: 0.5.0
description: One of the most versatile open source content management systems.
keywords:
- drupal
+4
View File
@@ -52,6 +52,10 @@ The following tables lists the configurable parameters of the Drupal chart and t
| `drupalUsername` | User of the application | `user` |
| `drupalPassword` | Application password | _random 10 character long alphanumeric string_ |
| `drupalEmail` | Admin email | `user@example.com` |
| `ingress.annotations` | Specify ingress class | `kubernetes.io/ingress.class: nginx` |
| `ingress.enabled` | Enable ingress controller resource | `false` |
| `ingress.hostname` | URL for your Drupal installation | `drupal.local` |
| `ingress.tls` | Ingress TLS configuration | `[]` |
| `mariadb.mariadbRootPassword` | MariaDB admin password | `nil` |
| `serviceType` | Kubernetes Service type | `LoadBalancer` |
| `persistence.enabled` | Enable persistence using PVC | `true` |
+15 -5
View File
@@ -3,13 +3,13 @@
*** PLEASE BE PATIENT: Drupal may take a few minutes to install ***
*******************************************************************
1. Get the Drupal URL by running:
1. Get the Drupal URL:
{{- if contains "NodePort" .Values.serviceType }}
{{- if .Values.ingress.hostname }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT/
You should be able to access your new Drupal installation through
http://{{- .Values.ingress.hostname }}/
{{- else if contains "LoadBalancer" .Values.serviceType }}
@@ -25,6 +25,16 @@
kubectl port-forward $POD_NAME 8080:80
{{- end }}
{{- if contains "NodePort" .Values.serviceType }}
Or running:
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT/
{{- end }}
2. Login with the following credentials
echo Username: {{ .Values.drupalUsername }}
+28
View File
@@ -0,0 +1,28 @@
{{- if .Values.ingress.enabled -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
annotations:
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
rules:
- host: {{ .Values.ingress.hostname }}
http:
paths:
- path: /
backend:
serviceName: {{ template "fullname" . }}
servicePort: 80
{{- if .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}
+23
View File
@@ -47,9 +47,32 @@ mariadb:
## Kubernetes configuration
## For minikube, set this to NodePort, elsewhere use LoadBalancer
## Use ClusterIP if your setup includes ingress controller
##
serviceType: LoadBalancer
## Configure Ingress resource that allow you to access the Drupal installation
## Set up the URL
## ref: http://kubernetes.io/docs/user-guide/ingress/
##
ingress:
enabled: false
# Used to create Ingress record (should used with ServiceType: ClusterIP).
# hostname: drupal.local
## Ingress annotations
##
# annotations:
# kubernetes.io/ingress.class: nginx
## Ingress TLS configuration
## Secrets must be manually created in the namespace
##
# tls:
# - secretName: wordpress.local-tls
# hosts:
# - drupal.local
## Enable persistence using Persistent Volume Claims
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
##