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 | --- |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 33 | apiVersion: v1 |
| 34 | kind: Service |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 35 | metadata: |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 36 | name: voltha-ro-core |
| 37 | spec: |
| 38 | ports: |
| 39 | - name: grpc |
| 40 | port: 50057 |
| 41 | clusterIP: None |
| 42 | selector: |
| 43 | app: ro-core |
| 44 | |
| 45 | --- |
| 46 | apiVersion: apps/v1 |
| 47 | kind: StatefulSet |
| 48 | metadata: |
| 49 | name: voltha-ro-core |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 50 | serviceAccountName: {{ .Values.serviceaccount }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 51 | {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "ro_core_deployment_labels") }} |
| 52 | labels: |
| 53 | {{- if hasKey .Values "extra_deployment_labels" }} |
| 54 | {{- range $key, $val := .Values.extra_deployment_labels }} |
| 55 | {{ $key }}: {{ $val | quote }} |
| 56 | {{- end }} |
| 57 | {{- end }} |
| 58 | {{- if hasKey .Values "ro_core_deployment_labels" }} |
| 59 | {{- range $key, $val := .Values.ro_core_deployment_labels }} |
| 60 | {{ $key }}: {{ $val | quote }} |
| 61 | {{- end }} |
| 62 | {{- end }} |
| 63 | {{- end }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 64 | spec: |
| 65 | replicas: {{ .Values.replicas.ro_core }} |
| 66 | selector: |
| 67 | matchLabels: |
| 68 | app: ro-core |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 69 | serviceName: voltha-ro-core |
| 70 | podManagementPolicy: Parallel |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 71 | template: |
| 72 | metadata: |
| 73 | labels: |
| 74 | app: ro-core |
David Bainbridge | 1f88804 | 2019-06-24 18:02:01 +0000 | [diff] [blame] | 75 | app.kubernetes.io/name: "read-only-core" |
| 76 | app.kubernetes.io/version: {{ quote .Chart.AppVersion }} |
| 77 | app.kubernetes.io/component: "core" |
| 78 | app.kubernetes.io/part-of: "voltha" |
| 79 | app.kubernetes.io/managed-by: {{ quote .Release.Service }} |
| 80 | helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 81 | {{- if hasKey .Values "extra_pod_labels" }} |
| 82 | {{- range $key, $val := .Values.extra_pod_labels }} |
| 83 | {{ $key }}: {{ $val | quote }} |
| 84 | {{- end }} |
| 85 | {{- end }} |
| 86 | {{- if hasKey .Values "ro_core_pod_labels" }} |
| 87 | {{- range $key, $val := .Values.ro_core_pod_labels }} |
| 88 | {{ $key }}: {{ $val | quote }} |
| 89 | {{- end }} |
| 90 | {{- end }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 91 | annotations: |
| 92 | cni: "calico" |
| 93 | spec: |
| 94 | affinity: |
| 95 | podAntiAffinity: |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 96 | requiredDuringSchedulingIgnoredDuringExecution: |
| 97 | - topologyKey: "kubernetes.io/hostname" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 98 | labelSelector: |
| 99 | matchExpressions: |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 100 | - key: app |
| 101 | operator: In |
| 102 | values: |
| 103 | - ro-core |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 104 | serviceAccountName: {{ .Values.serviceaccount }} |
| 105 | containers: |
| 106 | - name: voltha |
David Bainbridge | 5cb5d17 | 2019-07-24 02:30:19 +0000 | [diff] [blame] | 107 | 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] | 108 | imagePullPolicy: {{ tpl .Values.images.ro_core.pullPolicy . }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 109 | env: |
| 110 | - name: NAMESPACE |
| 111 | value: {{ quote .Release.Namespace }} |
| 112 | - name: POD_IP |
| 113 | valueFrom: |
| 114 | fieldRef: |
| 115 | fieldPath: status.podIP |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 116 | args: |
| 117 | - "/app/ro_core" |
| 118 | - "-kv_store_type=etcd" |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 119 | - "-kv_store_host={{ .Values.services.etcd.service }}" |
| 120 | - "-kv_store_port={{ .Values.services.etcd.port }}" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 121 | - "-grpc_host=$(POD_IP)" |
| 122 | - "-grpc_port=50057" |
| 123 | - "-banner=true" |
| 124 | - "-ro_core_topic=rocore" |
David Bainbridge | 50cb1ef | 2019-07-23 22:36:17 +0000 | [diff] [blame] | 125 | - "-log_level={{ $log_level }}" |
Hardik Windlass | 0794798 | 2019-09-30 08:41:23 +0000 | [diff] [blame] | 126 | - "-probe_port=8080" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 127 | ports: |
| 128 | - containerPort: 50057 |
| 129 | name: grpc-port |
Hardik Windlass | 0794798 | 2019-09-30 08:41:23 +0000 | [diff] [blame] | 130 | livenessProbe: |
| 131 | httpGet: |
| 132 | path: /healthz |
| 133 | port: 8080 |
| 134 | initialDelaySeconds: 10 |
| 135 | periodSeconds: 5 |
| 136 | readinessProbe: |
| 137 | httpGet: |
| 138 | path: /readz |
| 139 | port: 8080 |
| 140 | initialDelaySeconds: 10 |
| 141 | periodSeconds: 5 |