David K. Bainbridge | 707022f | 2020-01-23 14:15:07 -0800 | [diff] [blame] | 1 | {{- if and (hasKey .Values "use_ofagent_go") .Values.use_ofagent_go }} |
| 2 | # Copyright 2020-present Open Networking Foundation |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
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 | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 21 | serviceAccountName: {{ .Values.serviceaccount }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 22 | {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "ofagent_deployment_labels") }} |
| 23 | labels: |
| 24 | {{- if hasKey .Values "extra_deployment_labels" }} |
| 25 | {{- range $key, $val := .Values.extra_deployment_labels }} |
| 26 | {{ $key }}: {{ $val | quote }} |
| 27 | {{- end }} |
| 28 | {{- end }} |
| 29 | {{- if hasKey .Values "ofagent_deployment_labels" }} |
| 30 | {{- range $key, $val := .Values.ofagent_deployment_labels }} |
| 31 | {{ $key }}: {{ $val | quote }} |
| 32 | {{- end }} |
| 33 | {{- end }} |
| 34 | {{- end }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 35 | spec: |
| 36 | replicas: {{ .Values.replicas.ofagent }} |
| 37 | template: |
| 38 | metadata: |
| 39 | labels: |
| 40 | app: ofagent |
David Bainbridge | 1f88804 | 2019-06-24 18:02:01 +0000 | [diff] [blame] | 41 | app.kubernetes.io/name: "open-flow-agent" |
| 42 | app.kubernetes.io/version: {{ quote .Chart.AppVersion }} |
| 43 | app.kubernetes.io/component: "integration" |
| 44 | app.kubernetes.io/part-of: "voltha" |
| 45 | app.kubernetes.io/managed-by: {{ quote .Release.Service }} |
| 46 | helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 47 | {{- if hasKey .Values "extra_pod_labels" }} |
| 48 | {{- range $key, $val := .Values.extra_pod_labels }} |
| 49 | {{ $key }}: {{ $val | quote }} |
| 50 | {{- end }} |
| 51 | {{- end }} |
| 52 | {{- if hasKey .Values "ofagent_pod_labels" }} |
| 53 | {{- range $key, $val := .Values.ofagent_pod_labels }} |
| 54 | {{ $key }}: {{ $val | quote }} |
| 55 | {{- end }} |
| 56 | {{- end }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 57 | annotations: |
| 58 | cni: "calico" |
| 59 | spec: |
| 60 | terminationGracePeriodSeconds: 10 |
| 61 | serviceAccountName: {{ .Values.serviceaccount }} |
| 62 | containers: |
| 63 | - name: ofagent |
David Bainbridge | 03706e6 | 2019-10-18 17:59:24 +0000 | [diff] [blame] | 64 | image: '{{ tpl .Values.images.ofagent.registry . }}{{ tpl .Values.images.ofagent.repository . }}:{{ tpl .Values.images.ofagent.tag . }}' |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 65 | imagePullPolicy: {{ tpl .Values.images.ofagent.pullPolicy . }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 66 | env: |
| 67 | - name: CONTROLLER_SERVICE |
| 68 | value: "{{ .Values.services.controller.service }}:{{ .Values.services.controller.port }}" |
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" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 75 | - "--controller=$(CONTROLLER_SERVICE)" |
David K. Bainbridge | 707022f | 2020-01-23 14:15:07 -0800 | [diff] [blame] | 76 | - "--voltha=voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555" |
divyadesai | 0b0e4a1 | 2020-03-12 09:33:56 +0000 | [diff] [blame^] | 77 | - "--kv_store_host=voltha-etcd-cluster-client.{{ .Release.Namespace }}.svc.cluster.local" |
| 78 | - "--kv_store_port=2379" |
| 79 | - "--kv_store_type=etcd" |
| 80 | - "--kv_store_request_timeout=60" |
| 81 | - "--log_level={{ $log_level }}" |
David Bainbridge | 32ac607 | 2019-10-21 20:29:52 +0000 | [diff] [blame] | 82 | - "--probe=:8080" |
| 83 | livenessProbe: |
| 84 | httpGet: |
| 85 | path: /healthz |
| 86 | port: 8080 |
| 87 | initialDelaySeconds: 10 |
| 88 | periodSeconds: 5 |
| 89 | readinessProbe: |
| 90 | httpGet: |
| 91 | path: /readz |
| 92 | port: 8080 |
| 93 | initialDelaySeconds: 10 |
| 94 | periodSeconds: 5 |
David K. Bainbridge | 707022f | 2020-01-23 14:15:07 -0800 | [diff] [blame] | 95 | {{- end }} |