|
1 | 1 | apiVersion: apps/v1 |
2 | 2 | kind: Deployment |
3 | 3 | metadata: |
4 | | - name: {{ include "common.names.fullname" . }} |
| 4 | + name: {{ include "opa.fullname" . }} |
5 | 5 | labels: |
6 | | - {{- include "common.labels.standard" . | nindent 4 }} |
| 6 | + {{- include "opa.labels" . | nindent 4 }} |
7 | 7 | spec: |
8 | 8 | {{- if not .Values.autoscaling.enabled }} |
9 | 9 | replicas: {{ .Values.replicaCount }} |
10 | 10 | {{- end }} |
11 | 11 | selector: |
12 | 12 | matchLabels: |
13 | | - {{- include "common.labels.matchLabels" . | nindent 6 }} |
| 13 | + {{- include "opa.selectorLabels" . | nindent 6 }} |
14 | 14 | template: |
15 | 15 | metadata: |
| 16 | + {{- with .Values.podAnnotations }} |
16 | 17 | annotations: |
17 | 18 | checksum/config: {{ include (print $.Template.BasePath "/opa-config.yaml") . | sha256sum }} |
18 | | - {{- with .Values.podAnnotations }} |
19 | | - {{- toYaml . | nindent 8 }} |
20 | | - {{- end }} |
| 19 | + {{- toYaml . | nindent 8 }} |
| 20 | + {{- end }} |
21 | 21 | labels: |
22 | | - {{- include "common.labels.matchLabels" . | nindent 8 }} |
| 22 | + {{- include "opa.labels" . | nindent 8 }} |
| 23 | + {{- with .Values.podLabels }} |
| 24 | + {{- toYaml . | nindent 8 }} |
| 25 | + {{- end }} |
23 | 26 | spec: |
24 | 27 | {{- with .Values.imagePullSecrets }} |
25 | 28 | imagePullSecrets: |
26 | 29 | {{- toYaml . | nindent 8 }} |
27 | 30 | {{- end }} |
28 | | - {{- if .Values.serviceAccount.create }} |
29 | | - serviceAccountName: {{ default (include "common.names.fullname" .) .Values.serviceAccount.name }} |
30 | | - {{- else }} |
31 | | - serviceAccountName: {{ default "default" .Values.serviceAccount.name }} |
32 | | - {{- end }} |
| 31 | + serviceAccountName: {{ include "opa.serviceAccountName" . }} |
| 32 | + {{- with .Values.podSecurityContext }} |
33 | 33 | securityContext: |
34 | | - {{- toYaml .Values.podSecurityContext | nindent 8 }} |
| 34 | + {{- toYaml . | nindent 8 }} |
| 35 | + {{- end }} |
35 | 36 | containers: |
36 | | - - name: opa |
| 37 | + - name: {{ .Chart.Name }} |
| 38 | + {{- with .Values.securityContext }} |
37 | 39 | securityContext: |
38 | | - {{- toYaml .Values.securityContext | nindent 12 }} |
39 | | - image: "{{ .Values.image.repository }}:{{ include "opa.imageTag" . }}" |
| 40 | + {{- toYaml . | nindent 12 }} |
| 41 | + {{- end }} |
| 42 | + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" |
40 | 43 | imagePullPolicy: {{ .Values.image.pullPolicy }} |
41 | 44 | args: |
42 | 45 | - run |
43 | 46 | - --server |
44 | 47 | - --diagnostic-addr |
45 | 48 | - 0.0.0.0:8282 |
| 49 | + - --addr |
| 50 | + - 0.0.0.0:8181 |
46 | 51 | - --config-file |
47 | 52 | - /etc/opa-config/config.yaml |
48 | 53 | - --log-level |
49 | | - - {{ .Values.logLevel }} |
50 | | - {{- if .Values.envOverride }} |
51 | | - env: |
52 | | - {{- .Values.envOverride | toYaml | nindent 12 }} |
53 | | - {{- else if or .Values.orgData.bundlerSecret .Values.extraEnv }} |
54 | | - env: |
55 | | - {{- if and .Values.orgData.enabled .Values.orgData.bundlerSecret }} |
56 | | - - name: BUNDLER_BEARER_TOKEN |
57 | | - valueFrom: |
58 | | - secretKeyRef: |
59 | | - name: {{ tpl .Values.orgData.bundlerSecret.name . }} |
60 | | - key: {{ .Values.orgData.bundlerSecret.key }} |
61 | | - {{- end -}} |
62 | | - {{- if .Values.orgPolicy.enabled }} |
63 | | - {{- with .Values.orgPolicy.issuer }} |
64 | | - - name: ISSUER |
65 | | - value: {{ . }} |
66 | | - {{- end }} |
67 | | - {{- end }} |
68 | | - {{- if .Values.extraEnv }} |
69 | | - {{- .Values.extraEnv | toYaml | nindent 12 }} |
70 | | - {{- end }} |
71 | | - {{- end }} |
72 | | - volumeMounts: |
73 | | - - name: opa-config |
74 | | - mountPath: /etc/opa-config |
| 54 | + - {{ default "info" .Values.logLevel }} |
75 | 55 | ports: |
76 | | - - name: query |
77 | | - containerPort: {{ include "opa.queryPort" . }} |
| 56 | + - name: http |
| 57 | + containerPort: {{ .Values.service.port }} |
78 | 58 | protocol: TCP |
79 | 59 | - name: diagnostic |
80 | 60 | containerPort: 8282 |
81 | 61 | protocol: TCP |
| 62 | + {{- with .Values.livenessProbe }} |
82 | 63 | livenessProbe: |
83 | | - httpGet: |
84 | | - path: /health |
85 | | - port: diagnostic |
| 64 | + {{- toYaml . | nindent 12 }} |
| 65 | + {{- end }} |
| 66 | + {{- with .Values.readinessProbe }} |
86 | 67 | readinessProbe: |
87 | | - httpGet: |
88 | | - path: /health |
89 | | - port: diagnostic |
| 68 | + {{- toYaml . | nindent 12 }} |
| 69 | + {{- end }} |
| 70 | + {{- with .Values.resources }} |
90 | 71 | resources: |
91 | | - {{- toYaml .Values.resources | nindent 12 }} |
| 72 | + {{- toYaml . | nindent 12 }} |
| 73 | + {{- end }} |
| 74 | + volumeMounts: |
| 75 | + - name: opa-config |
| 76 | + mountPath: /etc/opa-config |
| 77 | + {{- with .Values.volumeMounts }} |
| 78 | + {{- toYaml . | nindent 12 }} |
| 79 | + {{- end }} |
| 80 | + env: |
| 81 | + {{- toYaml .Values.extraEnvVars | nindent 12 }} |
92 | 82 | volumes: |
93 | 83 | - name: opa-config |
94 | 84 | configMap: |
95 | | - name: opa-config |
| 85 | + name: opa-config |
| 86 | + {{- with .Values.volumes }} |
| 87 | + {{- toYaml . | nindent 8 }} |
| 88 | + {{- end }} |
96 | 89 | {{- with .Values.nodeSelector }} |
97 | 90 | nodeSelector: |
98 | 91 | {{- toYaml . | nindent 8 }} |
|
0 commit comments