From 553662ad3460afc97b87282a928be3c4d4f62702 Mon Sep 17 00:00:00 2001 From: Alexander Olofsson Date: Fri, 5 Jul 2019 10:11:22 +0200 Subject: [PATCH] Clean up and remove old service definition --- charts/netbox/templates/deployment.yaml | 22 ++++--------------- charts/netbox/templates/nginx-config.yaml | 6 ++++- charts/netbox/templates/service-api.yaml | 21 ------------------ .../{service-front.yaml => service.yaml} | 1 - 4 files changed, 9 insertions(+), 41 deletions(-) delete mode 100644 charts/netbox/templates/service-api.yaml rename charts/netbox/templates/{service-front.yaml => service.yaml} (93%) diff --git a/charts/netbox/templates/deployment.yaml b/charts/netbox/templates/deployment.yaml index 5d79dfb..682b9dc 100644 --- a/charts/netbox/templates/deployment.yaml +++ b/charts/netbox/templates/deployment.yaml @@ -8,14 +8,12 @@ metadata: helm.sh/chart: {{ include "netbox.chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} - com.digitalocean.netbox/component: api spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: app.kubernetes.io/name: {{ include "netbox.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} - com.digitalocean.netbox/component: api template: metadata: annotations: @@ -24,7 +22,6 @@ spec: labels: app.kubernetes.io/name: {{ include "netbox.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} - com.digitalocean.netbox/component: api spec: containers: - name: {{ .Chart.Name }} @@ -35,19 +32,6 @@ spec: name: {{ include "netbox.fullname" . }} - secretRef: name: {{ include "netbox.fullname" . }} - # livenessProbe: - # httpGet: - # path: / - # port: api - # initialDelaySeconds: 50 - # failureThreshold: 5 - readinessProbe: - tcpSocket: - port: api - ports: - - name: api - containerPort: 8001 - protocol: TCP resources: {{- toYaml .Values.resources | nindent 12 }} {{- if or .Values.persistence.enabled .Values.extraVolumeMounts }} @@ -80,11 +64,13 @@ spec: containerPort: 8080 protocol: TCP livenessProbe: - tcpSocket: + httpGet: port: http + path: / readinessProbe: - tcpSocket: + httpGet: port: http + path: / volumeMounts: - name: netbox-config-files mountPath: /etc/netbox-nginx/nginx.conf diff --git a/charts/netbox/templates/nginx-config.yaml b/charts/netbox/templates/nginx-config.yaml index 4907b2c..5b7a8cd 100644 --- a/charts/netbox/templates/nginx-config.yaml +++ b/charts/netbox/templates/nginx-config.yaml @@ -38,6 +38,10 @@ data: server_tokens off; client_max_body_size 10M; + upstream netbox { + server unix:/tmp/netbox/gunicorn.sock fail_timeout=0; + } + server { listen 8080; access_log off; @@ -47,7 +51,7 @@ data: } location / { - proxy_pass unix:/tmp/netbox/gunicorn.sock; + 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; diff --git a/charts/netbox/templates/service-api.yaml b/charts/netbox/templates/service-api.yaml deleted file mode 100644 index cd87b12..0000000 --- a/charts/netbox/templates/service-api.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "netbox.fullname" . }}-api - labels: - app.kubernetes.io/name: {{ include "netbox.name" . }} - helm.sh/chart: {{ include "netbox.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - com.digitalocean.netbox/component: api -spec: - type: ClusterIP - ports: - - port: 8001 - targetPort: api - protocol: TCP - name: api - selector: - app.kubernetes.io/name: {{ include "netbox.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - com.digitalocean.netbox/component: api diff --git a/charts/netbox/templates/service-front.yaml b/charts/netbox/templates/service.yaml similarity index 93% rename from charts/netbox/templates/service-front.yaml rename to charts/netbox/templates/service.yaml index 3abaa09..b6f9ba5 100644 --- a/charts/netbox/templates/service-front.yaml +++ b/charts/netbox/templates/service.yaml @@ -18,4 +18,3 @@ spec: selector: app.kubernetes.io/name: {{ include "netbox.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} - com.digitalocean.netbox/component: front