blob: fabeb3e4684517af8cd032220258f4f75309d1d0 [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---
16apiVersion: v1
17kind: Service
18metadata:
Scott Baker5b2eaa82019-12-17 11:24:00 -080019 name: voltha-api
20 serviceAccountName: {{ .Values.serviceaccount }}
Kent Hagerman1b333b92019-07-22 16:57:20 -040021spec:
Scott Baker5b2eaa82019-12-17 11:24:00 -080022 serviceAccountName: {{ .Values.serviceaccount }}
23 ports:
24 - name: grpc
25 port: 55555
26 targetPort: 50057
27 selector:
28 app: rw-core
29---
30apiVersion: v1
31kind: Service
32metadata:
33 name: voltha-rw-core
34 serviceAccountName: {{ .Values.serviceaccount }}
35spec:
36 serviceAccountName: {{ .Values.serviceaccount }}
Kent Hagerman1b333b92019-07-22 16:57:20 -040037 clusterIP: None
38 ports:
39 - name: grpc
40 port: 50057
41 targetPort: 50057
42 selector:
43 app: rw-core
David Bainbridge2f9b76f2019-05-15 13:48:11 -070044---
Scott Baker5b2eaa82019-12-17 11:24:00 -080045apiVersion: apps/v1beta1
David Bainbridge2f9b76f2019-05-15 13:48:11 -070046kind: Deployment
47metadata:
Scott Baker5b2eaa82019-12-17 11:24:00 -080048 name: voltha-rw-core
49 serviceAccountName: {{ .Values.serviceaccount }}
50 {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "rw_core_deployment_labels") }}
David Bainbridge534a73d2019-08-30 18:57:23 +000051 labels:
Scott Baker5b2eaa82019-12-17 11:24:00 -080052 {{- if hasKey .Values "extra_deployment_labels" }}
53 {{- range $key, $val := .Values.extra_deployment_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_deployment_labels" }}
58 {{- range $key, $val := .Values.rw_core_deployment_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000059 {{ $key }}: {{ $val | quote }}
60 {{- end }}
61 {{- end }}
62 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070063spec:
64 replicas: 1
David Bainbridge2f9b76f2019-05-15 13:48:11 -070065 template:
66 metadata:
67 labels:
68 app: rw-core
David Bainbridge1f888042019-06-24 18:02:01 +000069 app.kubernetes.io/name: "read-write-core"
Scott Baker5b2eaa82019-12-17 11:24:00 -080070 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
David Bainbridge1f888042019-06-24 18:02:01 +000071 app.kubernetes.io/component: "core"
72 app.kubernetes.io/part-of: "voltha"
Scott Baker5b2eaa82019-12-17 11:24:00 -080073 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
74 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
75 {{- if hasKey .Values "extra_pod_labels" }}
76 {{- range $key, $val := .Values.extra_pod_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000077 {{ $key }}: {{ $val | quote }}
78 {{- end }}
79 {{- end }}
Scott Baker5b2eaa82019-12-17 11:24:00 -080080 {{- if hasKey .Values "rw_core_pod_labels" }}
81 {{- range $key, $val := .Values.rw_core_pod_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000082 {{ $key }}: {{ $val | quote }}
83 {{- end }}
84 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070085 annotations:
86 cni: "calico"
87 spec:
Scott Baker5b2eaa82019-12-17 11:24:00 -080088 serviceAccountName: {{ .Values.serviceaccount }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070089 containers:
90 - name: voltha
Scott Baker5b2eaa82019-12-17 11:24:00 -080091 image: '{{ tpl .Values.images.rw_core.registry . }}{{ tpl .Values.images.rw_core.repository . }}:{{ tpl .Values.images.rw_core.tag . }}'
92 imagePullPolicy: {{ tpl .Values.images.rw_core.pullPolicy . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070093 env:
94 - name: NAMESPACE
Scott Baker5b2eaa82019-12-17 11:24:00 -080095 value: voltha
David Bainbridge2f9b76f2019-05-15 13:48:11 -070096 - name: POD_IP
97 valueFrom:
98 fieldRef:
99 fieldPath: status.podIP
divyadesai5085aba2020-03-02 07:03:53 +0000100 - name: COMPONENT_NAME
101 valueFrom:
102 fieldRef:
103 fieldPath: metadata.labels['app.kubernetes.io/name']
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700104 args:
105 - "/app/rw_core"
106 - "-kv_store_type=etcd"
Scott Baker5b2eaa82019-12-17 11:24:00 -0800107 - "-kv_store_host={{ .Values.services.etcd.service }}"
108 - "-kv_store_port={{ .Values.services.etcd.port }}"
109 - "-grpc_host=0.0.0.0"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700110 - "-grpc_port=50057"
111 - "-banner=true"
Scott Baker5b2eaa82019-12-17 11:24:00 -0800112 - "-kafka_adapter_host={{ .Values.services.kafka.adapter.service }}"
113 - "-kafka_adapter_port={{ .Values.services.kafka.adapter.port }}"
David Bainbridge18f4f5d2020-04-06 18:13:38 -0700114 - "-kafka_cluster_host={{ .Values.services.kafka.cluster.service }}"
Scott Baker5b2eaa82019-12-17 11:24:00 -0800115 - "-kafka_cluster_port={{ .Values.services.kafka.cluster.port }}"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700116 - "-rw_core_topic=rwcore"
Scott Baker5b2eaa82019-12-17 11:24:00 -0800117 - "-core_pair_topic=core-pair-1"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700118 - "-kv_store_data_prefix=service/voltha"
Scott Baker5b2eaa82019-12-17 11:24:00 -0800119 - "-in_competing_mode=false"
120 - "-core_timeout=9999"
121 - "-timeout_long_request=9999"
122 - "-timeout_request=9999"
David Bainbridge50cb1ef2019-07-23 22:36:17 +0000123 - "-log_level={{ $log_level }}"
David Bainbridgec349f642019-09-24 19:20:47 +0000124 - "-probe_port=8080"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700125 ports:
126 - containerPort: 50057
Scott Baker5b2eaa82019-12-17 11:24:00 -0800127 name: grpc
David Bainbridgec349f642019-09-24 19:20:47 +0000128 livenessProbe:
129 httpGet:
130 path: /healthz
131 port: 8080
132 initialDelaySeconds: 3
133 periodSeconds: 3
134 readinessProbe:
135 httpGet:
136 path: /readz
137 port: 8080
138 initialDelaySeconds: 3
139 periodSeconds: 3
Scott Baker5b2eaa82019-12-17 11:24:00 -0800140