blob: b92ad815aa9e1206a275bc67b4c3b3b753bc5ce3 [file] [log] [blame]
David K. Bainbridge707022f2020-01-23 14:15:07 -08001{{- if and (hasKey .Values "use_ofagent_go") .Values.use_ofagent_go }}
2# Copyright 2020-present Open Networking Foundation
David Bainbridge2f9b76f2019-05-15 13:48:11 -07003#
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.
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 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 Bainbridge03706e62019-10-18 17:59:24 +000063 image: '{{ tpl .Values.images.ofagent.registry . }}{{ tpl .Values.images.ofagent.repository . }}:{{ 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:
David K. Bainbridge707022f2020-01-23 14:15:07 -080069 - "/app/ofagent"
70 - "--loglevel={{- tpl .Values.ofagent.log_level . | upper }}"
David Bainbridge2f9b76f2019-05-15 13:48:11 -070071 - "--controller=$(CONTROLLER_SERVICE)"
David K. Bainbridge707022f2020-01-23 14:15:07 -080072 - "--voltha=voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555"
David Bainbridge32ac6072019-10-21 20:29:52 +000073 - "--probe=:8080"
74 livenessProbe:
75 httpGet:
76 path: /healthz
77 port: 8080
78 initialDelaySeconds: 10
79 periodSeconds: 5
80 readinessProbe:
81 httpGet:
82 path: /readz
83 port: 8080
84 initialDelaySeconds: 10
85 periodSeconds: 5
David K. Bainbridge707022f2020-01-23 14:15:07 -080086{{- end }}