mirror of
https://github.com/truenas/charts.git
synced 2026-11-23 23:18:08 +00:00
Have nginx as a sidecar instead of a separate deployment
This commit is contained in:
1 parent
a6a0ad54b2
commit
fbb2fe07a4
5 files changed
+31
-52
No files matched your search
@@ -14,6 +14,27 @@ spec:
|
|||||||
labels: {{ include "common.labels.selectorLabels" . | nindent 8 }}
|
labels: {{ include "common.labels.selectorLabels" . | nindent 8 }}
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
|
- name: {{ .Chart.Name }}-nginx
|
||||||
|
image: {{ printf "%s:%s" .Values.nginx.image.repository .Values.nginx.image.tag }}
|
||||||
|
imagePullPolicy: {{ .Values.nginx.image.pullPolicy }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: configuration
|
||||||
|
mountPath: /etc/nginx/nginx.conf
|
||||||
|
readOnly: true
|
||||||
|
subPath: config
|
||||||
|
- name: certs
|
||||||
|
mountPath: /etc/nginx/server.crt
|
||||||
|
subPath: certPublicKey
|
||||||
|
- name: certs
|
||||||
|
mountPath: /etc/nginx/server.key
|
||||||
|
subPath: certPrivateKey
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 80
|
||||||
|
protocol: TCP
|
||||||
|
- name: https
|
||||||
|
containerPort: 443
|
||||||
|
protocol: TCP
|
||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Chart.Name }}
|
||||||
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
|
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
|
||||||
{{ if .Values.extraAppVolumeMounts }}
|
{{ if .Values.extraAppVolumeMounts }}
|
||||||
@@ -40,11 +61,16 @@ spec:
|
|||||||
{{ $envList = mustAppend $envList (dict "name" "username" "valueFromSecret" true "secretName" $secretName "secretKey" "username") }}
|
{{ $envList = mustAppend $envList (dict "name" "username" "valueFromSecret" true "secretName" $secretName "secretKey" "username") }}
|
||||||
{{ $envList = mustAppend $envList (dict "name" "password" "valueFromSecret" true "secretName" $secretName "secretKey" "password") }}
|
{{ $envList = mustAppend $envList (dict "name" "password" "valueFromSecret" true "secretName" $secretName "secretKey" "password") }}
|
||||||
{{ include "common.containers.allEnvironmentVariables" (dict "environmentVariables" $envList) | nindent 10 }}
|
{{ include "common.containers.allEnvironmentVariables" (dict "environmentVariables" $envList) | nindent 10 }}
|
||||||
{{ if .Values.extraAppVolumeMounts }}
|
|
||||||
volumes:
|
volumes:
|
||||||
|
- name: configuration
|
||||||
|
configMap:
|
||||||
|
defaultMode: 0700
|
||||||
|
name: "nginx-config"
|
||||||
|
- name: certs
|
||||||
|
secret:
|
||||||
|
secretName: {{ include "secretName" . }}
|
||||||
{{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
|
{{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
|
||||||
- name: extrappvolume-{{ $index }}
|
- name: extrappvolume-{{ $index }}
|
||||||
hostPath:
|
hostPath:
|
||||||
path: {{ $hostPathConfiguration.hostPath }}
|
path: {{ $hostPathConfiguration.hostPath }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
|
||||||
@@ -1,7 +1,4 @@
|
|||||||
{{- $serviceName := include "common.names.fullname" . -}}
|
{{- $serviceName := "localhost" -}}
|
||||||
{{- if hasKey .Values "nameSuffix" -}}
|
|
||||||
{{- $serviceName = (printf "%v-%v" $serviceName .Values.nameSuffix) -}}
|
|
||||||
{{- end -}}
|
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
{{ $values := (. | mustDeepCopy) }}
|
|
||||||
{{ $_ := set $values "common" (dict "nameSuffix" "nginx") }}
|
|
||||||
{{ include "common.deployment.common_config" $values | nindent 0 }}
|
|
||||||
spec: {{ include "common.deployment.common_spec" $values | nindent 2 }}
|
|
||||||
template: {{ include "common.deployment.pod.metadata" $values | nindent 4 }}
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: {{ .Chart.Name }}-nginx
|
|
||||||
image: {{ printf "%s:%s" .Values.nginx.image.repository .Values.nginx.image.tag }}
|
|
||||||
imagePullPolicy: {{ .Values.nginx.image.pullPolicy }}
|
|
||||||
volumeMounts:
|
|
||||||
- name: configuration
|
|
||||||
mountPath: /etc/nginx/nginx.conf
|
|
||||||
readOnly: true
|
|
||||||
subPath: config
|
|
||||||
- name: certs
|
|
||||||
mountPath: /etc/nginx/server.crt
|
|
||||||
subPath: certPublicKey
|
|
||||||
- name: certs
|
|
||||||
mountPath: /etc/nginx/server.key
|
|
||||||
subPath: certPrivateKey
|
|
||||||
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
containerPort: 80
|
|
||||||
protocol: TCP
|
|
||||||
- name: https
|
|
||||||
containerPort: 443
|
|
||||||
protocol: TCP
|
|
||||||
volumes:
|
|
||||||
- name: configuration
|
|
||||||
configMap:
|
|
||||||
defaultMode: 0700
|
|
||||||
name: "nginx-config"
|
|
||||||
- name: certs
|
|
||||||
secret:
|
|
||||||
secretName: {{ include "secretName" . }}
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
{{ $port := .Values.nodePort }}
|
{{ $port := .Values.nodePort }}
|
||||||
{{ $ports := list }}
|
{{ $ports := list }}
|
||||||
{{ $ports = mustAppend $ports (dict "name" "https" "port" $port "nodePort" $port "targetPort" "https") }}
|
{{ $ports = mustAppend $ports (dict "name" "https" "nodePort" $port "targetPort" 443 "port" 443) }}
|
||||||
{{ $params := (. | mustDeepCopy) }}
|
{{ $params := (. | mustDeepCopy) }}
|
||||||
{{ $_ := set $params "common" (dict "nameSuffix" "nginx") }}
|
{{ $_ := set $params "commonService" (dict "ports" $ports "type" "NodePort" ) }}
|
||||||
{{ $_2 := set $params "commonService" (dict "ports" $ports "type" "NodePort" ) }}
|
|
||||||
{{ include "common.classes.service" $params }}
|
{{ include "common.classes.service" $params }}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{{ $port := .Values.nodePort }}
|
|
||||||
{{ $ports := list }}
|
|
||||||
{{ $ports = mustAppend $ports (dict "name" "collabora" "port" 9980 "targetPort" "collabora") }}
|
|
||||||
{{ $params := . }}
|
|
||||||
{{ $_ := set $params "commonService" (dict "ports" $ports "type" "ClusterIP" ) }}
|
|
||||||
{{ include "common.classes.service" $params }}
|
|
||||||
Reference in new issue
Block a user