blob: 11ccb31c33060a8f651940f7c474479aa72e2be9 [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"]
divyadesai9882a392019-11-18 11:43:34 +000088 livenessProbe:
89 httpGet:
90 path: /healthz
91 port: 8080
92 initialDelaySeconds: 10
93 periodSeconds: 5
94 readinessProbe:
95 httpGet:
96 path: /readz
97 port: 8080
98 initialDelaySeconds: 10
99 periodSeconds: 5
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700100 args: ["-config", "/app/config/arouter.voltha.json"]
101 - name: arouterd
102 env:
103 - name: POD_NAMESPACE
104 value: {{ .Release.Namespace }}
A R Karthick0aced4f2019-09-05 20:08:36 +0000105 - name: KAFKA_HOST
106 value: {{ .Values.services.kafka.cluster.service }}
107 - name: KAFKA_PORT
108 value: {{ quote .Values.services.kafka.cluster.port }}
A R Karthickc3b2df92019-09-30 23:22:38 +0000109 - name: KAFKA_TOPIC
110 value: {{ quote .Values.api_server.kafka_topic }}
David Bainbridge03706e62019-10-18 17:59:24 +0000111 image: '{{ tpl .Values.images.afrouterd.registry . }}{{ tpl .Values.images.afrouterd.repository . }}:{{ tpl .Values.images.afrouterd.tag . }}'
David Bainbridgecd30e542019-05-31 20:52:56 +0000112 imagePullPolicy: {{ tpl .Values.images.afrouterd.pullPolicy . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700113 command: ["/app/arouterd"]
divyadesai9882a392019-11-18 11:43:34 +0000114 livenessProbe:
115 httpGet:
116 path: /healthz
117 port: 8081
118 initialDelaySeconds: 10
119 periodSeconds: 5
120 readinessProbe:
121 httpGet:
122 path: /readz
123 port: 8081
124 initialDelaySeconds: 10
125 periodSeconds: 5
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700126 restartPolicy: Always
127 volumes:
128 - name: config-volume
129 configMap:
130 name: afrouter-config
David Bainbridgee5887072019-11-14 23:01:01 +0000131{{- end }}