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: |
| 18 | name: "{{ .Chart.Name }}" |
| 19 | labels: |
| 20 | release: {{ .Release.Name }} |
| 21 | spec: |
| 22 | replicas: {{ .Values.replicaCount }} |
| 23 | selector: |
| 24 | matchLabels: |
| 25 | app: "{{ .Chart.Name }}" |
| 26 | template: |
| 27 | metadata: |
| 28 | labels: |
| 29 | app: "{{ .Chart.Name }}" |
| 30 | spec: |
abhayk | 9f58b11 | 2025-01-11 00:08:02 +0530 | [diff] [blame^] | 31 | {{- if .Values.securityContext.enabled }} |
| 32 | securityContext: |
| 33 | runAsUser: {{ .Values.securityContext.runAsUser }} |
| 34 | runAsGroup: {{ .Values.securityContext.runAsGroup }} |
| 35 | fsGroup: {{ .Values.securityContext.fsGroup }} |
| 36 | {{- end }} |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 37 | containers: |
abhay | 4a45cc8 | 2025-01-10 21:32:07 +0530 | [diff] [blame] | 38 | - args: |
| 39 | - "/app/voltha-go-controller" |
| 40 | env: |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 41 | - name: POD_IP |
| 42 | valueFrom: |
| 43 | fieldRef: |
| 44 | fieldPath: status.podIP |
| 45 | - name: NAMESPACE |
| 46 | valueFrom: |
| 47 | fieldRef: |
| 48 | fieldPath: metadata.namespace |
| 49 | - name: VOLTHA_HOST |
| 50 | value: "$(NAMESPACE)-voltha-api.$(NAMESPACE).svc.cluster.local" |
| 51 | - name: VOLTHA_PORT |
| 52 | value: "55555" |
| 53 | - name: KV_STORE_TYPE |
abhay | cd29506 | 2024-12-12 11:05:07 +0530 | [diff] [blame] | 54 | value: "{{ .Values.services.kvstore.type }}" |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 55 | - name: KV_STORE_HOST |
abhay | cd29506 | 2024-12-12 11:05:07 +0530 | [diff] [blame] | 56 | value: "{{ .Values.services.kvstore.address }}" |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 57 | - name: KV_STORE_PORT |
abhay | cd29506 | 2024-12-12 11:05:07 +0530 | [diff] [blame] | 58 | value: "{{ .Values.services.kvstore.port }}" |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 59 | - name: KAFKA_ADAPTER_HOST |
Akash Soni | a02e998 | 2022-12-09 10:11:41 +0530 | [diff] [blame] | 60 | value: "{{ tpl .Values.services.kafka.cluster.address . }}" |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 61 | - name: KAFKA_ADAPTER_PORT |
| 62 | value: "9092" |
| 63 | - name: LOG_LEVEL |
| 64 | value: .Values.global.log_level |
abhay | 4a45cc8 | 2025-01-10 21:32:07 +0530 | [diff] [blame] | 65 | - name: KV_STORE_TIMEOUT |
| 66 | value: "3000000000" |
| 67 | - name: DEVICE_SYNC_DURATION |
| 68 | value: "10" |
| 69 | - name: MAX_FLOW_RETRY_DURATION |
| 70 | value: "60" |
| 71 | - name: LIVE_PROBE_INTERVAL |
| 72 | value: "60" |
| 73 | - name: NOT_LIVE_PROBE_INTERVAL |
| 74 | value: "5" |
| 75 | name: voltha-go-controller |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 76 | image: '{{ tpl .Values.images.voltha_go_controller.registry . }}{{ tpl .Values.images.voltha_go_controller.repository . }}:{{ tpl ( tpl .Values.images.voltha_go_controller.tag . ) . }}' |
| 77 | imagePullPolicy: {{ tpl .Values.images.voltha_go_controller.pullPolicy . }} |
abhayk | 9f58b11 | 2025-01-11 00:08:02 +0530 | [diff] [blame^] | 78 | {{- if .Values.securityContext.enabled }} |
abhay | 4a45cc8 | 2025-01-10 21:32:07 +0530 | [diff] [blame] | 79 | securityContext: |
abhayk | 9f58b11 | 2025-01-11 00:08:02 +0530 | [diff] [blame^] | 80 | allowPrivilegeEscalation: false |
| 81 | {{- end }} |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 82 | ports: |
| 83 | - containerPort: {{ .Values.voltha_go_controller.sshPort }} |
| 84 | name: ssh-port |
| 85 | - containerPort: {{ .Values.voltha_go_controller.uiPort }} |
| 86 | name: ui-port |
| 87 | protocol: "{{ .Values.voltha_go_controller.uiProtocol }}" |
abhay | 4a45cc8 | 2025-01-10 21:32:07 +0530 | [diff] [blame] | 88 | livenessProbe: |
| 89 | httpGet: |
| 90 | path: /healthz |
| 91 | port: 8090 |
| 92 | initialDelaySeconds: {{ .Values.probe.liveness.initial_delay_seconds }} |
| 93 | periodSeconds: {{ .Values.probe.liveness.period_seconds }} |
| 94 | readinessProbe: |
| 95 | httpGet: |
| 96 | path: /readz |
| 97 | port: 8090 |
| 98 | initialDelaySeconds: {{ .Values.probe.readiness.initial_delay_seconds }} |
| 99 | periodSeconds: {{ .Values.probe.readiness.period_seconds }} |
| 100 | resources: |
| 101 | requests: |
| 102 | {{- if .Values.resources.requests.memory }} |
| 103 | memory: {{ .Values.resources.requests.memory }} |
| 104 | {{- end }} |
| 105 | {{- if .Values.resources.requests.cpu }} |
| 106 | cpu: {{ .Values.resources.requests.cpu }} |
| 107 | {{- end }} |
| 108 | limits: |
| 109 | {{- if .Values.resources.limits.memory }} |
| 110 | memory: {{ .Values.resources.limits.memory }} |
| 111 | {{- end }} |
| 112 | {{- if .Values.resources.limits.cpu }} |
| 113 | cpu: {{ .Values.resources.limits.cpu }} |
| 114 | {{- end }} |
Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame] | 115 | restartPolicy: "Always" |