blob: f8f2cc22f75deae2042998c0bc1d7fa5a2485806 [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:
divyadesai0b0e4a12020-03-12 09:33:56 +000067 - name: COMPONENT_NAME
68 valueFrom:
69 fieldRef:
70 fieldPath: metadata.labels['app.kubernetes.io/name']
David Bainbridge2f9b76f2019-05-15 13:48:11 -070071 args:
David K. Bainbridge707022f2020-01-23 14:15:07 -080072 - "/app/ofagent"
Jonathan Hart3980b742020-04-20 11:00:54 -070073 {{- range .Values.services.controller }}
74 - "--controller={{ .service }}:{{ .port }}"
75 {{- end }}
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 }}