David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 1 | # Copyright 2019-present Open Networking Foundation |
| 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 }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 15 | |
Matteo Scandolo | e9a01f7 | 2020-05-05 09:33:59 -0700 | [diff] [blame] | 16 | {{- if .Values.profiler.enabled }} |
| 17 | apiVersion: v1 |
| 18 | kind: Service |
| 19 | metadata: |
| 20 | name: adapter-open-olt-profiler |
| 21 | serviceAccountName: {{ .Values.serviceaccount }} |
| 22 | spec: |
| 23 | serviceAccountName: {{ .Values.serviceaccount }} |
| 24 | clusterIP: None |
| 25 | ports: |
| 26 | - name: profiler |
| 27 | port: 6060 |
| 28 | targetPort: 6060 |
| 29 | selector: |
| 30 | app: adapter-open-olt |
| 31 | --- |
| 32 | {{- end }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 33 | apiVersion: apps/v1 |
| 34 | kind: Deployment |
| 35 | metadata: |
| 36 | name: adapter-open-olt |
| 37 | namespace: {{ .Release.Namespace }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 38 | {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "openolt_deployment_labels") }} |
| 39 | labels: |
| 40 | {{- if hasKey .Values "extra_deployment_labels" }} |
| 41 | {{- range $key, $val := .Values.extra_deployment_labels }} |
| 42 | {{ $key }}: {{ $val | quote }} |
| 43 | {{- end }} |
| 44 | {{- end }} |
| 45 | {{- if hasKey .Values "openolt_deployment_labels" }} |
| 46 | {{- range $key, $val := .Values.openolt_deployment_labels }} |
| 47 | {{ $key }}: {{ $val | quote }} |
| 48 | {{- end }} |
| 49 | {{- end }} |
| 50 | {{- end }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 51 | spec: |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 52 | selector: |
| 53 | matchLabels: |
| 54 | app: adapter-open-olt |
| 55 | template: |
| 56 | metadata: |
| 57 | labels: |
| 58 | app: adapter-open-olt |
David Bainbridge | 1f88804 | 2019-06-24 18:02:01 +0000 | [diff] [blame] | 59 | app.kubernetes.io/name: "adapter-open-olt" |
| 60 | app.kubernetes.io/version: {{ quote .Chart.AppVersion }} |
| 61 | app.kubernetes.io/component: "adapter" |
| 62 | app.kubernetes.io/part-of: "voltha" |
| 63 | app.kubernetes.io/managed-by: {{ quote .Release.Service }} |
| 64 | helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 65 | {{- if hasKey .Values "extra_pod_labels" }} |
| 66 | {{- range $key, $val := .Values.extra_pod_labels }} |
| 67 | {{ $key }}: {{ $val | quote }} |
| 68 | {{- end }} |
| 69 | {{- end }} |
| 70 | {{- if hasKey .Values "openolt_pod_labels" }} |
| 71 | {{- range $key, $val := .Values.openolt_pod_labels }} |
| 72 | {{ $key }}: {{ $val | quote }} |
| 73 | {{- end }} |
| 74 | {{- end }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 75 | annotations: |
| 76 | cni: "calico" |
| 77 | spec: |
| 78 | containers: |
| 79 | - name: adapter-open-olt |
David Bainbridge | 03706e6 | 2019-10-18 17:59:24 +0000 | [diff] [blame] | 80 | 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] | 81 | imagePullPolicy: {{ tpl .Values.images.adapter_open_olt.pullPolicy . }} |
serkant.uluderya | f1b8cc7 | 2020-05-13 23:26:51 -0700 | [diff] [blame^] | 82 | env: |
divyadesai | 423be07 | 2020-02-20 12:05:01 +0000 | [diff] [blame] | 83 | - name: COMPONENT_NAME |
| 84 | valueFrom: |
| 85 | fieldRef: |
| 86 | fieldPath: metadata.labels['app.kubernetes.io/name'] |
serkant.uluderya | f1b8cc7 | 2020-05-13 23:26:51 -0700 | [diff] [blame^] | 87 | - name: KV_STORE_DATAPATH_PREFIX |
| 88 | value: {{ .Values.defaults.kv_store_data_prefix }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 89 | args: |
David Bainbridge | 6a43d8d | 2019-06-18 19:09:09 +0000 | [diff] [blame] | 90 | - "/app/openolt" |
| 91 | - "--kafka_adapter_host={{ .Values.services.kafka.adapter.service }}" |
| 92 | - "--kafka_adapter_port={{ .Values.services.kafka.adapter.port }}" |
| 93 | - "--kafka_cluster_host={{ .Values.services.kafka.cluster.service }}" |
| 94 | - "--kafka_cluster_port={{ .Values.services.kafka.cluster.port }}" |
serkant.uluderya | f1b8cc7 | 2020-05-13 23:26:51 -0700 | [diff] [blame^] | 95 | - "--core_topic={{ .Values.defaults.topics.core_topic }}" |
| 96 | - "--adapter_topic={{ .Values.defaults.topics.adapter_open_olt_topic }}" |
David Bainbridge | 6a43d8d | 2019-06-18 19:09:09 +0000 | [diff] [blame] | 97 | - "--kv_store_host={{ .Values.services.etcd.service }}" |
| 98 | - "--kv_store_port={{ .Values.services.etcd.port }}" |
Matteo Scandolo | c250ddd | 2019-12-12 13:34:27 -0800 | [diff] [blame] | 99 | - "--log_level={{ $log_level }}" |
serkant.uluderya | f1b8cc7 | 2020-05-13 23:26:51 -0700 | [diff] [blame^] | 100 | - "--current_replica={{ .Values.replicas.current_replica }}" |
| 101 | - "--total_replica={{ .Values.replicas.total_replica }}" |
Rohan Agrawal | 6930356 | 2019-10-22 12:24:58 +0000 | [diff] [blame] | 102 | - "--probe_port=8080" |
| 103 | livenessProbe: |
| 104 | httpGet: |
| 105 | path: /healthz |
| 106 | port: 8080 |
| 107 | initialDelaySeconds: 10 |
| 108 | periodSeconds: 5 |
| 109 | readinessProbe: |
| 110 | httpGet: |
| 111 | path: /readz |
| 112 | port: 8080 |
| 113 | initialDelaySeconds: 10 |
| 114 | periodSeconds: 5 |