Skip to content

Commit

Permalink
Making Nginx optional (#32)
Browse files Browse the repository at this point in the history
* making nginx an optional component based on an enabled flag in config.yaml

Signed-off-by: Ken Haines <ken@kenhaines.net>

* updating ingress to only be enabled if nginx is, in addition to the previous check

Signed-off-by: Ken Haines <ken@kenhaines.net>
  • Loading branch information
khaines committed Jul 26, 2020
1 parent 5ab206d commit 965804d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.ingress.enabled -}}
{{- if and .Values.ingress.enabled .Values.nginx.enabled -}}
{{- $fullName := include "cortex.fullname" . -}}
{{- $svcPort := .Values.nginx.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
Expand Down
2 changes: 2 additions & 0 deletions templates/nginx-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.nginx.enabled }}
kind: ConfigMap
apiVersion: v1
metadata:
Expand Down Expand Up @@ -56,3 +57,4 @@ data:
}
}
}
{{- end}}
2 changes: 2 additions & 0 deletions templates/nginx-dep.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.nginx.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -96,3 +97,4 @@ spec:
{{- if .Values.nginx.extraVolumes }}
{{ toYaml .Values.nginx.extraVolumes | indent 8}}
{{- end }}
{{- end}}
2 changes: 2 additions & 0 deletions templates/nginx-svc.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.nginx.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -23,3 +24,4 @@ spec:
selector:
app: {{ template "cortex.name" . }}-nginx
release: {{ .Release.Name }}
{{- end }}
1 change: 1 addition & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@ configs:
env: []

nginx:
enabled: true
replicas: 2
http_listen_port: 80
config:
Expand Down

0 comments on commit 965804d

Please sign in to comment.