David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [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 | 250ec82 | 2020-01-14 12:16:18 +0000 | [diff] [blame] | 14 | {{- $log_level := tpl .Values.rw_core.log_level . | upper }} |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 15 | --- |
| 16 | apiVersion: v1 |
| 17 | kind: Service |
| 18 | metadata: |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 19 | name: voltha-api |
| 20 | serviceAccountName: {{ .Values.serviceaccount }} |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 21 | spec: |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 22 | serviceAccountName: {{ .Values.serviceaccount }} |
| 23 | ports: |
| 24 | - name: grpc |
| 25 | port: 55555 |
| 26 | targetPort: 50057 |
| 27 | selector: |
| 28 | app: rw-core |
| 29 | --- |
| 30 | apiVersion: v1 |
| 31 | kind: Service |
| 32 | metadata: |
| 33 | name: voltha-rw-core |
| 34 | serviceAccountName: {{ .Values.serviceaccount }} |
| 35 | spec: |
| 36 | serviceAccountName: {{ .Values.serviceaccount }} |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 37 | clusterIP: None |
| 38 | ports: |
| 39 | - name: grpc |
| 40 | port: 50057 |
| 41 | targetPort: 50057 |
| 42 | selector: |
| 43 | app: rw-core |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 44 | --- |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 45 | apiVersion: apps/v1beta1 |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 46 | kind: Deployment |
| 47 | metadata: |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 48 | name: voltha-rw-core |
| 49 | serviceAccountName: {{ .Values.serviceaccount }} |
| 50 | {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "rw_core_deployment_labels") }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 51 | labels: |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 52 | {{- if hasKey .Values "extra_deployment_labels" }} |
| 53 | {{- range $key, $val := .Values.extra_deployment_labels }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 54 | {{ $key }}: {{ $val | quote }} |
| 55 | {{- end }} |
| 56 | {{- end }} |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 57 | {{- if hasKey .Values "rw_core_deployment_labels" }} |
| 58 | {{- range $key, $val := .Values.rw_core_deployment_labels }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 59 | {{ $key }}: {{ $val | quote }} |
| 60 | {{- end }} |
| 61 | {{- end }} |
| 62 | {{- end }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 63 | spec: |
| 64 | replicas: 1 |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 65 | template: |
| 66 | metadata: |
| 67 | labels: |
| 68 | app: rw-core |
David Bainbridge | 1f88804 | 2019-06-24 18:02:01 +0000 | [diff] [blame] | 69 | app.kubernetes.io/name: "read-write-core" |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 70 | app.kubernetes.io/version: {{ quote .Chart.AppVersion }} |
David Bainbridge | 1f88804 | 2019-06-24 18:02:01 +0000 | [diff] [blame] | 71 | app.kubernetes.io/component: "core" |
| 72 | app.kubernetes.io/part-of: "voltha" |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 73 | app.kubernetes.io/managed-by: {{ quote .Release.Service }} |
| 74 | helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
| 75 | {{- if hasKey .Values "extra_pod_labels" }} |
| 76 | {{- range $key, $val := .Values.extra_pod_labels }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 77 | {{ $key }}: {{ $val | quote }} |
| 78 | {{- end }} |
| 79 | {{- end }} |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 80 | {{- if hasKey .Values "rw_core_pod_labels" }} |
| 81 | {{- range $key, $val := .Values.rw_core_pod_labels }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 82 | {{ $key }}: {{ $val | quote }} |
| 83 | {{- end }} |
| 84 | {{- end }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 85 | annotations: |
| 86 | cni: "calico" |
| 87 | spec: |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 88 | serviceAccountName: {{ .Values.serviceaccount }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 89 | containers: |
| 90 | - name: voltha |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 91 | image: '{{ tpl .Values.images.rw_core.registry . }}{{ tpl .Values.images.rw_core.repository . }}:{{ tpl .Values.images.rw_core.tag . }}' |
| 92 | imagePullPolicy: {{ tpl .Values.images.rw_core.pullPolicy . }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 93 | env: |
| 94 | - name: NAMESPACE |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 95 | value: voltha |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 96 | - name: POD_IP |
| 97 | valueFrom: |
| 98 | fieldRef: |
| 99 | fieldPath: status.podIP |
divyadesai | 5085aba | 2020-03-02 07:03:53 +0000 | [diff] [blame] | 100 | - name: COMPONENT_NAME |
| 101 | valueFrom: |
| 102 | fieldRef: |
| 103 | fieldPath: metadata.labels['app.kubernetes.io/name'] |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 104 | args: |
| 105 | - "/app/rw_core" |
| 106 | - "-kv_store_type=etcd" |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 107 | - "-kv_store_host={{ .Values.services.etcd.service }}" |
| 108 | - "-kv_store_port={{ .Values.services.etcd.port }}" |
| 109 | - "-grpc_host=0.0.0.0" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 110 | - "-grpc_port=50057" |
| 111 | - "-banner=true" |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 112 | - "-kafka_adapter_host={{ .Values.services.kafka.adapter.service }}" |
| 113 | - "-kafka_adapter_port={{ .Values.services.kafka.adapter.port }}" |
David Bainbridge | 18f4f5d | 2020-04-06 18:13:38 -0700 | [diff] [blame] | 114 | - "-kafka_cluster_host={{ .Values.services.kafka.cluster.service }}" |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 115 | - "-kafka_cluster_port={{ .Values.services.kafka.cluster.port }}" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 116 | - "-rw_core_topic=rwcore" |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 117 | - "-core_pair_topic=core-pair-1" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 118 | - "-kv_store_data_prefix=service/voltha" |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 119 | - "-in_competing_mode=false" |
| 120 | - "-core_timeout=9999" |
| 121 | - "-timeout_long_request=9999" |
| 122 | - "-timeout_request=9999" |
David Bainbridge | 50cb1ef | 2019-07-23 22:36:17 +0000 | [diff] [blame] | 123 | - "-log_level={{ $log_level }}" |
David Bainbridge | c349f64 | 2019-09-24 19:20:47 +0000 | [diff] [blame] | 124 | - "-probe_port=8080" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 125 | ports: |
| 126 | - containerPort: 50057 |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 127 | name: grpc |
David Bainbridge | c349f64 | 2019-09-24 19:20:47 +0000 | [diff] [blame] | 128 | livenessProbe: |
| 129 | httpGet: |
| 130 | path: /healthz |
| 131 | port: 8080 |
| 132 | initialDelaySeconds: 3 |
| 133 | periodSeconds: 3 |
| 134 | readinessProbe: |
| 135 | httpGet: |
| 136 | path: /readz |
| 137 | port: 8080 |
| 138 | initialDelaySeconds: 3 |
| 139 | periodSeconds: 3 |
Scott Baker | 5b2eaa8 | 2019-12-17 11:24:00 -0800 | [diff] [blame] | 140 | |