blob: 87f76f30fa62f894d9e1d43d42bff7bcb093da95 [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---
David Bainbridgec437c3e2020-06-25 14:48:24 -070016apiVersion: apps/v1
David Bainbridge2f9b76f2019-05-15 13:48:11 -070017kind: 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 }}
David Bainbridgec437c3e2020-06-25 14:48:24 -070036 selector:
37 matchLabels:
38 app: ofagent
39 release: {{ .Release.Name }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070040 template:
41 metadata:
David Bainbridge8595b3b2020-06-05 12:23:05 -070042 namespace: {{ .Release.Namespace }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070043 labels:
44 app: ofagent
David Bainbridge8595b3b2020-06-05 12:23:05 -070045 release: {{ .Release.Name }}
David Bainbridge1f888042019-06-24 18:02:01 +000046 app.kubernetes.io/name: "open-flow-agent"
47 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
48 app.kubernetes.io/component: "integration"
49 app.kubernetes.io/part-of: "voltha"
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080050 app.kubernetes.io/stack: "{{ .Values.global.stack_name }}"
David Bainbridge1f888042019-06-24 18:02:01 +000051 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
52 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
David Bainbridge534a73d2019-08-30 18:57:23 +000053 {{- if hasKey .Values "extra_pod_labels" }}
54 {{- range $key, $val := .Values.extra_pod_labels }}
55 {{ $key }}: {{ $val | quote }}
56 {{- end }}
57 {{- end }}
58 {{- if hasKey .Values "ofagent_pod_labels" }}
59 {{- range $key, $val := .Values.ofagent_pod_labels }}
60 {{ $key }}: {{ $val | quote }}
61 {{- end }}
62 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070063 spec:
64 terminationGracePeriodSeconds: 10
David Bainbridge16b19cc2020-05-29 11:50:44 -070065 {{- if .Values.securityContext.enabled }}
66 securityContext:
67 runAsUser: {{ .Values.securityContext.runAsUser }}
68 runAsGroup: {{ .Values.securityContext.runAsGroup }}
69 fsGroup: {{ .Values.securityContext.fsGroup }}
70 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070071 containers:
72 - name: ofagent
David Bainbridge60018ec2020-06-02 13:32:30 -070073 image: '{{ tpl .Values.images.ofagent.registry . }}{{ tpl .Values.images.ofagent.repository . }}:{{ tpl .Values.images.ofagent.tag . }}'
74 imagePullPolicy: {{ tpl .Values.images.ofagent.pullPolicy . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070075 env:
Matteo Scandoloaca9cbb2020-11-06 14:14:10 -080076 - name: COMPONENT_NAME
77 valueFrom:
78 fieldRef:
79 fieldPath: metadata.labels['app.kubernetes.io/name']
80 - name: KV_STORE_DATAPATH_PREFIX
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080081 value: {{ .Values.global.kv_store_data_prefix }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070082 args:
David K. Bainbridge707022f2020-01-23 14:15:07 -080083 - "/app/ofagent"
Jonathan Hart3980b742020-04-20 11:00:54 -070084 {{- range .Values.services.controller }}
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080085 - "--controller={{ tpl .address $ }}"
Jonathan Hart3980b742020-04-20 11:00:54 -070086 {{- end }}
David Bainbridge2bdd4302020-06-09 17:13:18 -070087 - "--voltha={{ template "fullname" . }}-api.{{ .Release.Namespace }}.svc:55555"
Neha Sharma1a3da1c2020-06-24 13:12:48 +000088 - "--kv_store_address={{ .Values.services.etcd.address }}"
divyadesai0b0e4a12020-03-12 09:33:56 +000089 - "--kv_store_type=etcd"
Neha Sharmae5767ea2020-04-08 13:39:57 +000090 - "--kv_store_request_timeout=60s"
divyadesai0b0e4a12020-03-12 09:33:56 +000091 - "--log_level={{ $log_level }}"
David Bainbridge32ac6072019-10-21 20:29:52 +000092 - "--probe=:8080"
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080093 - "--trace_enabled={{ .Values.global.tracing.enabled }}"
94 - "--trace_agent_address={{ tpl .Values.services.tracing_agent.address . }}"
95 - "--log_correlation_enabled={{ .Values.global.log_correlation.enabled }}"
David Bainbridge16b19cc2020-05-29 11:50:44 -070096 {{- if .Values.securityContext.enabled }}
97 securityContext:
98 allowPrivilegeEscalation: false
99 {{- end }}
David Bainbridge32ac6072019-10-21 20:29:52 +0000100 livenessProbe:
101 httpGet:
102 path: /healthz
103 port: 8080
104 initialDelaySeconds: 10
105 periodSeconds: 5
106 readinessProbe:
107 httpGet:
108 path: /readz
109 port: 8080
110 initialDelaySeconds: 10
111 periodSeconds: 5