blob: ca8e5d592b51691870cad20955a3d8d3a2e6b89a [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.
14
15---
16apiVersion: apps/v1beta1
17kind: Deployment
18metadata:
David Bainbridge0b44de12019-08-21 21:00:35 +000019 name: voltha-ofagent
David Bainbridge2f9b76f2019-05-15 13:48:11 -070020 serviceAccountName: {{ .Values.serviceaccount }}
David Bainbridge534a73d2019-08-30 18:57:23 +000021 {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "ofagent_deployment_labels") }}
22 labels:
23 {{- if hasKey .Values "extra_deployment_labels" }}
24 {{- range $key, $val := .Values.extra_deployment_labels }}
25 {{ $key }}: {{ $val | quote }}
26 {{- end }}
27 {{- end }}
28 {{- if hasKey .Values "ofagent_deployment_labels" }}
29 {{- range $key, $val := .Values.ofagent_deployment_labels }}
30 {{ $key }}: {{ $val | quote }}
31 {{- end }}
32 {{- end }}
33 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070034spec:
35 replicas: {{ .Values.replicas.ofagent }}
36 template:
37 metadata:
38 labels:
39 app: ofagent
David Bainbridge1f888042019-06-24 18:02:01 +000040 app.kubernetes.io/name: "open-flow-agent"
41 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
42 app.kubernetes.io/component: "integration"
43 app.kubernetes.io/part-of: "voltha"
44 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
45 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
David Bainbridge534a73d2019-08-30 18:57:23 +000046 {{- if hasKey .Values "extra_pod_labels" }}
47 {{- range $key, $val := .Values.extra_pod_labels }}
48 {{ $key }}: {{ $val | quote }}
49 {{- end }}
50 {{- end }}
51 {{- if hasKey .Values "ofagent_pod_labels" }}
52 {{- range $key, $val := .Values.ofagent_pod_labels }}
53 {{ $key }}: {{ $val | quote }}
54 {{- end }}
55 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070056 annotations:
57 cni: "calico"
58 spec:
59 terminationGracePeriodSeconds: 10
60 serviceAccountName: {{ .Values.serviceaccount }}
61 containers:
62 - name: ofagent
David Bainbridge5cb5d172019-07-24 02:30:19 +000063 image: {{ tpl .Values.images.ofagent.registry . }}{{ tpl .Values.images.ofagent.repository . }}:{{ tpl ( tpl .Values.images.ofagent.tag . ) . }}
David Bainbridgecd30e542019-05-31 20:52:56 +000064 imagePullPolicy: {{ tpl .Values.images.ofagent.pullPolicy . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070065 env:
66 - name: CONTROLLER_SERVICE
67 value: "{{ .Values.services.controller.service }}:{{ .Values.services.controller.port }}"
68 args:
69 - "/ofagent/ofagent/main.py"
70 - "-v"
71 - "--controller=$(CONTROLLER_SERVICE)"
72 - "--grpc-endpoint=voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555"