blob: 3dfb9226b9f8f643d490a7afa47d3a8ef214b04e [file] [log] [blame]
David Bainbridge2f9b76f2019-05-15 13:48:11 -07001# 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 Agrawal250ec822020-01-14 12:16:18 +000014{{- $log_level := tpl .Values.rw_core.log_level . | upper }}
Kent Hagerman1b333b92019-07-22 16:57:20 -040015---
Scott Baker5b2eaa82019-12-17 11:24:00 -080016apiVersion: apps/v1beta1
David Bainbridge2f9b76f2019-05-15 13:48:11 -070017kind: Deployment
18metadata:
Scott Baker5b2eaa82019-12-17 11:24:00 -080019 name: voltha-rw-core
Scott Baker5b2eaa82019-12-17 11:24:00 -080020 {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "rw_core_deployment_labels") }}
David Bainbridge534a73d2019-08-30 18:57:23 +000021 labels:
Scott Baker5b2eaa82019-12-17 11:24:00 -080022 {{- if hasKey .Values "extra_deployment_labels" }}
23 {{- range $key, $val := .Values.extra_deployment_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000024 {{ $key }}: {{ $val | quote }}
25 {{- end }}
26 {{- end }}
Scott Baker5b2eaa82019-12-17 11:24:00 -080027 {{- if hasKey .Values "rw_core_deployment_labels" }}
28 {{- range $key, $val := .Values.rw_core_deployment_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000029 {{ $key }}: {{ $val | quote }}
30 {{- end }}
31 {{- end }}
32 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070033spec:
34 replicas: 1
David Bainbridge2f9b76f2019-05-15 13:48:11 -070035 template:
36 metadata:
37 labels:
38 app: rw-core
David Bainbridge1f888042019-06-24 18:02:01 +000039 app.kubernetes.io/name: "read-write-core"
Scott Baker5b2eaa82019-12-17 11:24:00 -080040 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
David Bainbridge1f888042019-06-24 18:02:01 +000041 app.kubernetes.io/component: "core"
42 app.kubernetes.io/part-of: "voltha"
Scott Baker5b2eaa82019-12-17 11:24:00 -080043 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
44 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
45 {{- if hasKey .Values "extra_pod_labels" }}
46 {{- range $key, $val := .Values.extra_pod_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000047 {{ $key }}: {{ $val | quote }}
48 {{- end }}
49 {{- end }}
Scott Baker5b2eaa82019-12-17 11:24:00 -080050 {{- if hasKey .Values "rw_core_pod_labels" }}
51 {{- range $key, $val := .Values.rw_core_pod_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000052 {{ $key }}: {{ $val | quote }}
53 {{- end }}
54 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070055 spec:
David Bainbridge16b19cc2020-05-29 11:50:44 -070056 {{- if .Values.securityContext.enabled }}
57 securityContext:
58 runAsUser: {{ .Values.securityContext.runAsUser }}
59 runAsGroup: {{ .Values.securityContext.runAsGroup }}
60 fsGroup: {{ .Values.securityContext.fsGroup }}
61 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070062 containers:
63 - name: voltha
Scott Baker5b2eaa82019-12-17 11:24:00 -080064 image: '{{ tpl .Values.images.rw_core.registry . }}{{ tpl .Values.images.rw_core.repository . }}:{{ tpl .Values.images.rw_core.tag . }}'
65 imagePullPolicy: {{ tpl .Values.images.rw_core.pullPolicy . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070066 env:
67 - name: NAMESPACE
Scott Baker5b2eaa82019-12-17 11:24:00 -080068 value: voltha
David Bainbridge2f9b76f2019-05-15 13:48:11 -070069 - name: POD_IP
70 valueFrom:
71 fieldRef:
72 fieldPath: status.podIP
divyadesai5085aba2020-03-02 07:03:53 +000073 - name: COMPONENT_NAME
74 valueFrom:
75 fieldRef:
76 fieldPath: metadata.labels['app.kubernetes.io/name']
serkant.uluderyaf1b8cc72020-05-13 23:26:51 -070077 - name: KV_STORE_DATAPATH_PREFIX
78 value: {{ .Values.defaults.kv_store_data_prefix }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070079 args:
80 - "/app/rw_core"
81 - "-kv_store_type=etcd"
Scott Baker5b2eaa82019-12-17 11:24:00 -080082 - "-kv_store_host={{ .Values.services.etcd.service }}"
83 - "-kv_store_port={{ .Values.services.etcd.port }}"
84 - "-grpc_host=0.0.0.0"
David Bainbridge2f9b76f2019-05-15 13:48:11 -070085 - "-grpc_port=50057"
86 - "-banner=true"
Scott Baker5b2eaa82019-12-17 11:24:00 -080087 - "-kafka_adapter_host={{ .Values.services.kafka.adapter.service }}"
88 - "-kafka_adapter_port={{ .Values.services.kafka.adapter.port }}"
David Bainbridge18f4f5d2020-04-06 18:13:38 -070089 - "-kafka_cluster_host={{ .Values.services.kafka.cluster.service }}"
Scott Baker5b2eaa82019-12-17 11:24:00 -080090 - "-kafka_cluster_port={{ .Values.services.kafka.cluster.port }}"
serkant.uluderyaf1b8cc72020-05-13 23:26:51 -070091 - "-rw_core_topic={{ .Values.defaults.topics.core_topic }}"
Scott Baker5b2eaa82019-12-17 11:24:00 -080092 - "-in_competing_mode=false"
Matteo Scandolo41e9c132020-06-04 15:11:02 -070093 - "-core_timeout={{ tpl .Values.rw_core.core_timeout . }}"
94 - "-timeout_long_request={{ tpl .Values.rw_core.timeout_long_request . }}"
95 - "-timeout_request={{ tpl .Values.rw_core.timeout_request . }}"
David Bainbridge50cb1ef2019-07-23 22:36:17 +000096 - "-log_level={{ $log_level }}"
David Bainbridgec349f642019-09-24 19:20:47 +000097 - "-probe_port=8080"
David Bainbridge2f9b76f2019-05-15 13:48:11 -070098 ports:
99 - containerPort: 50057
Scott Baker5b2eaa82019-12-17 11:24:00 -0800100 name: grpc
David Bainbridge16b19cc2020-05-29 11:50:44 -0700101 {{- if .Values.securityContext.enabled }}
102 securityContext:
103 allowPrivilegeEscalation: false
104 {{- end }}
David Bainbridgec349f642019-09-24 19:20:47 +0000105 livenessProbe:
106 httpGet:
107 path: /healthz
108 port: 8080
109 initialDelaySeconds: 3
110 periodSeconds: 3
111 readinessProbe:
112 httpGet:
113 path: /readz
114 port: 8080
115 initialDelaySeconds: 3
116 periodSeconds: 3