blob: 786c4cfb0b45a77b18917365577b12c24c39559a [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.
divyadesai0b0e4a12020-03-12 09:33:56 +000014{{- $log_level := tpl .Values.ofagent.log_level . | upper }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070015---
16apiVersion: apps/v1beta1
17kind: Deployment
18metadata:
David Bainbridge2bdd4302020-06-09 17:13:18 -070019 name: "{{ template "fullname" . }}-ofagent"
David Bainbridge8595b3b2020-06-05 12:23:05 -070020 namespace: {{ .Release.Namespace }}
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:
David Bainbridge8595b3b2020-06-05 12:23:05 -070038 namespace: {{ .Release.Namespace }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070039 labels:
40 app: ofagent
David Bainbridge8595b3b2020-06-05 12:23:05 -070041 release: {{ .Release.Name }}
David Bainbridge1f888042019-06-24 18:02:01 +000042 app.kubernetes.io/name: "open-flow-agent"
43 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
44 app.kubernetes.io/component: "integration"
45 app.kubernetes.io/part-of: "voltha"
46 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
47 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
David Bainbridge534a73d2019-08-30 18:57:23 +000048 {{- if hasKey .Values "extra_pod_labels" }}
49 {{- range $key, $val := .Values.extra_pod_labels }}
50 {{ $key }}: {{ $val | quote }}
51 {{- end }}
52 {{- end }}
53 {{- if hasKey .Values "ofagent_pod_labels" }}
54 {{- range $key, $val := .Values.ofagent_pod_labels }}
55 {{ $key }}: {{ $val | quote }}
56 {{- end }}
57 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070058 spec:
59 terminationGracePeriodSeconds: 10
David Bainbridge16b19cc2020-05-29 11:50:44 -070060 {{- if .Values.securityContext.enabled }}
61 securityContext:
62 runAsUser: {{ .Values.securityContext.runAsUser }}
63 runAsGroup: {{ .Values.securityContext.runAsGroup }}
64 fsGroup: {{ .Values.securityContext.fsGroup }}
65 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070066 containers:
67 - name: ofagent
David Bainbridge60018ec2020-06-02 13:32:30 -070068 image: '{{ tpl .Values.images.ofagent.registry . }}{{ tpl .Values.images.ofagent.repository . }}:{{ tpl .Values.images.ofagent.tag . }}'
69 imagePullPolicy: {{ tpl .Values.images.ofagent.pullPolicy . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070070 env:
divyadesai0b0e4a12020-03-12 09:33:56 +000071 - name: COMPONENT_NAME
72 valueFrom:
73 fieldRef:
74 fieldPath: metadata.labels['app.kubernetes.io/name']
David Bainbridge2f9b76f2019-05-15 13:48:11 -070075 args:
David K. Bainbridge707022f2020-01-23 14:15:07 -080076 - "/app/ofagent"
Jonathan Hart3980b742020-04-20 11:00:54 -070077 {{- range .Values.services.controller }}
78 - "--controller={{ .service }}:{{ .port }}"
79 {{- end }}
David Bainbridge2bdd4302020-06-09 17:13:18 -070080 - "--voltha={{ template "fullname" . }}-api.{{ .Release.Namespace }}.svc:55555"
Neha Sharma7d3d6be2020-05-14 20:02:17 +000081 - "--kv_store_address=etcd.{{ .Release.Namespace }}.svc:{{ .Values.services.etcd.port }}"
divyadesai0b0e4a12020-03-12 09:33:56 +000082 - "--kv_store_type=etcd"
Neha Sharmae5767ea2020-04-08 13:39:57 +000083 - "--kv_store_request_timeout=60s"
divyadesai0b0e4a12020-03-12 09:33:56 +000084 - "--log_level={{ $log_level }}"
David Bainbridge32ac6072019-10-21 20:29:52 +000085 - "--probe=:8080"
David Bainbridge16b19cc2020-05-29 11:50:44 -070086 {{- if .Values.securityContext.enabled }}
87 securityContext:
88 allowPrivilegeEscalation: false
89 {{- end }}
David Bainbridge32ac6072019-10-21 20:29:52 +000090 livenessProbe:
91 httpGet:
92 path: /healthz
93 port: 8080
94 initialDelaySeconds: 10
95 periodSeconds: 5
96 readinessProbe:
97 httpGet:
98 path: /readz
99 port: 8080
100 initialDelaySeconds: 10
101 periodSeconds: 5