Joey Armstrong | 084e447 | 2024-02-10 18:03:13 -0500 | [diff] [blame] | 1 | # Copyright 2022-2024 Open Networking Foundation (ONF) and the ONF Contributors |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | apiVersion: apps/v1 |
| 16 | kind: Deployment |
| 17 | metadata: |
abhayk | fee1b0d | 2025-01-13 19:57:04 +0530 | [diff] [blame] | 18 | name: "{{ template "fullname" . }}" |
abhayk | 0d1cf56 | 2025-01-11 13:59:15 +0530 | [diff] [blame] | 19 | namespace: "{{ .Release.Namespace }}" |
abhayk | fee1b0d | 2025-01-13 19:57:04 +0530 | [diff] [blame] | 20 | {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "vgc_deployment_labels") }} |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 21 | labels: |
abhayk | fee1b0d | 2025-01-13 19:57:04 +0530 | [diff] [blame] | 22 | {{- if hasKey .Values "extra_deployment_labels" }} |
| 23 | {{- range $key, $val := .Values.extra_deployment_labels }} |
| 24 | {{ $key }}: {{ $val | quote }} |
| 25 | {{- end }} |
| 26 | {{- end }} |
| 27 | {{- if hasKey .Values "vgc_deployment_labels" }} |
| 28 | {{- range $key, $val := .Values.vgc_deployment_labels }} |
| 29 | {{ $key }}: {{ $val | quote }} |
| 30 | {{- end }} |
| 31 | {{- end }} |
| 32 | {{- end }} |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 33 | spec: |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 34 | selector: |
| 35 | matchLabels: |
abhayk | fee1b0d | 2025-01-13 19:57:04 +0530 | [diff] [blame] | 36 | app: voltha-go-controller |
| 37 | release: {{ .Release.Name }} |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 38 | template: |
| 39 | metadata: |
| 40 | labels: |
abhayk | fee1b0d | 2025-01-13 19:57:04 +0530 | [diff] [blame] | 41 | app: voltha-go-controller |
| 42 | release: {{ .Release.Name }} |
| 43 | app.kubernetes.io/name: "voltha-go-controller" |
| 44 | app.kubernetes.io/version: {{ quote .Chart.AppVersion }} |
| 45 | app.kubernetes.io/component: "controller" |
| 46 | app.kubernetes.io/part-of: "voltha" |
| 47 | app.kubernetes.io/stack: "{{ .Values.global.stack_name }}" |
| 48 | app.kubernetes.io/managed-by: {{ quote .Release.Service }} |
| 49 | helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
| 50 | {{- if hasKey .Values "extra_pod_labels" }} |
| 51 | {{- range $key, $val := .Values.extra_pod_labels }} |
| 52 | {{ $key }}: {{ $val | quote }} |
| 53 | {{- end }} |
| 54 | {{- end }} |
| 55 | {{- if hasKey .Values "vgc_pod_labels" }} |
| 56 | {{- range $key, $val := .Values.vgc_pod_labels }} |
| 57 | {{ $key }}: {{ $val | quote }} |
| 58 | {{- end }} |
| 59 | {{- end }} |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 60 | spec: |
abhayk | 9f58b11 | 2025-01-11 00:08:02 +0530 | [diff] [blame] | 61 | {{- if .Values.securityContext.enabled }} |
| 62 | securityContext: |
| 63 | runAsUser: {{ .Values.securityContext.runAsUser }} |
| 64 | runAsGroup: {{ .Values.securityContext.runAsGroup }} |
| 65 | fsGroup: {{ .Values.securityContext.fsGroup }} |
| 66 | {{- end }} |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 67 | containers: |
abhay | 4a45cc8 | 2025-01-10 21:32:07 +0530 | [diff] [blame] | 68 | - args: |
| 69 | - "/app/voltha-go-controller" |
| 70 | env: |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 71 | - name: POD_IP |
| 72 | valueFrom: |
| 73 | fieldRef: |
| 74 | fieldPath: status.podIP |
| 75 | - name: NAMESPACE |
abhayk | 0d1cf56 | 2025-01-11 13:59:15 +0530 | [diff] [blame] | 76 | value: {{ .Release.Namespace }} |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 77 | - name: VOLTHA_HOST |
abhayk | 0d1cf56 | 2025-01-11 13:59:15 +0530 | [diff] [blame] | 78 | value: "{{ .Release.Namespace }}-voltha-api.{{ .Release.Namespace }}.svc.cluster.local" |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 79 | - name: VOLTHA_PORT |
| 80 | value: "55555" |
| 81 | - name: KV_STORE_TYPE |
abhayk | fee1b0d | 2025-01-13 19:57:04 +0530 | [diff] [blame] | 82 | value: "{{ tpl .Values.services.kvstore.type . }}" |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 83 | - name: KV_STORE_HOST |
abhayk | fee1b0d | 2025-01-13 19:57:04 +0530 | [diff] [blame] | 84 | value: "{{ tpl .Values.services.kvstore.address . }}" |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 85 | - name: KV_STORE_PORT |
abhayk | fee1b0d | 2025-01-13 19:57:04 +0530 | [diff] [blame] | 86 | value: "{{ tpl .Values.services.kvstore.port . }}" |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 87 | - name: KAFKA_ADAPTER_HOST |
Akash Soni | a02e998 | 2022-12-09 10:11:41 +0530 | [diff] [blame] | 88 | value: "{{ tpl .Values.services.kafka.cluster.address . }}" |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 89 | - name: KAFKA_ADAPTER_PORT |
| 90 | value: "9092" |
| 91 | - name: LOG_LEVEL |
abhayk | 0d1cf56 | 2025-01-11 13:59:15 +0530 | [diff] [blame] | 92 | value: "{{ .Values.global.log_level }}" |
abhay | 4a45cc8 | 2025-01-10 21:32:07 +0530 | [diff] [blame] | 93 | - name: KV_STORE_TIMEOUT |
| 94 | value: "3000000000" |
| 95 | - name: DEVICE_SYNC_DURATION |
| 96 | value: "10" |
| 97 | - name: MAX_FLOW_RETRY_DURATION |
| 98 | value: "60" |
| 99 | - name: LIVE_PROBE_INTERVAL |
| 100 | value: "60" |
| 101 | - name: NOT_LIVE_PROBE_INTERVAL |
| 102 | value: "5" |
| 103 | name: voltha-go-controller |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 104 | image: '{{ tpl .Values.images.voltha_go_controller.registry . }}{{ tpl .Values.images.voltha_go_controller.repository . }}:{{ tpl ( tpl .Values.images.voltha_go_controller.tag . ) . }}' |
| 105 | imagePullPolicy: {{ tpl .Values.images.voltha_go_controller.pullPolicy . }} |
abhayk | 9f58b11 | 2025-01-11 00:08:02 +0530 | [diff] [blame] | 106 | {{- if .Values.securityContext.enabled }} |
abhay | 4a45cc8 | 2025-01-10 21:32:07 +0530 | [diff] [blame] | 107 | securityContext: |
abhayk | 9f58b11 | 2025-01-11 00:08:02 +0530 | [diff] [blame] | 108 | allowPrivilegeEscalation: false |
| 109 | {{- end }} |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 110 | ports: |
| 111 | - containerPort: {{ .Values.voltha_go_controller.sshPort }} |
| 112 | name: ssh-port |
| 113 | - containerPort: {{ .Values.voltha_go_controller.uiPort }} |
| 114 | name: ui-port |
| 115 | protocol: "{{ .Values.voltha_go_controller.uiProtocol }}" |
abhay | 4a45cc8 | 2025-01-10 21:32:07 +0530 | [diff] [blame] | 116 | livenessProbe: |
| 117 | httpGet: |
| 118 | path: /healthz |
| 119 | port: 8090 |
| 120 | initialDelaySeconds: {{ .Values.probe.liveness.initial_delay_seconds }} |
| 121 | periodSeconds: {{ .Values.probe.liveness.period_seconds }} |
| 122 | readinessProbe: |
| 123 | httpGet: |
| 124 | path: /readz |
| 125 | port: 8090 |
| 126 | initialDelaySeconds: {{ .Values.probe.readiness.initial_delay_seconds }} |
| 127 | periodSeconds: {{ .Values.probe.readiness.period_seconds }} |
| 128 | resources: |
| 129 | requests: |
| 130 | {{- if .Values.resources.requests.memory }} |
| 131 | memory: {{ .Values.resources.requests.memory }} |
| 132 | {{- end }} |
| 133 | {{- if .Values.resources.requests.cpu }} |
| 134 | cpu: {{ .Values.resources.requests.cpu }} |
| 135 | {{- end }} |
| 136 | limits: |
| 137 | {{- if .Values.resources.limits.memory }} |
| 138 | memory: {{ .Values.resources.limits.memory }} |
| 139 | {{- end }} |
| 140 | {{- if .Values.resources.limits.cpu }} |
| 141 | cpu: {{ .Values.resources.limits.cpu }} |
| 142 | {{- end }} |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 143 | restartPolicy: "Always" |