mirror of
https://github.com/helm/charts.git
synced 2026-08-19 12:27:02 +00:00
[stable/phpbb] Avoid setting SMTP env. variables when SMTP parameters are not set (#10394)
* [stable/phpbb] Avoid setting SMTP env. variables when SMTP parameters are not set Signed-off-by: tompizmor <tompizmor@gmail.com> * Not create smtpPassword secret if not needed Signed-off-by: tompizmor <tompizmor@gmail.com> * Remove extra whitespaces when render template Signed-off-by: tompizmor <tompizmor@gmail.com>
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
f759be60d9
commit
6763d5558b
@@ -1,5 +1,5 @@
|
||||
name: phpbb
|
||||
version: 4.0.0
|
||||
version: 4.0.1
|
||||
appVersion: 3.2.4
|
||||
description: Community forum that supports the notion of users and groups, file attachments,
|
||||
full-text search, notifications and more.
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
|
||||
{{- if contains "NodePort" .Values.service.type }}
|
||||
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "phpbb.fullname" . }})
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services "{{ template "phpbb.fullname" . }}")
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo "phpBB URL: http://$NODE_IP:$NODE_PORT/"
|
||||
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "phpbb.fullname" . }}'
|
||||
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w "{{ template "phpbb.fullname" . }}"'
|
||||
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "phpbb.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} "{{ template "phpbb.fullname" . }}" --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
|
||||
{{- $port:=.Values.service.port | toString }}
|
||||
echo "phpBB URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/"
|
||||
@@ -21,14 +21,14 @@
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
|
||||
echo "phpBB URL: http://127.0.0.1:8080/"
|
||||
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "phpbb.fullname" . }} 8080:{{ .Values.service.port }}
|
||||
kubectl port-forward --namespace {{ .Release.Namespace }} svc/"{{ template "phpbb.fullname" . }}" 8080:{{ .Values.service.port }}
|
||||
|
||||
{{- end }}
|
||||
|
||||
2. Get your phpBB login credentials by running:
|
||||
|
||||
echo Username: {{ .Values.phpbbUser }}
|
||||
echo Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "phpbb.fullname" . }} -o jsonpath="{.data.phpbb-password}" | base64 --decode)
|
||||
echo Password: $(kubectl get secret --namespace {{ .Release.Namespace }} "{{ template "phpbb.fullname" . }}" -o jsonpath="{.data.phpbb-password}" | base64 --decode)
|
||||
|
||||
{{- else -}}
|
||||
|
||||
|
||||
@@ -15,6 +15,13 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "phpbb.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: {{ template "phpbb.fullname" . }}-apache
|
||||
name: "{{ template "phpbb.fullname" . }}-apache"
|
||||
labels:
|
||||
app: {{ template "phpbb.fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
app: "{{ template "phpbb.fullname" . }}"
|
||||
chart: "{{ template "phpbb.chart" . }}"
|
||||
release: {{ .Release.Name | quote }}
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.persistence.apache.accessMode | quote }}
|
||||
|
||||
@@ -2,24 +2,24 @@
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "phpbb.fullname" . }}
|
||||
name: "{{ template "phpbb.fullname" . }}"
|
||||
labels:
|
||||
app: {{ template "phpbb.fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
app: "{{ template "phpbb.fullname" . }}"
|
||||
chart: "{{ template "phpbb.chart" . }}"
|
||||
release: {{ .Release.Name | quote }}
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ template "phpbb.fullname" . }}
|
||||
release: "{{ .Release.Name }}"
|
||||
app: "{{ template "phpbb.fullname" . }}"
|
||||
release: {{ .Release.Name | quote }}
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "phpbb.fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
app: "{{ template "phpbb.fullname" . }}"
|
||||
chart: "{{ template "phpbb.chart" . }}"
|
||||
release: {{ .Release.Name | quote }}
|
||||
{{- if or .Values.podAnnotations .Values.metrics.enabled }}
|
||||
annotations:
|
||||
{{- if .Values.podAnnotations }}
|
||||
@@ -41,7 +41,7 @@ spec:
|
||||
hostnames:
|
||||
- "status.localhost"
|
||||
containers:
|
||||
- name: {{ template "phpbb.fullname" . }}
|
||||
- name: "{{ template "phpbb.fullname" . }}"
|
||||
image: {{ template "phpbb.image" . }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||
env:
|
||||
@@ -86,23 +86,33 @@ spec:
|
||||
- name: PHPBB_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "phpbb.fullname" . }}
|
||||
name: "{{ template "phpbb.fullname" . }}"
|
||||
key: phpbb-password
|
||||
- name: PHPBB_EMAIL
|
||||
value: {{ .Values.phpbbEmail | quote }}
|
||||
{{- if .Values.smtpHost }}
|
||||
- name: SMTP_HOST
|
||||
value: {{ .Values.smtpHost | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.smtpPort }}
|
||||
- name: SMTP_PORT
|
||||
value: {{ .Values.smtpPort | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.smtpUser }}
|
||||
- name: SMTP_USER
|
||||
value: {{ .Values.smtpUser | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.smtpPassword }}
|
||||
- name: SMTP_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "phpbb.fullname" . }}
|
||||
name: "{{ template "phpbb.fullname" . }}"
|
||||
key: smtp-password
|
||||
{{- end }}
|
||||
{{- if .Values.smtpProtocol }}
|
||||
- name: SMTP_PROTOCOL
|
||||
value: {{ default "" .Values.smtpProtocol | quote }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 80
|
||||
@@ -152,14 +162,14 @@ spec:
|
||||
- name: phpbb-data
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ template "phpbb.fullname" . }}-phpbb
|
||||
claimName: "{{ template "phpbb.fullname" . }}-phpbb"
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
- name: apache-data
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ template "phpbb.fullname" . }}-apache
|
||||
claimName: "{{ template "phpbb.fullname" . }}-apache"
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
|
||||
@@ -5,9 +5,9 @@ metadata:
|
||||
name: {{ printf "%s-%s" .Release.Name "externaldb" }}
|
||||
labels:
|
||||
app: {{ printf "%s-%s" .Release.Name "externaldb" }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
chart: "{{ template "phpbb.chart" . }}"
|
||||
release: {{ .Release.Name | quote }}
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
type: Opaque
|
||||
data:
|
||||
db-password: {{ default "" .Values.externalDatabase.password | b64enc | quote }}
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: {{ template "phpbb.fullname" . }}-phpbb
|
||||
name: "{{ template "phpbb.fullname" . }}-phpbb"
|
||||
labels:
|
||||
app: {{ template "phpbb.fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
app: "{{ template "phpbb.fullname" . }}"
|
||||
chart: "{{ template "phpbb.chart" . }}"
|
||||
release: {{ .Release.Name | quote }}
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.persistence.phpbb.accessMode | quote }}
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "phpbb.fullname" . }}
|
||||
name: "{{ template "phpbb.fullname" . }}"
|
||||
labels:
|
||||
app: {{ template "phpbb.fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
app: "{{ template "phpbb.fullname" . }}"
|
||||
chart: "{{ template "phpbb.chart" . }}"
|
||||
release: {{ .Release.Name | quote }}
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
type: Opaque
|
||||
data:
|
||||
{{ if .Values.phpbbPassword }}
|
||||
{{- if .Values.phpbbPassword }}
|
||||
phpbb-password: {{ .Values.phpbbPassword | b64enc | quote }}
|
||||
{{ else }}
|
||||
{{- else }}
|
||||
phpbb-password: {{ randAlphaNum 10 | b64enc | quote }}
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
{{- if .Values.smtpPassword }}
|
||||
smtp-password: {{ default "" .Values.smtpPassword | b64enc | quote }}
|
||||
{{- end }}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "phpbb.fullname" . }}
|
||||
name: "{{ template "phpbb.fullname" . }}"
|
||||
labels:
|
||||
app: {{ template "phpbb.fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
app: "{{ template "phpbb.fullname" . }}"
|
||||
chart: "{{ template "phpbb.chart" . }}"
|
||||
release: {{ .Release.Name | quote }}
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
{{- if eq .Values.service.type "LoadBalancer" }}
|
||||
@@ -29,4 +29,4 @@ spec:
|
||||
nodePort: {{ .Values.service.nodePorts.https }}
|
||||
{{- end }}
|
||||
selector:
|
||||
app: {{ template "phpbb.fullname" . }}
|
||||
app: "{{ template "phpbb.fullname" . }}"
|
||||
|
||||
Reference in New Issue
Block a user