blob: a4d5d7a2e2e3b5f26e637c43d0f3ed6f9c167915 [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.
David Bainbridgee5887072019-11-14 23:01:01 +000014{{- if not .Values.therecanbeonlyone }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070015---
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: 55555
27 selector:
28 app: voltha-api-server
29
30---
31apiVersion: apps/v1beta1
32kind: Deployment
33metadata:
34 name: voltha-api-server
35 serviceAccountName: {{ .Values.serviceaccount }}
David Bainbridge534a73d2019-08-30 18:57:23 +000036 {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "api_deployment_labels") }}
37 labels:
38 {{- if hasKey .Values "extra_deployment_labels" }}
39 {{- range $key, $val := .Values.extra_deployment_labels }}
40 {{ $key }}: {{ $val | quote }}
41 {{- end }}
42 {{- end }}
43 {{- if hasKey .Values "api_deployment_labels" }}
44 {{- range $key, $val := .Values.api_deployment_labels }}
45 {{ $key }}: {{ $val | quote }}
46 {{- end }}
47 {{- end }}
48 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070049spec:
50 replicas: {{ .Values.replicas.afrouter }}
51 template:
52 metadata:
53 labels:
54 app: voltha-api-server
David Bainbridge1f888042019-06-24 18:02:01 +000055 app.kubernetes.io/name: "api-server"
56 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
57 app.kubernetes.io/component: "api"
58 app.kubernetes.io/part-of: "voltha"
59 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
60 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
David Bainbridge534a73d2019-08-30 18:57:23 +000061 {{- if hasKey .Values "extra_pod_labels" }}
62 {{- range $key, $val := .Values.extra_pod_labels }}
63 {{ $key }}: {{ $val | quote }}
64 {{- end }}
65 {{- end }}
66 {{- if hasKey .Values "api_pod_labels" }}
67 {{- range $key, $val := .Values.api_pod_labels }}
68 {{ $key }}: {{ $val | quote }}
69 {{- end }}
70 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070071 annotations:
72 cni: "calico"
73 spec:
74 serviceAccountName: {{ .Values.serviceaccount }}
75 containers:
76 - name: arouter
David Bainbridge03706e62019-10-18 17:59:24 +000077 image: '{{ tpl .Values.images.afrouter.registry . }}{{ tpl .Values.images.afrouter.repository . }}:{{ tpl .Values.images.afrouter.tag . }}'
David Bainbridgecd30e542019-05-31 20:52:56 +000078 imagePullPolicy: {{ tpl .Values.images.afrouter.pullPolicy . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070079 volumeMounts:
80 - name: config-volume
81 mountPath: /app/config
82 ports:
83 - containerPort: 55555
84 env:
85 - name: POD_NAMESPACE
86 value: {{ .Release.Namespace }}
87 command: ["/app/afrouter"]
88 args: ["-config", "/app/config/arouter.voltha.json"]
89 - name: arouterd
90 env:
91 - name: POD_NAMESPACE
92 value: {{ .Release.Namespace }}
A R Karthick0aced4f2019-09-05 20:08:36 +000093 - name: KAFKA_HOST
94 value: {{ .Values.services.kafka.cluster.service }}
95 - name: KAFKA_PORT
96 value: {{ quote .Values.services.kafka.cluster.port }}
A R Karthickc3b2df92019-09-30 23:22:38 +000097 - name: KAFKA_TOPIC
98 value: {{ quote .Values.api_server.kafka_topic }}
David Bainbridge03706e62019-10-18 17:59:24 +000099 image: '{{ tpl .Values.images.afrouterd.registry . }}{{ tpl .Values.images.afrouterd.repository . }}:{{ tpl .Values.images.afrouterd.tag . }}'
David Bainbridgecd30e542019-05-31 20:52:56 +0000100 imagePullPolicy: {{ tpl .Values.images.afrouterd.pullPolicy . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700101 command: ["/app/arouterd"]
102 restartPolicy: Always
103 volumes:
104 - name: config-volume
105 configMap:
106 name: afrouter-config
David Bainbridgee5887072019-11-14 23:01:01 +0000107{{- end }}