From d4ff97f69c09f7d5c3e6b44f6af4b5ea06c6b9b0 Mon Sep 17 00:00:00 2001 From: pieter Date: Sun, 15 Feb 2026 08:07:49 +0000 Subject: [PATCH] =?UTF-8?q?templates/deployment.yaml=20=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/deployment.yaml | 79 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 templates/deployment.yaml diff --git a/templates/deployment.yaml b/templates/deployment.yaml new file mode 100644 index 0000000..3b50775 --- /dev/null +++ b/templates/deployment.yaml @@ -0,0 +1,79 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "nginx-redirect.fullname" . }} + labels: + {{- include "nginx-redirect.labels" . | nindent 4 }} + {{- with .Values.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "nginx-redirect.selectorLabels" . | nindent 6 }} + template: + metadata: + annotations: + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + {{- with .Values.annotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "nginx-redirect.selectorLabels" . | nindent 8 }} + spec: + securityContext: + runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }} + runAsUser: {{ .Values.securityContext.runAsUser }} + runAsGroup: {{ .Values.securityContext.runAsGroup }} + fsGroup: {{ .Values.securityContext.fsGroup }} + seccompProfile: + type: {{ .Values.securityContext.seccompProfile.type }} + containers: + - name: nginx + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 8080 + protocol: TCP + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 10 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 10 }} + resources: + {{- toYaml .Values.resources | nindent 10 }} + securityContext: + allowPrivilegeEscalation: {{ .Values.securityContext.allowPrivilegeEscalation }} + capabilities: + drop: + {{- range .Values.securityContext.capabilities.drop }} + - {{ . }} + {{- end }} + readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFilesystem }} + volumeMounts: + - name: nginx-config + mountPath: /etc/nginx/nginx.conf + subPath: nginx.conf + readOnly: true + - name: cache + mountPath: /var/cache/nginx + - name: run + mountPath: /var/run + - name: tmp + mountPath: /tmp + volumes: + - name: nginx-config + configMap: + name: {{ include "nginx-redirect.fullname" . }} + - name: cache + emptyDir: {} + - name: run + emptyDir: {} + - name: tmp + emptyDir: {} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} \ No newline at end of file