Joey Armstrong | 0747509 | 2023-01-26 10:56:13 -0500 | [diff] [blame] | 1 | # Copyright 2019-2023 Open Networking Foundation (ONF) and the ONF Contributors |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [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. |
Rohan Agrawal | e2f4a1e | 2020-02-04 06:28:36 +0000 | [diff] [blame] | 14 | {{- $log_level := tpl .Values.adapter_open_olt.log_level . | upper }} |
Matteo Scandolo | e9a01f7 | 2020-05-05 09:33:59 -0700 | [diff] [blame] | 15 | --- |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 16 | apiVersion: apps/v1 |
| 17 | kind: Deployment |
| 18 | metadata: |
David Bainbridge | 2bdd430 | 2020-06-09 17:13:18 -0700 | [diff] [blame] | 19 | name: "{{ template "fullname" . }}" |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 20 | namespace: {{ .Release.Namespace }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 21 | {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "openolt_deployment_labels") }} |
| 22 | labels: |
| 23 | {{- if hasKey .Values "extra_deployment_labels" }} |
| 24 | {{- range $key, $val := .Values.extra_deployment_labels }} |
| 25 | {{ $key }}: {{ $val | quote }} |
| 26 | {{- end }} |
| 27 | {{- end }} |
| 28 | {{- if hasKey .Values "openolt_deployment_labels" }} |
| 29 | {{- range $key, $val := .Values.openolt_deployment_labels }} |
| 30 | {{ $key }}: {{ $val | quote }} |
| 31 | {{- end }} |
| 32 | {{- end }} |
| 33 | {{- end }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 34 | spec: |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 35 | selector: |
| 36 | matchLabels: |
| 37 | app: adapter-open-olt |
David Bainbridge | 8595b3b | 2020-06-05 12:23:05 -0700 | [diff] [blame] | 38 | release: {{ .Release.Name }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 39 | template: |
| 40 | metadata: |
David Bainbridge | 8595b3b | 2020-06-05 12:23:05 -0700 | [diff] [blame] | 41 | namespace: {{ .Release.Namespace }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 42 | labels: |
| 43 | app: adapter-open-olt |
David Bainbridge | 8595b3b | 2020-06-05 12:23:05 -0700 | [diff] [blame] | 44 | release: {{ .Release.Name }} |
David Bainbridge | 1f88804 | 2019-06-24 18:02:01 +0000 | [diff] [blame] | 45 | app.kubernetes.io/name: "adapter-open-olt" |
| 46 | app.kubernetes.io/version: {{ quote .Chart.AppVersion }} |
| 47 | app.kubernetes.io/component: "adapter" |
| 48 | app.kubernetes.io/part-of: "voltha" |
Matteo Scandolo | b4c5f4e | 2020-11-11 12:05:23 -0800 | [diff] [blame] | 49 | app.kubernetes.io/stack: "{{ .Values.global.stack_name }}" |
David Bainbridge | 1f88804 | 2019-06-24 18:02:01 +0000 | [diff] [blame] | 50 | app.kubernetes.io/managed-by: {{ quote .Release.Service }} |
| 51 | helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 52 | {{- if hasKey .Values "extra_pod_labels" }} |
| 53 | {{- range $key, $val := .Values.extra_pod_labels }} |
| 54 | {{ $key }}: {{ $val | quote }} |
| 55 | {{- end }} |
| 56 | {{- end }} |
| 57 | {{- if hasKey .Values "openolt_pod_labels" }} |
| 58 | {{- range $key, $val := .Values.openolt_pod_labels }} |
| 59 | {{ $key }}: {{ $val | quote }} |
| 60 | {{- end }} |
| 61 | {{- end }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 62 | spec: |
David Bainbridge | 8595b3b | 2020-06-05 12:23:05 -0700 | [diff] [blame] | 63 | {{- if .Values.securityContext.enabled }} |
| 64 | securityContext: |
| 65 | runAsUser: {{ .Values.securityContext.runAsUser }} |
| 66 | runAsGroup: {{ .Values.securityContext.runAsGroup }} |
| 67 | fsGroup: {{ .Values.securityContext.fsGroup }} |
| 68 | {{- end }} |
Girish Gowdra | 1223151 | 2020-06-29 13:00:48 -0700 | [diff] [blame] | 69 | affinity: |
Andrey Pozolotin | da75c92 | 2021-08-24 17:41:08 +0200 | [diff] [blame] | 70 | {{- if .Values.nodeAffinityConfig.enabled }} |
Girish Gowdra | 1223151 | 2020-06-29 13:00:48 -0700 | [diff] [blame] | 71 | nodeAffinity: |
| 72 | requiredDuringSchedulingIgnoredDuringExecution: |
| 73 | nodeSelectorTerms: |
| 74 | - matchExpressions: |
| 75 | - key: "{{ .Values.nodeAffinityConfig.node_label_key }}" |
| 76 | operator: In |
| 77 | values: |
| 78 | - "{{ .Values.nodeAffinityConfig.node_label_value }}" |
Andrey Pozolotin | da75c92 | 2021-08-24 17:41:08 +0200 | [diff] [blame] | 79 | {{- end }} |
| 80 | podAffinity: |
| 81 | preferredDuringSchedulingIgnoredDuringExecution: |
| 82 | {{- if .Values.scheduleRules.preferStackPodsOnSameNode }} |
| 83 | - podAffinityTerm: |
| 84 | topologyKey: kubernetes.io/hostname |
| 85 | labelSelector: |
| 86 | matchExpressions: |
| 87 | - key: app.kubernetes.io/stack |
| 88 | operator: In |
| 89 | values: |
| 90 | - {{ .Values.global.stack_name }} |
| 91 | weight: 100 |
| 92 | {{- end }} |
| 93 | podAntiAffinity: |
| 94 | preferredDuringSchedulingIgnoredDuringExecution: |
| 95 | {{- if .Values.scheduleRules.preferStacksOnDifferentNodes }} |
| 96 | - podAffinityTerm: |
| 97 | topologyKey: kubernetes.io/hostname |
| 98 | labelSelector: |
| 99 | matchExpressions: |
| 100 | - key: app.kubernetes.io/name |
| 101 | operator: In |
| 102 | values: |
| 103 | - adapter-open-olt |
| 104 | weight: 100 |
| 105 | {{- end }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 106 | containers: |
| 107 | - name: adapter-open-olt |
David Bainbridge | 03706e6 | 2019-10-18 17:59:24 +0000 | [diff] [blame] | 108 | image: '{{ tpl .Values.images.adapter_open_olt.registry . }}{{ tpl .Values.images.adapter_open_olt.repository . }}:{{ tpl ( tpl .Values.images.adapter_open_olt.tag . ) . }}' |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 109 | imagePullPolicy: {{ tpl .Values.images.adapter_open_olt.pullPolicy . }} |
David Bainbridge | 8595b3b | 2020-06-05 12:23:05 -0700 | [diff] [blame] | 110 | env: |
divyadesai | 423be07 | 2020-02-20 12:05:01 +0000 | [diff] [blame] | 111 | - name: COMPONENT_NAME |
| 112 | valueFrom: |
| 113 | fieldRef: |
| 114 | fieldPath: metadata.labels['app.kubernetes.io/name'] |
serkant.uluderya | f1b8cc7 | 2020-05-13 23:26:51 -0700 | [diff] [blame] | 115 | - name: KV_STORE_DATAPATH_PREFIX |
Matteo Scandolo | b4c5f4e | 2020-11-11 12:05:23 -0800 | [diff] [blame] | 116 | value: {{ tpl .Values.adapter_open_olt.kv_store_data_prefix . }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 117 | args: |
David Bainbridge | 6a43d8d | 2019-06-18 19:09:09 +0000 | [diff] [blame] | 118 | - "/app/openolt" |
khenaidoo | 15c53fb | 2021-08-09 13:56:27 -0400 | [diff] [blame] | 119 | - "--core_endpoint={{ tpl .Values.global.core_endpoint . }}" |
| 120 | - "--adapter_endpoint={{ tpl .Values.adapter_open_olt.endpoints.address . }}.{{ .Release.Namespace }}.svc:{{ print .Values.adapter_open_olt.endpoints.port }}" |
Matteo Scandolo | b4c5f4e | 2020-11-11 12:05:23 -0800 | [diff] [blame] | 121 | - "--kafka_cluster_address={{ tpl .Values.services.kafka.cluster.address . }}" |
Matteo Scandolo | 06ee58c | 2021-05-26 15:28:51 -0700 | [diff] [blame] | 122 | - "--event_topic={{ .Values.adapter_open_olt.topics.event_topic }}" |
Matteo Scandolo | b4c5f4e | 2020-11-11 12:05:23 -0800 | [diff] [blame] | 123 | - "--kv_store_address={{ tpl .Values.services.etcd.address . }}" |
Andrea Campanella | 6838a80 | 2020-11-19 15:50:23 +0100 | [diff] [blame] | 124 | - "--kv_store_request_timeout={{ tpl .Values.adapter_open_olt.kv_store_timeout . }}" |
Girish Gowdra | e8c44bd | 2021-03-17 10:30:44 -0700 | [diff] [blame] | 125 | - "--heartbeat_check_interval={{ tpl .Values.adapter_open_olt.heartbeat_check_interval . }}" |
| 126 | - "--heartbeat_fail_interval={{ tpl .Values.adapter_open_olt.heartbeat_fail_interval . }}" |
khenaidoo | 15c53fb | 2021-08-09 13:56:27 -0400 | [diff] [blame] | 127 | - "--rpc_timeout={{ tpl .Values.adapter_open_olt.rpc_timeout . }}" |
Matteo Scandolo | c250ddd | 2019-12-12 13:34:27 -0800 | [diff] [blame] | 128 | - "--log_level={{ $log_level }}" |
serkant.uluderya | f1b8cc7 | 2020-05-13 23:26:51 -0700 | [diff] [blame] | 129 | - "--current_replica={{ .Values.replicas.current_replica }}" |
| 130 | - "--total_replica={{ .Values.replicas.total_replica }}" |
Neha Sharma | 7d3d6be | 2020-05-14 20:02:17 +0000 | [diff] [blame] | 131 | - "--probe_address=:8080" |
Matteo Scandolo | b4c5f4e | 2020-11-11 12:05:23 -0800 | [diff] [blame] | 132 | - "--trace_enabled={{ .Values.global.tracing.enabled }}" |
| 133 | - "--trace_agent_address={{ tpl .Values.services.tracing_agent.address . }}" |
| 134 | - "--log_correlation_enabled={{ .Values.global.log_correlation.enabled }}" |
| 135 | - "--omcc_encryption={{ .Values.global.omcc_encryption }}" |
Gamze Abaka | ba10c7b | 2020-12-17 14:37:25 +0000 | [diff] [blame] | 136 | - "--enable_onu_stats={{ .Values.global.enable_onu_stats }}" |
| 137 | - "--enable_gem_stats={{ .Values.global.enable_gem_stats }}" |
Abhilash Laxmeshwar | 81d18fc | 2022-06-24 19:26:06 +0530 | [diff] [blame] | 138 | - "--check_onu_exist_on_discovery={{ tpl .Values.adapter_open_olt.check_onu_exist_on_discovery . }}" |
nikesh.krishnan | e95b52f | 2023-03-14 11:17:48 +0530 | [diff] [blame] | 139 | - "--max_grpc_client_retry={{ tpl .Values.adapter_open_olt.rpc_retry . }}" |
| 140 | - "--per_rpc_retry_timeout={{ tpl .Values.adapter_open_olt.per_rpc_retry_timeout . }}" |
David Bainbridge | 2bdd430 | 2020-06-09 17:13:18 -0700 | [diff] [blame] | 141 | {{- if .Values.securityContext.enabled }} |
| 142 | securityContext: |
| 143 | allowPrivilegeEscalation: false |
| 144 | {{- end }} |
khenaidoo | 15c53fb | 2021-08-09 13:56:27 -0400 | [diff] [blame] | 145 | ports: |
| 146 | - containerPort: {{ .Values.adapter_open_olt.endpoints.port }} |
| 147 | name: grpc |
Rohan Agrawal | 6930356 | 2019-10-22 12:24:58 +0000 | [diff] [blame] | 148 | livenessProbe: |
| 149 | httpGet: |
| 150 | path: /healthz |
| 151 | port: 8080 |
khenaidoo | 15c53fb | 2021-08-09 13:56:27 -0400 | [diff] [blame] | 152 | initialDelaySeconds: {{ .Values.probe.liveness.initial_delay_seconds }} |
| 153 | periodSeconds: {{ .Values.probe.liveness.period_seconds }} |
Rohan Agrawal | 6930356 | 2019-10-22 12:24:58 +0000 | [diff] [blame] | 154 | readinessProbe: |
| 155 | httpGet: |
| 156 | path: /readz |
| 157 | port: 8080 |
khenaidoo | 15c53fb | 2021-08-09 13:56:27 -0400 | [diff] [blame] | 158 | initialDelaySeconds: {{ .Values.probe.readiness.initial_delay_seconds }} |
| 159 | periodSeconds: {{ .Values.probe.readiness.period_seconds }} |
Andrey Pozolotin | 7e928a9 | 2021-08-13 12:37:24 +0200 | [diff] [blame] | 160 | resources: |
| 161 | requests: |
| 162 | {{- if .Values.resources.requests.memory }} |
| 163 | memory: {{ .Values.resources.requests.memory }} |
| 164 | {{- end }} |
| 165 | {{- if .Values.resources.requests.cpu }} |
| 166 | cpu: {{ .Values.resources.requests.cpu }} |
| 167 | {{- end }} |
| 168 | limits: |
| 169 | {{- if .Values.resources.limits.memory }} |
| 170 | memory: {{ .Values.resources.limits.memory }} |
| 171 | {{- end }} |
| 172 | {{- if .Values.resources.limits.cpu }} |
| 173 | cpu: {{ .Values.resources.limits.cpu }} |
| 174 | {{- end }} |