Joey Armstrong | 6a104e9 | 2024-02-10 15:27:58 -0500 | [diff] [blame] | 1 | # Copyright 2019-2024 Open Networking Foundation (ONF) and the ONF Contributors |
Holger Hildebrandt | b67c330 | 2020-02-25 13:48:59 +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. |
| 14 | {{- $log_level := tpl .Values.adapter_open_onu.log_level . | upper }} |
David Bainbridge | 8595b3b | 2020-06-05 12:23:05 -0700 | [diff] [blame] | 15 | --- |
Holger Hildebrandt | b67c330 | 2020-02-25 13:48:59 +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" . }}" |
Holger Hildebrandt | b67c330 | 2020-02-25 13:48:59 +0000 | [diff] [blame] | 20 | namespace: {{ .Release.Namespace }} |
| 21 | {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "openonu_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 "openonu_deployment_labels" }} |
| 29 | {{- range $key, $val := .Values.openonu_deployment_labels }} |
| 30 | {{ $key }}: {{ $val | quote }} |
| 31 | {{- end }} |
| 32 | {{- end }} |
| 33 | {{- end }} |
| 34 | spec: |
| 35 | replicas: {{ .Values.replicas.adapter_open_onu }} |
| 36 | selector: |
| 37 | matchLabels: |
| 38 | app: adapter-open-onu |
David Bainbridge | 8595b3b | 2020-06-05 12:23:05 -0700 | [diff] [blame] | 39 | release: {{ .Release.Name }} |
Holger Hildebrandt | b67c330 | 2020-02-25 13:48:59 +0000 | [diff] [blame] | 40 | template: |
| 41 | metadata: |
David Bainbridge | 8595b3b | 2020-06-05 12:23:05 -0700 | [diff] [blame] | 42 | namespace: {{ .Release.Namespace }} |
Holger Hildebrandt | b67c330 | 2020-02-25 13:48:59 +0000 | [diff] [blame] | 43 | labels: |
| 44 | app: adapter-open-onu |
David Bainbridge | 8595b3b | 2020-06-05 12:23:05 -0700 | [diff] [blame] | 45 | release: {{ .Release.Name }} |
Holger Hildebrandt | b67c330 | 2020-02-25 13:48:59 +0000 | [diff] [blame] | 46 | app.kubernetes.io/name: "adapter-open-onu" |
| 47 | app.kubernetes.io/version: {{ quote .Chart.AppVersion }} |
| 48 | app.kubernetes.io/component: "adapter" |
| 49 | app.kubernetes.io/part-of: "voltha" |
Matteo Scandolo | b4c5f4e | 2020-11-11 12:05:23 -0800 | [diff] [blame] | 50 | app.kubernetes.io/stack: "{{ .Values.global.stack_name }}" |
Holger Hildebrandt | b67c330 | 2020-02-25 13:48:59 +0000 | [diff] [blame] | 51 | app.kubernetes.io/managed-by: {{ quote .Release.Service }} |
| 52 | helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
| 53 | {{- if hasKey .Values "extra_pod_labels" }} |
| 54 | {{- range $key, $val := .Values.extra_pod_labels }} |
| 55 | {{ $key }}: {{ $val | quote }} |
| 56 | {{- end }} |
| 57 | {{- end }} |
| 58 | {{- if hasKey .Values "openonu_pod_labels" }} |
| 59 | {{- range $key, $val := .Values.openonu_pod_labels }} |
| 60 | {{ $key }}: {{ $val | quote }} |
| 61 | {{- end }} |
| 62 | {{- end }} |
Holger Hildebrandt | b67c330 | 2020-02-25 13:48:59 +0000 | [diff] [blame] | 63 | spec: |
David Bainbridge | 8595b3b | 2020-06-05 12:23:05 -0700 | [diff] [blame] | 64 | {{- if .Values.securityContext.enabled }} |
| 65 | securityContext: |
| 66 | runAsUser: {{ .Values.securityContext.runAsUser }} |
| 67 | runAsGroup: {{ .Values.securityContext.runAsGroup }} |
| 68 | fsGroup: {{ .Values.securityContext.fsGroup }} |
| 69 | {{- end }} |
Holger Hildebrandt | b67c330 | 2020-02-25 13:48:59 +0000 | [diff] [blame] | 70 | containers: |
| 71 | - name: adapter-open-onu |
Matteo Scandolo | efcb439 | 2020-11-17 10:21:02 -0800 | [diff] [blame] | 72 | image: '{{ tpl .Values.images.adapter_open_onu_go.registry . }}{{ tpl .Values.images.adapter_open_onu_go.repository . }}:{{ tpl ( tpl .Values.images.adapter_open_onu_go.tag . ) . }}' |
Holger Hildebrandt | b67c330 | 2020-02-25 13:48:59 +0000 | [diff] [blame] | 73 | imagePullPolicy: {{ tpl .Values.images.adapter_open_onu_go.pullPolicy . }} |
Matteo Scandolo | 846f19c | 2020-04-24 16:39:17 -0700 | [diff] [blame] | 74 | env: |
| 75 | - name: COMPONENT_NAME |
| 76 | valueFrom: |
| 77 | fieldRef: |
| 78 | fieldPath: metadata.labels['app.kubernetes.io/name'] |
Matteo Scandolo | fcbb925 | 2020-11-19 12:19:02 -0800 | [diff] [blame] | 79 | - name: KV_STORE_DATAPATH_PREFIX |
Matteo Scandolo | b4c5f4e | 2020-11-11 12:05:23 -0800 | [diff] [blame] | 80 | value: {{ tpl .Values.adapter_open_onu.kv_store_data_prefix . }} |
Holger Hildebrandt | b67c330 | 2020-02-25 13:48:59 +0000 | [diff] [blame] | 81 | args: |
Matteo Scandolo | 4f6d59a | 2020-03-25 10:37:18 -0700 | [diff] [blame] | 82 | - "/app/openonu" |
Holger Hildebrandt | b67c330 | 2020-02-25 13:48:59 +0000 | [diff] [blame] | 83 | - "--banner=true" |
| 84 | - "--kafka_reconnect_retries=-1" |
khenaidoo | 15c53fb | 2021-08-09 13:56:27 -0400 | [diff] [blame] | 85 | - "--core_endpoint={{ tpl .Values.global.core_endpoint . }}" |
| 86 | - "--adapter_endpoint={{ tpl .Values.adapter_open_onu.endpoints.address . }}.{{ .Release.Namespace }}.svc:{{ print .Values.adapter_open_onu.endpoints.port }}" |
Matteo Scandolo | 1d80abd | 2021-01-28 11:30:12 -0800 | [diff] [blame] | 87 | - "--kafka_cluster_address={{ tpl .Values.services.kafka.cluster.address . }}" |
Matteo Scandolo | 06ee58c | 2021-05-26 15:28:51 -0700 | [diff] [blame] | 88 | - "--event_topic={{ .Values.adapter_open_onu.topics.event_topic }}" |
Matteo Scandolo | 1d80abd | 2021-01-28 11:30:12 -0800 | [diff] [blame] | 89 | - "--kv_store_address={{ tpl .Values.services.etcd.address . }}" |
Andrea Campanella | 6838a80 | 2020-11-19 15:50:23 +0100 | [diff] [blame] | 90 | - "--kv_store_request_timeout={{ tpl .Values.adapter_open_onu.kv_store_timeout . }}" |
Holger Hildebrandt | b67c330 | 2020-02-25 13:48:59 +0000 | [diff] [blame] | 91 | - "--log_level={{ $log_level }}" |
| 92 | - "--probe_port=8080" |
Girish Gowdra | 3152aca | 2020-11-19 15:57:58 -0800 | [diff] [blame] | 93 | - "--accept_incr_evto={{ tpl .Values.adapter_open_onu.incremental_evto_update . }}" |
Himani Chawla | 5a33c50 | 2020-09-25 13:08:33 +0530 | [diff] [blame] | 94 | - "--max_timeout_interadapter_comm={{ tpl .Values.adapter_open_onu.max_timeout_interadapter_comm . }}" |
Holger Hildebrandt | ade635b | 2021-02-18 16:28:39 +0000 | [diff] [blame] | 95 | - "--max_timeout_reconciling={{ tpl .Values.adapter_open_onu.max_timeout_reconciling . }}" |
Girish Gowdra | a453506 | 2021-03-09 13:21:58 -0800 | [diff] [blame] | 96 | - "--omci_timeout={{ tpl .Values.adapter_open_onu.omci_timeout . }}" |
khenaidoo | 15c53fb | 2021-08-09 13:56:27 -0400 | [diff] [blame] | 97 | - "--rpc_timeout={{ tpl .Values.adapter_open_onu.rpc_timeout . }}" |
Matteo Scandolo | b4c5f4e | 2020-11-11 12:05:23 -0800 | [diff] [blame] | 98 | - "--trace_enabled={{ .Values.global.tracing.enabled }}" |
| 99 | - "--trace_agent_address={{ tpl .Values.services.tracing_agent.address . }}" |
Matteo Scandolo | 0020f51 | 2021-02-12 15:04:38 -0800 | [diff] [blame] | 100 | - "--log_correlation_enabled={{ .Values.global.log_correlation.enabled }}" |
Andrea Campanella | aa46d3f | 2021-01-19 09:19:02 +0100 | [diff] [blame] | 101 | - "--allowed_onu_vendors={{ template "allowed_onu_vendors" . }}" |
Girish Gowdra | e05c018 | 2021-01-28 15:02:37 -0800 | [diff] [blame] | 102 | - "--metrics_enabled={{ .Values.global.metrics.enabled }}" |
Holger Hildebrandt | 80d1f0a | 2022-06-24 07:53:59 +0000 | [diff] [blame] | 103 | - "--extended_omci_support_enabled={{ .Values.global.extended_omci_support.enabled }}" |
Holger Hildebrandt | 29c63c9 | 2021-02-05 14:58:50 +0000 | [diff] [blame] | 104 | - "--mib_audit_interval={{ .Values.global.mib_audit.interval }}" |
Himani Chawla | e345491 | 2021-03-15 19:23:49 +0530 | [diff] [blame] | 105 | - "--alarm_audit_interval={{ .Values.global.alarm_audit.interval }}" |
Matteo Scandolo | 60b9c25 | 2021-06-10 17:21:08 +0200 | [diff] [blame] | 106 | - "--uni_port_mask={{ .Values.adapter_open_onu.uni_port_mask }}" |
Praneeth Kumar Nalmas | 5cd48d7 | 2024-04-17 10:37:40 +0530 | [diff] [blame^] | 107 | - "--skip_onu_config_enabled={{ .Values.global.skip_onu_config.enabled }}" |
David Bainbridge | 2bdd430 | 2020-06-09 17:13:18 -0700 | [diff] [blame] | 108 | {{- if .Values.securityContext.enabled }} |
| 109 | securityContext: |
| 110 | allowPrivilegeEscalation: false |
| 111 | {{- end }} |
khenaidoo | 15c53fb | 2021-08-09 13:56:27 -0400 | [diff] [blame] | 112 | ports: |
| 113 | - containerPort: {{ .Values.adapter_open_onu.endpoints.port }} |
| 114 | name: grpc |
Holger Hildebrandt | b67c330 | 2020-02-25 13:48:59 +0000 | [diff] [blame] | 115 | livenessProbe: |
| 116 | httpGet: |
| 117 | path: /healthz |
| 118 | port: 8080 |
khenaidoo | 15c53fb | 2021-08-09 13:56:27 -0400 | [diff] [blame] | 119 | initialDelaySeconds: {{ .Values.probe.liveness.initial_delay_seconds }} |
| 120 | periodSeconds: {{ .Values.probe.liveness.period_seconds }} |
Holger Hildebrandt | b67c330 | 2020-02-25 13:48:59 +0000 | [diff] [blame] | 121 | readinessProbe: |
| 122 | httpGet: |
| 123 | path: /readz |
| 124 | port: 8080 |
khenaidoo | 15c53fb | 2021-08-09 13:56:27 -0400 | [diff] [blame] | 125 | initialDelaySeconds: {{ .Values.probe.readiness.initial_delay_seconds }} |
| 126 | periodSeconds: {{ .Values.probe.readiness.period_seconds }} |
Andrey Pozolotin | 7e928a9 | 2021-08-13 12:37:24 +0200 | [diff] [blame] | 127 | resources: |
| 128 | requests: |
| 129 | {{- if .Values.resources.requests.memory }} |
| 130 | memory: {{ .Values.resources.requests.memory }} |
| 131 | {{- end }} |
| 132 | {{- if .Values.resources.requests.cpu }} |
| 133 | cpu: {{ .Values.resources.requests.cpu }} |
| 134 | {{- end }} |
| 135 | limits: |
| 136 | {{- if .Values.resources.limits.memory }} |
| 137 | memory: {{ .Values.resources.limits.memory }} |
| 138 | {{- end }} |
| 139 | {{- if .Values.resources.limits.cpu }} |
| 140 | cpu: {{ .Values.resources.limits.cpu }} |
| 141 | {{- end }} |
Andrey Pozolotin | da75c92 | 2021-08-24 17:41:08 +0200 | [diff] [blame] | 142 | affinity: |
| 143 | podAffinity: |
| 144 | preferredDuringSchedulingIgnoredDuringExecution: |
| 145 | {{- if .Values.scheduleRules.preferStackPodsOnSameNode }} |
| 146 | - podAffinityTerm: |
| 147 | topologyKey: kubernetes.io/hostname |
| 148 | labelSelector: |
| 149 | matchExpressions: |
| 150 | - key: app.kubernetes.io/stack |
| 151 | operator: In |
| 152 | values: |
| 153 | - {{ .Values.global.stack_name }} |
| 154 | weight: 100 |
| 155 | {{- end }} |
| 156 | podAntiAffinity: |
| 157 | preferredDuringSchedulingIgnoredDuringExecution: |
| 158 | {{- if .Values.scheduleRules.preferStacksOnDifferentNodes }} |
| 159 | - podAffinityTerm: |
| 160 | topologyKey: kubernetes.io/hostname |
| 161 | labelSelector: |
| 162 | matchExpressions: |
| 163 | - key: app.kubernetes.io/name |
| 164 | operator: In |
| 165 | values: |
| 166 | - adapter-open-onu |
| 167 | weight: 100 |
| 168 | {{- end }} |