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. |
David Bainbridge | 50cb1ef | 2019-07-23 22:36:17 +0000 | [diff] [blame^] | 14 | {{- $set_log_level := tpl .Values.rw_core.log_level . | upper }} |
| 15 | {{- $log_level := 3 }} |
| 16 | {{- if eq $set_log_level "DEBUG" }} |
| 17 | {{- $log_level = 0 }} |
| 18 | {{- else if eq $set_log_level "INFO" }} |
| 19 | {{- $log_level = 1 }} |
| 20 | {{- else if eq $set_log_level "WARN" }} |
| 21 | {{- $log_level = 2 }} |
| 22 | {{- else if eq $set_log_level "ERROR" }} |
| 23 | {{- $log_level = 3 }} |
| 24 | {{- else if eq $set_log_level "PANIC" }} |
| 25 | {{- $log_level = 4 }} |
| 26 | {{- else if eq $set_log_level "FATAL" }} |
| 27 | {{- $log_level = 5 }} |
| 28 | {{- else }} |
| 29 | {{- $log_level = 3 }} |
| 30 | {{- end }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 31 | |
| 32 | --- |
| 33 | apiVersion: apps/v1 |
| 34 | kind: Deployment |
| 35 | metadata: |
| 36 | name: ro-core |
| 37 | serviceAccountName: {{ .Values.serviceaccount }} |
| 38 | spec: |
| 39 | replicas: {{ .Values.replicas.ro_core }} |
| 40 | selector: |
| 41 | matchLabels: |
| 42 | app: ro-core |
| 43 | template: |
| 44 | metadata: |
| 45 | labels: |
| 46 | app: ro-core |
David Bainbridge | 1f88804 | 2019-06-24 18:02:01 +0000 | [diff] [blame] | 47 | app.kubernetes.io/name: "read-only-core" |
| 48 | app.kubernetes.io/version: {{ quote .Chart.AppVersion }} |
| 49 | app.kubernetes.io/component: "core" |
| 50 | app.kubernetes.io/part-of: "voltha" |
| 51 | app.kubernetes.io/managed-by: {{ quote .Release.Service }} |
| 52 | helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 53 | annotations: |
| 54 | cni: "calico" |
| 55 | spec: |
| 56 | affinity: |
| 57 | podAntiAffinity: |
| 58 | preferredDuringSchedulingIgnoredDuringExecution: |
| 59 | - weight: 100 |
| 60 | podAffinityTerm: |
| 61 | labelSelector: |
| 62 | matchExpressions: |
| 63 | - key: app |
| 64 | operator: In |
| 65 | values: |
| 66 | - ro-core |
| 67 | topologyKey: "kubernetes.io/hostname" |
| 68 | serviceAccountName: {{ .Values.serviceaccount }} |
| 69 | containers: |
| 70 | - name: voltha |
David Bainbridge | 5cb5d17 | 2019-07-24 02:30:19 +0000 | [diff] [blame] | 71 | image: {{ tpl .Values.images.ro_core.registry . }}{{ tpl .Values.images.ro_core.repository . }}:{{ tpl ( tpl .Values.images.ro_core.tag . ) . }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 72 | imagePullPolicy: {{ tpl .Values.images.ro_core.pullPolicy . }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 73 | env: |
| 74 | - name: NAMESPACE |
| 75 | value: {{ quote .Release.Namespace }} |
| 76 | - name: POD_IP |
| 77 | valueFrom: |
| 78 | fieldRef: |
| 79 | fieldPath: status.podIP |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 80 | args: |
| 81 | - "/app/ro_core" |
| 82 | - "-kv_store_type=etcd" |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 83 | - "-kv_store_host={{ .Values.services.etcd.service }}" |
| 84 | - "-kv_store_port={{ .Values.services.etcd.port }}" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 85 | - "-grpc_host=$(POD_IP)" |
| 86 | - "-grpc_port=50057" |
| 87 | - "-banner=true" |
| 88 | - "-ro_core_topic=rocore" |
David Bainbridge | 50cb1ef | 2019-07-23 22:36:17 +0000 | [diff] [blame^] | 89 | - "-log_level={{ $log_level }}" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 90 | ports: |
| 91 | - containerPort: 50057 |
| 92 | name: grpc-port |