David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 1 | # Copyright 2019-present Open Networking Foundation |
| 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. |
| 14 | |
| 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 | 5cb5d17 | 2019-07-24 02:30:19 +0000 | [diff] [blame] | 63 | image: {{ tpl .Values.images.ofagent.registry . }}{{ tpl .Values.images.ofagent.repository . }}:{{ tpl ( 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: |
| 69 | - "/ofagent/ofagent/main.py" |
| 70 | - "-v" |
| 71 | - "--controller=$(CONTROLLER_SERVICE)" |
| 72 | - "--grpc-endpoint=voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555" |