David K. Bainbridge | 707022f | 2020-01-23 14:15:07 -0800 | [diff] [blame] | 1 | {{- if not (and (hasKey .Values "use_ofagent_go") .Values.use_ofagent_go) }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 2 | # Copyright 2019-present Open Networking Foundation |
| 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. |
| 15 | |
| 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 |
Matteo Scandolo | ccea27b | 2020-03-18 15:25:05 -0700 | [diff] [blame] | 64 | image: '{{ tpl .Values.images.ofagent_py.registry . }}{{ tpl .Values.images.ofagent_py.repository . }}:{{ tpl .Values.images.ofagent_py.tag . }}' |
| 65 | imagePullPolicy: {{ tpl .Values.images.ofagent_py.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 }}" |
| 69 | args: |
| 70 | - "/ofagent/ofagent/main.py" |
| 71 | - "-v" |
| 72 | - "--controller=$(CONTROLLER_SERVICE)" |
| 73 | - "--grpc-endpoint=voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555" |
David Bainbridge | 32ac607 | 2019-10-21 20:29:52 +0000 | [diff] [blame] | 74 | - "--probe=:8080" |
| 75 | livenessProbe: |
| 76 | httpGet: |
| 77 | path: /healthz |
| 78 | port: 8080 |
| 79 | initialDelaySeconds: 10 |
| 80 | periodSeconds: 5 |
| 81 | readinessProbe: |
| 82 | httpGet: |
| 83 | path: /readz |
| 84 | port: 8080 |
| 85 | initialDelaySeconds: 10 |
| 86 | periodSeconds: 5 |
David K. Bainbridge | 707022f | 2020-01-23 14:15:07 -0800 | [diff] [blame] | 87 | {{- end }} |