blob: 07c2b94cf5a73ae88d93366d76541397c9498a44 [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.
divyadesai0b0e4a12020-03-12 09:33:56 +000015{{- $log_level := tpl .Values.ofagent.log_level . | upper }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070016---
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_go.registry . }}{{ tpl .Values.images.ofagent_go.repository . }}:{{ tpl .Values.images.ofagent_go.tag . }}'
65 imagePullPolicy: {{ tpl .Values.images.ofagent_go.pullPolicy . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070066 env:
67 - name: CONTROLLER_SERVICE
68 value: "{{ .Values.services.controller.service }}:{{ .Values.services.controller.port }}"
divyadesai0b0e4a12020-03-12 09:33:56 +000069 - name: COMPONENT_NAME
70 valueFrom:
71 fieldRef:
72 fieldPath: metadata.labels['app.kubernetes.io/name']
David Bainbridge2f9b76f2019-05-15 13:48:11 -070073 args:
David K. Bainbridge707022f2020-01-23 14:15:07 -080074 - "/app/ofagent"
David Bainbridge2f9b76f2019-05-15 13:48:11 -070075 - "--controller=$(CONTROLLER_SERVICE)"
David K. Bainbridge707022f2020-01-23 14:15:07 -080076 - "--voltha=voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555"
divyadesai0b0e4a12020-03-12 09:33:56 +000077 - "--kv_store_host=voltha-etcd-cluster-client.{{ .Release.Namespace }}.svc.cluster.local"
78 - "--kv_store_port=2379"
79 - "--kv_store_type=etcd"
80 - "--kv_store_request_timeout=60"
81 - "--log_level={{ $log_level }}"
David Bainbridge32ac6072019-10-21 20:29:52 +000082 - "--probe=:8080"
83 livenessProbe:
84 httpGet:
85 path: /healthz
86 port: 8080
87 initialDelaySeconds: 10
88 periodSeconds: 5
89 readinessProbe:
90 httpGet:
91 path: /readz
92 port: 8080
93 initialDelaySeconds: 10
94 periodSeconds: 5
David K. Bainbridge707022f2020-01-23 14:15:07 -080095{{- end }}