| Sketch🕴️ | 6fffda2 | 2025-08-01 07:05:23 +0400 | [diff] [blame^] | 1 | apiVersion: v1 |
| 2 | kind: ConfigMap |
| 3 | metadata: |
| 4 | name: {{ .Values.name }} |
| 5 | namespace: {{ .Release.Namespace }} |
| 6 | data: |
| 7 | nginx.conf: | |
| 8 | {{ toYaml .Values.config | nindent 4 }} |
| 9 | --- |
| 10 | apiVersion: apps/v1 |
| 11 | kind: Deployment |
| 12 | metadata: |
| 13 | name: {{ .Values.name }} |
| 14 | namespace: {{ .Release.Namespace }} |
| 15 | spec: |
| 16 | selector: |
| 17 | matchLabels: |
| 18 | app: proxy |
| 19 | replicas: 1 |
| 20 | template: |
| 21 | metadata: |
| 22 | labels: |
| 23 | app: proxy |
| 24 | spec: |
| 25 | containers: |
| 26 | - name: proxy |
| 27 | image: {{ .Values.image.repository }}:{{ .Values.image.tag }} |
| 28 | imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 29 | ports: |
| 30 | {{- range .Values.ports }} |
| 31 | - name: {{ .name }} |
| 32 | containerPort: {{ .value }} |
| 33 | protocol: {{ .protocol }} |
| 34 | {{- end }} |
| 35 | volumeMounts: |
| 36 | - name: config |
| 37 | mountPath: /etc/nginx |
| 38 | volumes: |
| 39 | - name: config |
| 40 | configMap: |
| 41 | name: {{ .Values.name }} |
| 42 | --- |
| 43 | apiVersion: v1 |
| 44 | kind: Service |
| 45 | metadata: |
| 46 | name: {{ .Values.name }} |
| 47 | namespace: {{ .Release.Namespace }} |
| 48 | spec: |
| 49 | type: ClusterIP |
| 50 | selector: |
| 51 | app: proxy |
| 52 | ports: |
| 53 | {{- range .Values.ports }} |
| 54 | - name: {{ .name }} |
| 55 | port: {{ .value }} |
| 56 | targetPort: {{ .name }} |
| 57 | protocol: {{ .protocol }} |
| 58 | {{- end }} |