blob: a32e19ad724b1ba88c5ad3fbe7936d09856e5a4a [file] [log] [blame]
David K. Bainbridge707022f2020-01-23 14:15:07 -08001# Copyright 2020-present Open Networking Foundation
David Bainbridge2f9b76f2019-05-15 13:48:11 -07002#
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 .Values.use_ofagent_go }}
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 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 spec:
57 terminationGracePeriodSeconds: 10
David Bainbridge16b19cc2020-05-29 11:50:44 -070058 {{- if .Values.securityContext.enabled }}
59 securityContext:
60 runAsUser: {{ .Values.securityContext.runAsUser }}
61 runAsGroup: {{ .Values.securityContext.runAsGroup }}
62 fsGroup: {{ .Values.securityContext.fsGroup }}
63 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070064 containers:
65 - name: ofagent
Matteo Scandoloccea27b2020-03-18 15:25:05 -070066 image: '{{ tpl .Values.images.ofagent_go.registry . }}{{ tpl .Values.images.ofagent_go.repository . }}:{{ tpl .Values.images.ofagent_go.tag . }}'
67 imagePullPolicy: {{ tpl .Values.images.ofagent_go.pullPolicy . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070068 env:
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"
Jonathan Hart3980b742020-04-20 11:00:54 -070075 {{- range .Values.services.controller }}
76 - "--controller={{ .service }}:{{ .port }}"
77 {{- end }}
David K. Bainbridge707022f2020-01-23 14:15:07 -080078 - "--voltha=voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555"
divyadesai0b0e4a12020-03-12 09:33:56 +000079 - "--kv_store_host=voltha-etcd-cluster-client.{{ .Release.Namespace }}.svc.cluster.local"
80 - "--kv_store_port=2379"
81 - "--kv_store_type=etcd"
Neha Sharmae5767ea2020-04-08 13:39:57 +000082 - "--kv_store_request_timeout=60s"
divyadesai0b0e4a12020-03-12 09:33:56 +000083 - "--log_level={{ $log_level }}"
David Bainbridge32ac6072019-10-21 20:29:52 +000084 - "--probe=:8080"
David Bainbridge16b19cc2020-05-29 11:50:44 -070085 {{- if .Values.securityContext.enabled }}
86 securityContext:
87 allowPrivilegeEscalation: false
88 {{- end }}
David Bainbridge32ac6072019-10-21 20:29:52 +000089 livenessProbe:
90 httpGet:
91 path: /healthz
92 port: 8080
93 initialDelaySeconds: 10
94 periodSeconds: 5
95 readinessProbe:
96 httpGet:
97 path: /readz
98 port: 8080
99 initialDelaySeconds: 10
100 periodSeconds: 5
David K. Bainbridge707022f2020-01-23 14:15:07 -0800101{{- end }}