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. |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 15 | --- |
| 16 | apiVersion: apps/v1beta1 |
| 17 | kind: Deployment |
| 18 | metadata: |
David Bainbridge | 0b44de1 | 2019-08-21 21:00:35 +0000 | [diff] [blame] | 19 | name: voltha-ofagent |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 20 | serviceAccountName: {{ .Values.serviceaccount }} |
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 | annotations: |
| 57 | cni: "calico" |
| 58 | spec: |
| 59 | terminationGracePeriodSeconds: 10 |
| 60 | serviceAccountName: {{ .Values.serviceaccount }} |
| 61 | containers: |
| 62 | - name: ofagent |
David Bainbridge | 03706e6 | 2019-10-18 17:59:24 +0000 | [diff] [blame] | 63 | 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] | 64 | imagePullPolicy: {{ tpl .Values.images.ofagent.pullPolicy . }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 65 | env: |
| 66 | - name: CONTROLLER_SERVICE |
| 67 | value: "{{ .Values.services.controller.service }}:{{ .Values.services.controller.port }}" |
| 68 | args: |
David K. Bainbridge | 707022f | 2020-01-23 14:15:07 -0800 | [diff] [blame^] | 69 | - "/app/ofagent" |
| 70 | - "--loglevel={{- tpl .Values.ofagent.log_level . | upper }}" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 71 | - "--controller=$(CONTROLLER_SERVICE)" |
David K. Bainbridge | 707022f | 2020-01-23 14:15:07 -0800 | [diff] [blame^] | 72 | - "--voltha=voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555" |
David Bainbridge | 32ac607 | 2019-10-21 20:29:52 +0000 | [diff] [blame] | 73 | - "--probe=:8080" |
| 74 | livenessProbe: |
| 75 | httpGet: |
| 76 | path: /healthz |
| 77 | port: 8080 |
| 78 | initialDelaySeconds: 10 |
| 79 | periodSeconds: 5 |
| 80 | readinessProbe: |
| 81 | httpGet: |
| 82 | path: /readz |
| 83 | port: 8080 |
| 84 | initialDelaySeconds: 10 |
| 85 | periodSeconds: 5 |
David K. Bainbridge | 707022f | 2020-01-23 14:15:07 -0800 | [diff] [blame^] | 86 | {{- end }} |