Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into allow-nginx-additiona…
Browse files Browse the repository at this point in the history
…l-config
  • Loading branch information
FlorentPoinsaut committed Sep 8, 2023
2 parents 5c1a77b + 12ea561 commit 796267e
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 127 deletions.
2 changes: 1 addition & 1 deletion charts/nextcloud/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: nextcloud
version: 4.2.2
version: 4.3.1
appVersion: 27.0.2
description: A file sharing server that puts the control and security of your own data back into your hands.
keywords:
Expand Down
228 changes: 116 additions & 112 deletions charts/nextcloud/README.md

Large diffs are not rendered by default.

32 changes: 18 additions & 14 deletions charts/nextcloud/templates/nginx-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
{{- if .Values.nginx.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "nextcloud.fullname" . }}-nginxconfig
labels:
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
helm.sh/chart: {{ include "nextcloud.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
{{- if .Values.nginx.config.default }}
default.conf: |-
{{- define "default.conf" }}
upstream php-handler {
server 127.0.0.1:9000;
}

server {
listen 80;
listen {{ .Values.nginx.containerPort | default "80" }};

# HSTS settings
# WARNING: Only add the preload option once you read about
Expand Down Expand Up @@ -144,6 +132,22 @@ data:
}
}
{{- end }}

{{- if .Values.nginx.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "nextcloud.fullname" . }}-nginxconfig
labels:
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
helm.sh/chart: {{ include "nextcloud.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
{{- if .Values.nginx.config.default }}
default.conf: |-
{{- template "default.conf" $ }}
{{- end }}
{{- if .Values.nginx.config.custom }}
zz-custom.conf: |-
{{ .Values.nginx.config.custom | indent 4 }}
Expand Down
7 changes: 7 additions & 0 deletions charts/nextcloud/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ spec:
{{- if and (eq .Values.service.type "LoadBalancer") .Values.service.loadBalancerIP }}
loadBalancerIP: {{ default "" .Values.service.loadBalancerIP }}
{{- end }}
{{- if .Values.service.ipFamilies }}
ipFamilies:
{{- toYaml .Values.service.ipFamilies | nindent 4 }}
{{- end }}
{{- if .Values.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
ports:
- port: {{ .Values.service.port }}
targetPort: {{ .Values.nextcloud.containerPort }}
Expand Down
1 change: 1 addition & 0 deletions charts/nextcloud/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ nginx:
repository: nginx
tag: alpine
pullPolicy: IfNotPresent
containerPort: 80

config:
# This generates the default nginx config as per the nextcloud documentation
Expand Down
37 changes: 37 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
image:
tag: 24.0.3-fpm-alpine
nextcloud:
extraSidecarContainers:
- name: nginx-exporter
image: nginx/nginx-prometheus-exporter
command:
- nginx-prometheus-exporter
- -nginx.scrape-uri=http://127.0.0.1/stub_status
ports:
- name: metrics
containerPort: 9113
livenessProbe:
httpGet:
path: /metrics
port: metrics
readinessProbe:
httpGet:
path: /metrics
port: metrics
nginx:
config:
custom: |-
server {
listen localhost;
server_name status.localhost;
keepalive_timeout 0;
access_log off;
location /stub_status {
stub_status;
allow 127.0.0.1;
deny all;
}
}
enabled: true

0 comments on commit 796267e

Please sign in to comment.