netbox: Remove old nginx/gunicorn config

This commit is contained in:
Alexander Olofsson 2023-04-27 08:50:21 +02:00
parent 6bfb864f9b
commit a77a0ecc8a
No known key found for this signature in database
GPG key ID: D439C9470CB04C73
2 changed files with 5 additions and 84 deletions

View file

@ -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 }}

View file

@ -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;
}
}
}