about summary refs log tree commit diff
path: root/misc/nginx/templates
diff options
context:
space:
mode:
Diffstat (limited to 'misc/nginx/templates')
-rw-r--r--misc/nginx/templates/deployment.yaml22
-rw-r--r--misc/nginx/templates/ingress.yaml35
-rw-r--r--misc/nginx/templates/service.yaml12
3 files changed, 69 insertions, 0 deletions
diff --git a/misc/nginx/templates/deployment.yaml b/misc/nginx/templates/deployment.yaml
new file mode 100644
index 0000000..4a8dc99
--- /dev/null
+++ b/misc/nginx/templates/deployment.yaml
@@ -0,0 +1,22 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: nginx
+  labels:
+    app: nginx
+spec:
+  replicas: {{ .Values.replicaCount }}
+  selector:
+    matchLabels:
+      app: nginx
+  template:
+    metadata:
+      labels:
+        app: nginx
+    spec:
+      containers:
+        - name: nginx
+          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
+          ports:
+            - containerPort: 80
+
diff --git a/misc/nginx/templates/ingress.yaml b/misc/nginx/templates/ingress.yaml
new file mode 100644
index 0000000..bd25f23
--- /dev/null
+++ b/misc/nginx/templates/ingress.yaml
@@ -0,0 +1,35 @@
+{{- if .Values.ingress.enabled -}}
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+  name: nginx
+  annotations:
+    {{- range $key, $value := .Values.ingress.annotations }}
+    {{ $key }}: {{ $value | quote }}
+    {{- end }}
+spec:
+  rules:
+    {{- range .Values.ingress.hosts }}
+    - host: {{ .host }}
+      http:
+        paths:
+          {{- range .paths }}
+          - path: {{ . }}
+            pathType: Prefix
+            backend:
+              service:
+                name: nginx
+                port:
+                  number: 80
+          {{- end }}
+    {{- end }}
+  tls:
+    {{- range .Values.ingress.tls }}
+    - hosts:
+        {{- range .hosts }}
+        - {{ . }}
+        {{- end }}
+      secretName: {{ .secretName }}
+    {{- end }}
+{{- end }}
+
diff --git a/misc/nginx/templates/service.yaml b/misc/nginx/templates/service.yaml
new file mode 100644
index 0000000..b4c4888
--- /dev/null
+++ b/misc/nginx/templates/service.yaml
@@ -0,0 +1,12 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: nginx
+spec:
+  type: {{ .Values.service.type }}
+  ports:
+    - port: {{ .Values.service.port }}
+      targetPort: 80
+  selector:
+    app: nginx
+