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. |
divyadesai | 0b0e4a1 | 2020-03-12 09:33:56 +0000 | [diff] [blame] | 14 | {{- $log_level := tpl .Values.ofagent.log_level . | upper }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 15 | --- |
David Bainbridge | c437c3e | 2020-06-25 14:48:24 -0700 | [diff] [blame] | 16 | apiVersion: apps/v1 |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 17 | kind: Deployment |
| 18 | metadata: |
David Bainbridge | 2bdd430 | 2020-06-09 17:13:18 -0700 | [diff] [blame] | 19 | name: "{{ template "fullname" . }}-ofagent" |
David Bainbridge | 8595b3b | 2020-06-05 12:23:05 -0700 | [diff] [blame] | 20 | namespace: {{ .Release.Namespace }} |
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 }} |
David Bainbridge | c437c3e | 2020-06-25 14:48:24 -0700 | [diff] [blame] | 36 | selector: |
| 37 | matchLabels: |
| 38 | app: ofagent |
| 39 | release: {{ .Release.Name }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 40 | template: |
| 41 | metadata: |
David Bainbridge | 8595b3b | 2020-06-05 12:23:05 -0700 | [diff] [blame] | 42 | namespace: {{ .Release.Namespace }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 43 | labels: |
| 44 | app: ofagent |
David Bainbridge | 8595b3b | 2020-06-05 12:23:05 -0700 | [diff] [blame] | 45 | release: {{ .Release.Name }} |
David Bainbridge | 1f88804 | 2019-06-24 18:02:01 +0000 | [diff] [blame] | 46 | 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" |
| 50 | app.kubernetes.io/managed-by: {{ quote .Release.Service }} |
| 51 | helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 52 | {{- if hasKey .Values "extra_pod_labels" }} |
| 53 | {{- range $key, $val := .Values.extra_pod_labels }} |
| 54 | {{ $key }}: {{ $val | quote }} |
| 55 | {{- end }} |
| 56 | {{- end }} |
| 57 | {{- if hasKey .Values "ofagent_pod_labels" }} |
| 58 | {{- range $key, $val := .Values.ofagent_pod_labels }} |
| 59 | {{ $key }}: {{ $val | quote }} |
| 60 | {{- end }} |
| 61 | {{- end }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 62 | spec: |
| 63 | terminationGracePeriodSeconds: 10 |
David Bainbridge | 16b19cc | 2020-05-29 11:50:44 -0700 | [diff] [blame] | 64 | {{- if .Values.securityContext.enabled }} |
| 65 | securityContext: |
| 66 | runAsUser: {{ .Values.securityContext.runAsUser }} |
| 67 | runAsGroup: {{ .Values.securityContext.runAsGroup }} |
| 68 | fsGroup: {{ .Values.securityContext.fsGroup }} |
| 69 | {{- end }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 70 | containers: |
| 71 | - name: ofagent |
David Bainbridge | 60018ec | 2020-06-02 13:32:30 -0700 | [diff] [blame] | 72 | image: '{{ tpl .Values.images.ofagent.registry . }}{{ tpl .Values.images.ofagent.repository . }}:{{ tpl .Values.images.ofagent.tag . }}' |
| 73 | imagePullPolicy: {{ tpl .Values.images.ofagent.pullPolicy . }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 74 | env: |
divyadesai | 0b0e4a1 | 2020-03-12 09:33:56 +0000 | [diff] [blame] | 75 | - name: COMPONENT_NAME |
| 76 | valueFrom: |
| 77 | fieldRef: |
| 78 | fieldPath: metadata.labels['app.kubernetes.io/name'] |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 79 | args: |
David K. Bainbridge | 707022f | 2020-01-23 14:15:07 -0800 | [diff] [blame] | 80 | - "/app/ofagent" |
Jonathan Hart | 3980b74 | 2020-04-20 11:00:54 -0700 | [diff] [blame] | 81 | {{- range .Values.services.controller }} |
| 82 | - "--controller={{ .service }}:{{ .port }}" |
| 83 | {{- end }} |
David Bainbridge | 2bdd430 | 2020-06-09 17:13:18 -0700 | [diff] [blame] | 84 | - "--voltha={{ template "fullname" . }}-api.{{ .Release.Namespace }}.svc:55555" |
Girish Kumar | 898f350 | 2020-06-24 07:12:36 +0000 | [diff] [blame] | 85 | - "--kv_store_address={{ .Values.services.etcd.service }}:{{ .Values.services.etcd.port }}" |
divyadesai | 0b0e4a1 | 2020-03-12 09:33:56 +0000 | [diff] [blame] | 86 | - "--kv_store_type=etcd" |
Neha Sharma | e5767ea | 2020-04-08 13:39:57 +0000 | [diff] [blame] | 87 | - "--kv_store_request_timeout=60s" |
divyadesai | 0b0e4a1 | 2020-03-12 09:33:56 +0000 | [diff] [blame] | 88 | - "--log_level={{ $log_level }}" |
David Bainbridge | 32ac607 | 2019-10-21 20:29:52 +0000 | [diff] [blame] | 89 | - "--probe=:8080" |
David Bainbridge | 16b19cc | 2020-05-29 11:50:44 -0700 | [diff] [blame] | 90 | {{- if .Values.securityContext.enabled }} |
| 91 | securityContext: |
| 92 | allowPrivilegeEscalation: false |
| 93 | {{- end }} |
David Bainbridge | 32ac607 | 2019-10-21 20:29:52 +0000 | [diff] [blame] | 94 | livenessProbe: |
| 95 | httpGet: |
| 96 | path: /healthz |
| 97 | port: 8080 |
| 98 | initialDelaySeconds: 10 |
| 99 | periodSeconds: 5 |
| 100 | readinessProbe: |
| 101 | httpGet: |
| 102 | path: /readz |
| 103 | port: 8080 |
| 104 | initialDelaySeconds: 10 |
| 105 | periodSeconds: 5 |