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