blob: 3dcb518a1f175499f2f802e695dc76366abfa166 [file] [log] [blame]
David Bainbridgee5887072019-11-14 23:01:01 +00001# 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.
14{{- if .Values.therecanbeonlyone }}
15---
16apiVersion: v1
17kind: Service
18metadata:
19 name: voltha-api
20 serviceAccountName: {{ .Values.serviceaccount }}
21spec:
22 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 }}
37 clusterIP: None
38 ports:
39 - name: grpc
40 port: 50057
41 targetPort: 50057
42 selector:
43 app: rw-core
44---
45apiVersion: apps/v1beta1
46kind: Deployment
47metadata:
48 name: voltha-rw-core
49 serviceAccountName: {{ .Values.serviceaccount }}
50 {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "rw_core_deployment_labels") }}
51 labels:
52 {{- if hasKey .Values "extra_deployment_labels" }}
53 {{- range $key, $val := .Values.extra_deployment_labels }}
54 {{ $key }}: {{ $val | quote }}
55 {{- end }}
56 {{- end }}
57 {{- if hasKey .Values "rw_core_deployment_labels" }}
58 {{- range $key, $val := .Values.rw_core_deployment_labels }}
59 {{ $key }}: {{ $val | quote }}
60 {{- end }}
61 {{- end }}
62 {{- end }}
63spec:
64 replicas: 1
65 template:
66 metadata:
67 labels:
68 app: rw-core
69 app.kubernetes.io/name: "read-write-core"
70 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
71 app.kubernetes.io/component: "core"
72 app.kubernetes.io/part-of: "voltha"
73 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 }}
77 {{ $key }}: {{ $val | quote }}
78 {{- end }}
79 {{- end }}
80 {{- if hasKey .Values "rw_core_pod_labels" }}
81 {{- range $key, $val := .Values.rw_core_pod_labels }}
82 {{ $key }}: {{ $val | quote }}
83 {{- end }}
84 {{- end }}
85 annotations:
86 cni: "calico"
87 spec:
88 serviceAccountName: {{ .Values.serviceaccount }}
89 containers:
90 - name: voltha
91 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 . }}
93 env:
94 - name: NAMESPACE
95 value: voltha
96 - name: POD_IP
97 valueFrom:
98 fieldRef:
99 fieldPath: status.podIP
100 args:
101 - "/app/rw_core"
102 - "-kv_store_type=etcd"
103 - "-kv_store_host={{ .Values.services.etcd.service }}"
104 - "-kv_store_port={{ .Values.services.etcd.port }}"
105 - "-grpc_host=0.0.0.0"
106 - "-grpc_port=50057"
107 - "-banner=true"
108 - "-kafka_adapter_host={{ .Values.services.kafka.adapter.service }}"
109 - "-kafka_adapter_port={{ .Values.services.kafka.adapter.port }}"
110 - "-kafka_cluster_host={{ .Values.services.kafka.cluster.port }}"
111 - "-kafka_cluster_port={{ .Values.services.kafka.cluster.port }}"
112 - "-rw_core_topic=rwcore"
113 - "-core_pair_topic=core-pair-1"
114 - "-kv_store_data_prefix=service/voltha"
115 - "-in_competing_mode=false"
116 - "-core_timeout=9999"
117 - "-timeout_long_request=9999"
118 - "-timeout_request=9999"
119 - "-probe_port=8080"
120 ports:
121 - containerPort: 50057
122 name: grpc
123 livenessProbe:
124 httpGet:
125 path: /healthz
126 port: 8080
127 initialDelaySeconds: 3
128 periodSeconds: 3
129 readinessProbe:
130 httpGet:
131 path: /readz
132 port: 8080
133 initialDelaySeconds: 3
134 periodSeconds: 3
135{{- end }}