diff options
author | makefunstuff <[email protected]> | 2024-06-28 14:50:46 +0200 |
---|---|---|
committer | makefunstuff <[email protected]> | 2024-06-28 14:50:46 +0200 |
commit | 8c6eeb9045125aa3b0666deccc3815e78112ea16 (patch) | |
tree | c0f1453d1b093048391d7328376426270a43f6d4 /misc/nginx | |
parent | 5f14386dcdd3530c79a31678a1a3bf59e3ddb6ef (diff) | |
download | k3s-lab-8c6eeb9045125aa3b0666deccc3815e78112ea16.tar.gz |
though nginx works
Diffstat (limited to 'misc/nginx')
-rw-r--r-- | misc/nginx/Chart.yaml | 5 | ||||
-rw-r--r-- | misc/nginx/templates/deployment.yaml | 22 | ||||
-rw-r--r-- | misc/nginx/templates/ingress.yaml | 35 | ||||
-rw-r--r-- | misc/nginx/templates/service.yaml | 12 | ||||
-rw-r--r-- | misc/nginx/values.yaml | 25 |
5 files changed, 99 insertions, 0 deletions
diff --git a/misc/nginx/Chart.yaml b/misc/nginx/Chart.yaml new file mode 100644 index 0000000..bb4811c --- /dev/null +++ b/misc/nginx/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: nginx +version: 0.1.0 +description: A Helm chart for deploying Nginx + 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 + diff --git a/misc/nginx/values.yaml b/misc/nginx/values.yaml new file mode 100644 index 0000000..805b596 --- /dev/null +++ b/misc/nginx/values.yaml @@ -0,0 +1,25 @@ +replicaCount: 1 + +image: + repository: nginx + tag: latest + pullPolicy: IfNotPresent + +service: + type: LoadBalancer + port: 80 + +ingress: + enabled: true + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: websecure + cert-manager.io/cluster-issuer: letsencrypt-prod + hosts: + - host: nginx.topkek.cloud + paths: + - / + tls: + - hosts: + - nginx.topkek.cloud + secretName: nginx-tls + |