blob: e45e957f5202ba36c4e453c372e29d65477a5936 [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 Bainbridge0b44de12019-08-21 21:00:35 +000019 name: voltha-ofagent
David Bainbridge534a73d2019-08-30 18:57:23 +000020 {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "ofagent_deployment_labels") }}
21 labels:
22 {{- if hasKey .Values "extra_deployment_labels" }}
23 {{- range $key, $val := .Values.extra_deployment_labels }}
24 {{ $key }}: {{ $val | quote }}
25 {{- end }}
26 {{- end }}
27 {{- if hasKey .Values "ofagent_deployment_labels" }}
28 {{- range $key, $val := .Values.ofagent_deployment_labels }}
29 {{ $key }}: {{ $val | quote }}
30 {{- end }}
31 {{- end }}
32 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070033spec:
34 replicas: {{ .Values.replicas.ofagent }}
35 template:
36 metadata:
37 labels:
38 app: ofagent
David Bainbridge1f888042019-06-24 18:02:01 +000039 app.kubernetes.io/name: "open-flow-agent"
40 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
41 app.kubernetes.io/component: "integration"
42 app.kubernetes.io/part-of: "voltha"
43 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
44 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
David Bainbridge534a73d2019-08-30 18:57:23 +000045 {{- if hasKey .Values "extra_pod_labels" }}
46 {{- range $key, $val := .Values.extra_pod_labels }}
47 {{ $key }}: {{ $val | quote }}
48 {{- end }}
49 {{- end }}
50 {{- if hasKey .Values "ofagent_pod_labels" }}
51 {{- range $key, $val := .Values.ofagent_pod_labels }}
52 {{ $key }}: {{ $val | quote }}
53 {{- end }}
54 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070055 spec:
56 terminationGracePeriodSeconds: 10
David Bainbridge16b19cc2020-05-29 11:50:44 -070057 {{- if .Values.securityContext.enabled }}
58 securityContext:
59 runAsUser: {{ .Values.securityContext.runAsUser }}
60 runAsGroup: {{ .Values.securityContext.runAsGroup }}
61 fsGroup: {{ .Values.securityContext.fsGroup }}
62 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070063 containers:
64 - name: ofagent
David Bainbridge60018ec2020-06-02 13:32:30 -070065 image: '{{ tpl .Values.images.ofagent.registry . }}{{ tpl .Values.images.ofagent.repository . }}:{{ tpl .Values.images.ofagent.tag . }}'
66 imagePullPolicy: {{ tpl .Values.images.ofagent.pullPolicy . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070067 env:
divyadesai0b0e4a12020-03-12 09:33:56 +000068 - name: COMPONENT_NAME
69 valueFrom:
70 fieldRef:
71 fieldPath: metadata.labels['app.kubernetes.io/name']
David Bainbridge2f9b76f2019-05-15 13:48:11 -070072 args:
David K. Bainbridge707022f2020-01-23 14:15:07 -080073 - "/app/ofagent"
Jonathan Hart3980b742020-04-20 11:00:54 -070074 {{- range .Values.services.controller }}
75 - "--controller={{ .service }}:{{ .port }}"
76 {{- end }}
David K. Bainbridge707022f2020-01-23 14:15:07 -080077 - "--voltha=voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555"
divyadesai0b0e4a12020-03-12 09:33:56 +000078 - "--kv_store_host=voltha-etcd-cluster-client.{{ .Release.Namespace }}.svc.cluster.local"
79 - "--kv_store_port=2379"
80 - "--kv_store_type=etcd"
Neha Sharmae5767ea2020-04-08 13:39:57 +000081 - "--kv_store_request_timeout=60s"
divyadesai0b0e4a12020-03-12 09:33:56 +000082 - "--log_level={{ $log_level }}"
David Bainbridge32ac6072019-10-21 20:29:52 +000083 - "--probe=:8080"
David Bainbridge16b19cc2020-05-29 11:50:44 -070084 {{- if .Values.securityContext.enabled }}
85 securityContext:
86 allowPrivilegeEscalation: false
87 {{- end }}
David Bainbridge32ac6072019-10-21 20:29:52 +000088 livenessProbe:
89 httpGet:
90 path: /healthz
91 port: 8080
92 initialDelaySeconds: 10
93 periodSeconds: 5
94 readinessProbe:
95 httpGet:
96 path: /readz
97 port: 8080
98 initialDelaySeconds: 10
99 periodSeconds: 5