blob: 711c4d62648728dadd95371140c3b0afe1fe91de [file] [log] [blame]
David K. Bainbridge707022f2020-01-23 14:15:07 -08001{{- if not (and (hasKey .Values "use_ofagent_go") .Values.use_ofagent_go) }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -07002# Copyright 2019-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16---
17apiVersion: apps/v1beta1
18kind: Deployment
19metadata:
David Bainbridge0b44de12019-08-21 21:00:35 +000020 name: voltha-ofagent
David Bainbridge2f9b76f2019-05-15 13:48:11 -070021 serviceAccountName: {{ .Values.serviceaccount }}
David Bainbridge534a73d2019-08-30 18:57:23 +000022 {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "ofagent_deployment_labels") }}
23 labels:
24 {{- if hasKey .Values "extra_deployment_labels" }}
25 {{- range $key, $val := .Values.extra_deployment_labels }}
26 {{ $key }}: {{ $val | quote }}
27 {{- end }}
28 {{- end }}
29 {{- if hasKey .Values "ofagent_deployment_labels" }}
30 {{- range $key, $val := .Values.ofagent_deployment_labels }}
31 {{ $key }}: {{ $val | quote }}
32 {{- end }}
33 {{- end }}
34 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070035spec:
36 replicas: {{ .Values.replicas.ofagent }}
37 template:
38 metadata:
39 labels:
40 app: ofagent
David Bainbridge1f888042019-06-24 18:02:01 +000041 app.kubernetes.io/name: "open-flow-agent"
42 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
43 app.kubernetes.io/component: "integration"
44 app.kubernetes.io/part-of: "voltha"
45 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
46 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
David Bainbridge534a73d2019-08-30 18:57:23 +000047 {{- if hasKey .Values "extra_pod_labels" }}
48 {{- range $key, $val := .Values.extra_pod_labels }}
49 {{ $key }}: {{ $val | quote }}
50 {{- end }}
51 {{- end }}
52 {{- if hasKey .Values "ofagent_pod_labels" }}
53 {{- range $key, $val := .Values.ofagent_pod_labels }}
54 {{ $key }}: {{ $val | quote }}
55 {{- end }}
56 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070057 annotations:
58 cni: "calico"
59 spec:
60 terminationGracePeriodSeconds: 10
61 serviceAccountName: {{ .Values.serviceaccount }}
62 containers:
63 - name: ofagent
Matteo Scandoloccea27b2020-03-18 15:25:05 -070064 image: '{{ tpl .Values.images.ofagent_py.registry . }}{{ tpl .Values.images.ofagent_py.repository . }}:{{ tpl .Values.images.ofagent_py.tag . }}'
65 imagePullPolicy: {{ tpl .Values.images.ofagent_py.pullPolicy . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070066 args:
67 - "/ofagent/ofagent/main.py"
68 - "-v"
Jonathan Hart3980b742020-04-20 11:00:54 -070069 - "--controller"
70 {{- range .Values.services.controller }}
71 - "{{ .service }}:{{ .port }}"
72 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070073 - "--grpc-endpoint=voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555"
David Bainbridge32ac6072019-10-21 20:29:52 +000074 - "--probe=:8080"
75 livenessProbe:
76 httpGet:
77 path: /healthz
78 port: 8080
79 initialDelaySeconds: 10
80 periodSeconds: 5
81 readinessProbe:
82 httpGet:
83 path: /readz
84 port: 8080
85 initialDelaySeconds: 10
86 periodSeconds: 5
David K. Bainbridge707022f2020-01-23 14:15:07 -080087{{- end }}