blob: 0d1210a12f041e09204b1dd5fa1f06479a69e677 [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:
David Bainbridge2bdd4302020-06-09 17:13:18 -070019 name: "{{ template "fullname" . }}-rw-core"
David Bainbridge8595b3b2020-06-05 12:23:05 -070020 namespace: {{ .Release.Namespace }}
Scott Baker5b2eaa82019-12-17 11:24:00 -080021 {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "rw_core_deployment_labels") }}
David Bainbridge534a73d2019-08-30 18:57:23 +000022 labels:
Scott Baker5b2eaa82019-12-17 11:24:00 -080023 {{- if hasKey .Values "extra_deployment_labels" }}
24 {{- range $key, $val := .Values.extra_deployment_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000025 {{ $key }}: {{ $val | quote }}
26 {{- end }}
27 {{- end }}
Scott Baker5b2eaa82019-12-17 11:24:00 -080028 {{- if hasKey .Values "rw_core_deployment_labels" }}
29 {{- range $key, $val := .Values.rw_core_deployment_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000030 {{ $key }}: {{ $val | quote }}
31 {{- end }}
32 {{- end }}
33 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070034spec:
35 replicas: 1
David Bainbridge8595b3b2020-06-05 12:23:05 -070036 selector:
37 matchLabels:
38 app: rw-core
39 release: {{ .Release.Name }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070040 template:
41 metadata:
David Bainbridge8595b3b2020-06-05 12:23:05 -070042 namespace: {{ .Release.Namespace }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070043 labels:
44 app: rw-core
David Bainbridge8595b3b2020-06-05 12:23:05 -070045 release: {{ .Release.Name }}
David Bainbridge1f888042019-06-24 18:02:01 +000046 app.kubernetes.io/name: "read-write-core"
Scott Baker5b2eaa82019-12-17 11:24:00 -080047 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
David Bainbridge1f888042019-06-24 18:02:01 +000048 app.kubernetes.io/component: "core"
49 app.kubernetes.io/part-of: "voltha"
Scott Baker5b2eaa82019-12-17 11:24:00 -080050 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
51 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
52 {{- if hasKey .Values "extra_pod_labels" }}
53 {{- range $key, $val := .Values.extra_pod_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000054 {{ $key }}: {{ $val | quote }}
55 {{- end }}
56 {{- end }}
Scott Baker5b2eaa82019-12-17 11:24:00 -080057 {{- if hasKey .Values "rw_core_pod_labels" }}
58 {{- range $key, $val := .Values.rw_core_pod_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000059 {{ $key }}: {{ $val | quote }}
60 {{- end }}
61 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070062 spec:
David Bainbridge16b19cc2020-05-29 11:50:44 -070063 {{- if .Values.securityContext.enabled }}
64 securityContext:
65 runAsUser: {{ .Values.securityContext.runAsUser }}
66 runAsGroup: {{ .Values.securityContext.runAsGroup }}
67 fsGroup: {{ .Values.securityContext.fsGroup }}
68 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070069 containers:
70 - name: voltha
Scott Baker5b2eaa82019-12-17 11:24:00 -080071 image: '{{ tpl .Values.images.rw_core.registry . }}{{ tpl .Values.images.rw_core.repository . }}:{{ tpl .Values.images.rw_core.tag . }}'
72 imagePullPolicy: {{ tpl .Values.images.rw_core.pullPolicy . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070073 env:
74 - name: NAMESPACE
Scott Baker5b2eaa82019-12-17 11:24:00 -080075 value: voltha
David Bainbridge2f9b76f2019-05-15 13:48:11 -070076 - name: POD_IP
77 valueFrom:
78 fieldRef:
79 fieldPath: status.podIP
divyadesai5085aba2020-03-02 07:03:53 +000080 - name: COMPONENT_NAME
81 valueFrom:
82 fieldRef:
83 fieldPath: metadata.labels['app.kubernetes.io/name']
serkant.uluderyaf1b8cc72020-05-13 23:26:51 -070084 - name: KV_STORE_DATAPATH_PREFIX
85 value: {{ .Values.defaults.kv_store_data_prefix }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070086 args:
87 - "/app/rw_core"
88 - "-kv_store_type=etcd"
Scott Baker5b2eaa82019-12-17 11:24:00 -080089 - "-kv_store_host={{ .Values.services.etcd.service }}"
90 - "-kv_store_port={{ .Values.services.etcd.port }}"
91 - "-grpc_host=0.0.0.0"
David Bainbridge2f9b76f2019-05-15 13:48:11 -070092 - "-grpc_port=50057"
93 - "-banner=true"
Scott Baker5b2eaa82019-12-17 11:24:00 -080094 - "-kafka_adapter_host={{ .Values.services.kafka.adapter.service }}"
95 - "-kafka_adapter_port={{ .Values.services.kafka.adapter.port }}"
David Bainbridge18f4f5d2020-04-06 18:13:38 -070096 - "-kafka_cluster_host={{ .Values.services.kafka.cluster.service }}"
Scott Baker5b2eaa82019-12-17 11:24:00 -080097 - "-kafka_cluster_port={{ .Values.services.kafka.cluster.port }}"
serkant.uluderyaf1b8cc72020-05-13 23:26:51 -070098 - "-rw_core_topic={{ .Values.defaults.topics.core_topic }}"
Scott Baker5b2eaa82019-12-17 11:24:00 -080099 - "-in_competing_mode=false"
Matteo Scandolo41e9c132020-06-04 15:11:02 -0700100 - "-core_timeout={{ tpl .Values.rw_core.core_timeout . }}"
101 - "-timeout_long_request={{ tpl .Values.rw_core.timeout_long_request . }}"
102 - "-timeout_request={{ tpl .Values.rw_core.timeout_request . }}"
David Bainbridge50cb1ef2019-07-23 22:36:17 +0000103 - "-log_level={{ $log_level }}"
David Bainbridgec349f642019-09-24 19:20:47 +0000104 - "-probe_port=8080"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700105 ports:
106 - containerPort: 50057
Scott Baker5b2eaa82019-12-17 11:24:00 -0800107 name: grpc
David Bainbridge16b19cc2020-05-29 11:50:44 -0700108 {{- if .Values.securityContext.enabled }}
109 securityContext:
110 allowPrivilegeEscalation: false
111 {{- end }}
David Bainbridgec349f642019-09-24 19:20:47 +0000112 livenessProbe:
113 httpGet:
114 path: /healthz
115 port: 8080
116 initialDelaySeconds: 3
117 periodSeconds: 3
118 readinessProbe:
119 httpGet:
120 path: /readz
121 port: 8080
122 initialDelaySeconds: 3
123 periodSeconds: 3