From a77a0ecc8ad5dfaea52891f68b6e490f96bad4f2 Mon Sep 17 00:00:00 2001 From: Alexander Olofsson Date: Thu, 27 Apr 2023 08:50:21 +0200 Subject: [PATCH] netbox: Remove old nginx/gunicorn config --- charts/netbox/templates/deployment.yaml | 13 ++-- charts/netbox/templates/nginx-config.yaml | 76 ----------------------- 2 files changed, 5 insertions(+), 84 deletions(-) delete mode 100644 charts/netbox/templates/nginx-config.yaml diff --git a/charts/netbox/templates/deployment.yaml b/charts/netbox/templates/deployment.yaml index 75f6429..36dde3d 100644 --- a/charts/netbox/templates/deployment.yaml +++ b/charts/netbox/templates/deployment.yaml @@ -102,14 +102,6 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} volumes: - - name: netbox-config-files - configMap: - name: {{ .Chart.Name }}-config-files - {{- if .Values.extraConfiguration }} - - name: netbox-extra-config - configMap: - name: {{ .Chart.Name }}-extra - {{- end }} - name: data {{- if .Values.persistence.enabled }} persistentVolumeClaim: @@ -117,6 +109,11 @@ spec: {{- else }} emptyDir: {} {{- end }} + {{- if .Values.extraConfiguration }} + - name: netbox-extra-config + configMap: + name: {{ .Chart.Name }}-extra + {{- end }} {{- if .Values.extraVolumes }} {{ toYaml .Values.extraVolumes | nindent 8 }} {{- end }} diff --git a/charts/netbox/templates/nginx-config.yaml b/charts/netbox/templates/nginx-config.yaml deleted file mode 100644 index bf61a5b..0000000 --- a/charts/netbox/templates/nginx-config.yaml +++ /dev/null @@ -1,76 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Chart.Name }}-config-files - labels: - app.kubernetes.io/name: {{ include "netbox.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - helm.sh/chart: {{ include "netbox.chart" . }} -data: -{{- if .Values.useUnixSocket }} - gunicorn_config.py: |- - command = '/usr/bin/gunicorn' - pythonpath = '/opt/netbox/netbox' - bind = 'unix:/tmp/netbox/gunicorn.sock' - workers = 3 - errorlog = '-' - accesslog = '-' - capture_output = False - loglevel = 'info' -{{- end }} - nginx.conf: |- - daemon off; - worker_processes 1; - - error_log /dev/stderr info; - - events { - worker_connections 1024; - } - - http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - sendfile on; - tcp_nopush on; - keepalive_timeout 65; - gzip on; - server_tokens off; - client_max_body_size 10M; - - upstream netbox { - {{- if .Values.useUnixSocket }} - server unix:/tmp/netbox/gunicorn.sock fail_timeout=0; - {{- else }} - server localhost:8001 fail_timeout=0; - {{- end }} - } - - server { - listen 8080; - access_log off; - - location /static/ { - alias /opt/netbox/netbox/static/; - } - - location / { - proxy_pass http://netbox; - proxy_set_header X-Forwarded-Host $http_host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-Proto $scheme; - add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"'; - } - } - - server { - listen 8081; - access_log off; - - location = /stub_status { - stub_status; - } - } - }