David K. Bainbridge | 707022f | 2020-01-23 14:15:07 -0800 | [diff] [blame] | 1 | # Copyright 2020-present Open Networking Foundation |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 2 | # |
| 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 Bainbridge | 16b19cc | 2020-05-29 11:50:44 -0700 | [diff] [blame^] | 14 | {{- if .Values.use_ofagent_go }} |
divyadesai | 0b0e4a1 | 2020-03-12 09:33:56 +0000 | [diff] [blame] | 15 | {{- $log_level := tpl .Values.ofagent.log_level . | upper }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 16 | --- |
| 17 | apiVersion: apps/v1beta1 |
| 18 | kind: Deployment |
| 19 | metadata: |
David Bainbridge | 0b44de1 | 2019-08-21 21:00:35 +0000 | [diff] [blame] | 20 | name: voltha-ofagent |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 21 | {{- 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 Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 34 | spec: |
| 35 | replicas: {{ .Values.replicas.ofagent }} |
| 36 | template: |
| 37 | metadata: |
| 38 | labels: |
| 39 | app: ofagent |
David Bainbridge | 1f88804 | 2019-06-24 18:02:01 +0000 | [diff] [blame] | 40 | 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 Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 46 | {{- 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 Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 56 | spec: |
| 57 | terminationGracePeriodSeconds: 10 |
David Bainbridge | 16b19cc | 2020-05-29 11:50:44 -0700 | [diff] [blame^] | 58 | {{- if .Values.securityContext.enabled }} |
| 59 | securityContext: |
| 60 | runAsUser: {{ .Values.securityContext.runAsUser }} |
| 61 | runAsGroup: {{ .Values.securityContext.runAsGroup }} |
| 62 | fsGroup: {{ .Values.securityContext.fsGroup }} |
| 63 | {{- end }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 64 | containers: |
| 65 | - name: ofagent |
Matteo Scandolo | ccea27b | 2020-03-18 15:25:05 -0700 | [diff] [blame] | 66 | 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 Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 68 | env: |
divyadesai | 0b0e4a1 | 2020-03-12 09:33:56 +0000 | [diff] [blame] | 69 | - name: COMPONENT_NAME |
| 70 | valueFrom: |
| 71 | fieldRef: |
| 72 | fieldPath: metadata.labels['app.kubernetes.io/name'] |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 73 | args: |
David K. Bainbridge | 707022f | 2020-01-23 14:15:07 -0800 | [diff] [blame] | 74 | - "/app/ofagent" |
Jonathan Hart | 3980b74 | 2020-04-20 11:00:54 -0700 | [diff] [blame] | 75 | {{- range .Values.services.controller }} |
| 76 | - "--controller={{ .service }}:{{ .port }}" |
| 77 | {{- end }} |
David K. Bainbridge | 707022f | 2020-01-23 14:15:07 -0800 | [diff] [blame] | 78 | - "--voltha=voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555" |
divyadesai | 0b0e4a1 | 2020-03-12 09:33:56 +0000 | [diff] [blame] | 79 | - "--kv_store_host=voltha-etcd-cluster-client.{{ .Release.Namespace }}.svc.cluster.local" |
| 80 | - "--kv_store_port=2379" |
| 81 | - "--kv_store_type=etcd" |
Neha Sharma | e5767ea | 2020-04-08 13:39:57 +0000 | [diff] [blame] | 82 | - "--kv_store_request_timeout=60s" |
divyadesai | 0b0e4a1 | 2020-03-12 09:33:56 +0000 | [diff] [blame] | 83 | - "--log_level={{ $log_level }}" |
David Bainbridge | 32ac607 | 2019-10-21 20:29:52 +0000 | [diff] [blame] | 84 | - "--probe=:8080" |
David Bainbridge | 16b19cc | 2020-05-29 11:50:44 -0700 | [diff] [blame^] | 85 | {{- if .Values.securityContext.enabled }} |
| 86 | securityContext: |
| 87 | allowPrivilegeEscalation: false |
| 88 | {{- end }} |
David Bainbridge | 32ac607 | 2019-10-21 20:29:52 +0000 | [diff] [blame] | 89 | 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. Bainbridge | 707022f | 2020-01-23 14:15:07 -0800 | [diff] [blame] | 101 | {{- end }} |