From bb86331ea0657309ec0fa6cdc330ef30a17aa865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20J=2E=20Salmer=C3=B3n-Garc=C3=ADa?= Date: Tue, 20 Nov 2018 18:27:34 +0100 Subject: [PATCH] [stable/mediawiki] Add service.port in values.yaml (#9403) Signed-off-by: Javier J. Salmeron Garcia --- stable/mediawiki/Chart.yaml | 2 +- stable/mediawiki/README.md | 2 ++ stable/mediawiki/templates/NOTES.txt | 6 ++++-- stable/mediawiki/templates/svc.yaml | 4 ++-- stable/mediawiki/values.yaml | 4 ++++ 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/stable/mediawiki/Chart.yaml b/stable/mediawiki/Chart.yaml index 0944a534af..49be0e54fa 100644 --- a/stable/mediawiki/Chart.yaml +++ b/stable/mediawiki/Chart.yaml @@ -1,5 +1,5 @@ name: mediawiki -version: 5.1.0 +version: 6.0.0 appVersion: 1.31.1 description: Extremely powerful, scalable software and a feature-rich wiki implementation that uses PHP to process and display data stored in a database. diff --git a/stable/mediawiki/README.md b/stable/mediawiki/README.md index 3c4d9723c1..0cd9c9610e 100644 --- a/stable/mediawiki/README.md +++ b/stable/mediawiki/README.md @@ -76,6 +76,8 @@ The following table lists the configurable parameters of the MediaWiki chart and | `mariadb.db.password` | Password for the database | _random 10 character long alphanumeric string_ | | `service.type` | Kubernetes Service type | `LoadBalancer` | | `service.loadBalancer` | Kubernetes LoadBalancerIP to request | `nil` | +| `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 | `""` | diff --git a/stable/mediawiki/templates/NOTES.txt b/stable/mediawiki/templates/NOTES.txt index 5dd529089c..306ec85872 100644 --- a/stable/mediawiki/templates/NOTES.txt +++ b/stable/mediawiki/templates/NOTES.txt @@ -27,12 +27,14 @@ Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "mediawiki.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "mediawiki.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo "Mediawiki URL: http://$SERVICE_IP/" + +{{- $port:=.Values.service.port | toString }} + echo "Mediawiki URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/" {{- else if contains "ClusterIP" .Values.service.type }} echo "Mediawiki URL: http://127.0.0.1:8080/" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "mediawiki.fullname" . }} 8080:80 + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "mediawiki.fullname" . }} 8080:{{ .Values.service.port }} {{- end }} {{- end }} diff --git a/stable/mediawiki/templates/svc.yaml b/stable/mediawiki/templates/svc.yaml index a301366e38..f060d455c2 100644 --- a/stable/mediawiki/templates/svc.yaml +++ b/stable/mediawiki/templates/svc.yaml @@ -17,13 +17,13 @@ spec: {{- end }} ports: - name: http - port: 80 + 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: 443 + port: {{ .Values.service.httpsPort }} targetPort: https {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}} nodePort: {{ .Values.service.nodePorts.https }} diff --git a/stable/mediawiki/values.yaml b/stable/mediawiki/values.yaml index dfbb1ad763..66706b5ec4 100644 --- a/stable/mediawiki/values.yaml +++ b/stable/mediawiki/values.yaml @@ -136,6 +136,10 @@ service: ## otherwise leave blank ## # loadBalancerIP: + # HTTP Port + port: 80 + # HTTPS Port + httpsPort: 443 ## Use nodePorts to requets some specific ports when usin NodePort ## nodePorts: ## http: