[stable/moodle] Add service.type to values.yaml (#9404)

Signed-off-by: Javier J. Salmeron Garcia <jsalmeron@bitnami.com>
This commit is contained in:
Javier J. Salmerón-García
2018-11-20 09:35:40 -08:00
committed by k8s-ci-robot
parent bb86331ea0
commit c5f6cafba0
5 changed files with 51 additions and 18 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: moodle
version: 3.3.1
version: 4.0.0
appVersion: 3.5.3
description: Moodle is a learning platform designed to provide educators, administrators
and learners with a single robust, secure and integrated system to create personalised
+6 -1
View File
@@ -63,7 +63,12 @@ The following table lists the configurable parameters of the Moodle chart and th
| `smtpProtocol` | SMTP Protocol (options: ssl,tls, nil) | `nil` |
| `smtpUser` | SMTP user | `nil` |
| `smtpPassword` | SMTP password | `nil` |
| `serviceType` | Kubernetes Service type | `LoadBalancer` |
| `service.type` | Kubernetes Service type | `LoadBalancer` |
| `service.port` | Service HTTP port | `80` |
| `service.httpsPort` | Service HTTPS port | `443` |
| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` |
| `service.nodePorts.http` | Kubernetes http node port | `""` |
| `service.nodePorts.https` | Kubernetes https node port | `""` |
| `ingress.enabled` | Enable ingress controller resource | `false` |
| `ingress.hosts[0].name` | Hostname to your Moodle installation | `moodle.local` |
| `ingress.hosts[0].path` | Path within the url structure | `/` |
+10 -8
View File
@@ -1,8 +1,8 @@
{{- if or .Values.mariadb.enabled .Values.externalDatabase.host -}}
** Please be patient while the chart is being deployed **
{{- if and .Values.ingress.enabled (ne .Values.serviceType "ClusterIP") }}
** Notice : Usually with ingress the serviceType should be set to ClusterIP, which is not the case to this deployment! **
{{- if and .Values.ingress.enabled (ne .Values.service.type "ClusterIP") }}
** Notice : Usually with ingress the service.type should be set to ClusterIP, which is not the case to this deployment! **
{{- end }}
1. Access you Moodle instance with:
@@ -17,22 +17,24 @@
- http://{{ . }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.serviceType }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "moodle.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo "Moodle URL: http://$NODE_IP:$NODE_PORT/"
{{- else if contains "LoadBalancer" .Values.serviceType }}
{{- else if contains "LoadBalancer" .Values.service.type }}
** Please ensure an external IP is associated to the {{ template "moodle.fullname" . }} service before proceeding **
** Watch the status using: kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "moodle.fullname" . }} **
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "moodle.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo "Moodle URL: http://$SERVICE_IP/"
{{- else if contains "ClusterIP" .Values.serviceType }}
{{- $port:=.Values.service.port | toString }}
echo "Moodle URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/"
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "moodle.fullname" . }} 8080:80
{{- else if contains "ClusterIP" .Values.service.type }}
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "moodle.fullname" . }} 8080:{{ .Values.service.port }}
echo "Moodle URL: http://127.0.0.1:8080/"
{{- end }}
@@ -54,6 +56,6 @@ host. To configure Moodle to use and external database host:
1. Complete your Moodle deployment by running:
helm upgrade {{ .Release.Name }} --set serviceType={{ .Values.serviceType }},mariadb.enabled=false,externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST stable/moodle
helm upgrade {{ .Release.Name }} --set service.type={{ .Values.service.type }},mariadb.enabled=false,externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST stable/moodle
{{- end }}
+16 -7
View File
@@ -8,13 +8,22 @@ metadata:
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
type: {{ .Values.serviceType }}
type: {{ .Values.service.type }}
{{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }}
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }}
{{- end }}
ports:
- name: http
port: 80
targetPort: http
- name: https
port: 443
targetPort: https
- name: http
port: {{ .Values.service.port }}
targetPort: http
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}}
nodePort: {{ .Values.service.nodePorts.http }}
{{- end }}
- name: https
port: {{ .Values.service.httpsPort }}
targetPort: https
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}}
nodePort: {{ .Values.service.nodePorts.https }}
{{- end }}
selector:
app: {{ template "moodle.fullname" . }}
+18 -1
View File
@@ -145,7 +145,24 @@ mariadb:
## Kubernetes configuration
## For minikube, set this to NodePort, for ingress ClusterIP, elsewhere use LoadBalancer
##
serviceType: LoadBalancer
service:
type: LoadBalancer
# HTTP Port
port: 80
# HTTPS Port
httpsPort: 443
##
## nodePorts:
## http: <to set explicitly, choose port between 30000-32767>
## https: <to set explicitly, choose port between 30000-32767>
nodePorts:
http: ""
https: ""
## Enable client source IP preservation
## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip
##
externalTrafficPolicy: Cluster
## Configure the ingress resource that allows you to access the
## Moodle installation. Set up the URL