blob: 1372c184791bc080cc29a0bf091443555e979305 [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 Bainbridge16b19cc2020-05-29 11:50:44 -070014{{- if not .Values.use_ofagent_go }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070015---
16apiVersion: apps/v1beta1
17kind: Deployment
18metadata:
David Bainbridge0b44de12019-08-21 21:00:35 +000019 name: voltha-ofagent
David Bainbridge534a73d2019-08-30 18:57:23 +000020 {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "ofagent_deployment_labels") }}
21 labels:
22 {{- if hasKey .Values "extra_deployment_labels" }}
23 {{- range $key, $val := .Values.extra_deployment_labels }}
24 {{ $key }}: {{ $val | quote }}
25 {{- end }}
26 {{- end }}
27 {{- if hasKey .Values "ofagent_deployment_labels" }}
28 {{- range $key, $val := .Values.ofagent_deployment_labels }}
29 {{ $key }}: {{ $val | quote }}
30 {{- end }}
31 {{- end }}
32 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070033spec:
34 replicas: {{ .Values.replicas.ofagent }}
35 template:
36 metadata:
37 labels:
38 app: ofagent
David Bainbridge1f888042019-06-24 18:02:01 +000039 app.kubernetes.io/name: "open-flow-agent"
40 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
41 app.kubernetes.io/component: "integration"
42 app.kubernetes.io/part-of: "voltha"
43 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
44 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
David Bainbridge534a73d2019-08-30 18:57:23 +000045 {{- if hasKey .Values "extra_pod_labels" }}
46 {{- range $key, $val := .Values.extra_pod_labels }}
47 {{ $key }}: {{ $val | quote }}
48 {{- end }}
49 {{- end }}
50 {{- if hasKey .Values "ofagent_pod_labels" }}
51 {{- range $key, $val := .Values.ofagent_pod_labels }}
52 {{ $key }}: {{ $val | quote }}
53 {{- end }}
54 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070055 spec:
David Bainbridge16b19cc2020-05-29 11:50:44 -070056 {{- if .Values.securityContext.enabled }}
57 securityContext:
58 runAsUser: {{ .Values.securityContext.runAsUser }}
59 runAsGroup: {{ .Values.securityContext.runAsGroup }}
60 fsGroup: {{ .Values.securityContext.fsGroup }}
61 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070062 terminationGracePeriodSeconds: 10
David Bainbridge2f9b76f2019-05-15 13:48:11 -070063 containers:
64 - name: ofagent
Matteo Scandoloccea27b2020-03-18 15:25:05 -070065 image: '{{ tpl .Values.images.ofagent_py.registry . }}{{ tpl .Values.images.ofagent_py.repository . }}:{{ tpl .Values.images.ofagent_py.tag . }}'
66 imagePullPolicy: {{ tpl .Values.images.ofagent_py.pullPolicy . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070067 args:
68 - "/ofagent/ofagent/main.py"
69 - "-v"
Jonathan Hart3980b742020-04-20 11:00:54 -070070 - "--controller"
71 {{- range .Values.services.controller }}
72 - "{{ .service }}:{{ .port }}"
73 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070074 - "--grpc-endpoint=voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555"
David Bainbridge32ac6072019-10-21 20:29:52 +000075 - "--probe=:8080"
David Bainbridge16b19cc2020-05-29 11:50:44 -070076 {{- if .Values.securityContext.enabled }}
77 securityContext:
78 allowPrivilegeEscalation: false
79 {{- end }}
David Bainbridge32ac6072019-10-21 20:29:52 +000080 livenessProbe:
81 httpGet:
82 path: /healthz
83 port: 8080
84 initialDelaySeconds: 10
85 periodSeconds: 5
86 readinessProbe:
87 httpGet:
88 path: /readz
89 port: 8080
90 initialDelaySeconds: 10
91 periodSeconds: 5
David K. Bainbridge707022f2020-01-23 14:15:07 -080092{{- end }}