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 | {{- if .Values.replicas.cli }} |
| 16 | --- |
| 17 | apiVersion: v1 |
| 18 | kind: Service |
| 19 | metadata: |
| 20 | name: voltha-cli |
| 21 | serviceAccountName: {{ .Values.serviceaccount }} |
| 22 | labels: |
| 23 | name: vcli |
| 24 | spec: |
| 25 | serviceAccountName: {{ .Values.serviceaccount }} |
| 26 | ports: |
| 27 | - name: ssh |
| 28 | port: 5022 |
| 29 | targetPort: 22 |
| 30 | selector: |
| 31 | app: vcli |
| 32 | |
| 33 | --- |
| 34 | apiVersion: apps/v1beta1 |
| 35 | kind: Deployment |
| 36 | metadata: |
| 37 | name: voltha-cli-server |
| 38 | serviceAccountName: {{ .Values.serviceaccount }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 39 | {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "cli_deployment_labels") }} |
| 40 | labels: |
| 41 | {{- if hasKey .Values "extra_deployment_labels" }} |
| 42 | {{- range $key, $val := .Values.extra_deployment_labels }} |
| 43 | {{ $key }}: {{ $val | quote }} |
| 44 | {{- end }} |
| 45 | {{- end }} |
| 46 | {{- if hasKey .Values "cli_deployment_labels" }} |
| 47 | {{- range $key, $val := .Values.cli_deployment_labels }} |
| 48 | {{ $key }}: {{ $val | quote }} |
| 49 | {{- end }} |
| 50 | {{- end }} |
| 51 | {{- end }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 52 | spec: |
| 53 | replicas: {{ .Values.replicas.cli }} |
| 54 | template: |
| 55 | metadata: |
| 56 | labels: |
| 57 | app: vcli |
David Bainbridge | 1f88804 | 2019-06-24 18:02:01 +0000 | [diff] [blame] | 58 | app.kubernetes.io/name: "cli-server" |
| 59 | app.kubernetes.io/version: {{ quote .Chart.AppVersion }} |
| 60 | app.kubernetes.io/component: "cli" |
| 61 | app.kubernetes.io/part-of: "voltha" |
| 62 | app.kubernetes.io/managed-by: {{ quote .Release.Service }} |
| 63 | helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 64 | {{- if hasKey .Values "extra_pod_labels" }} |
| 65 | {{- range $key, $val := .Values.extra_pod_labels }} |
| 66 | {{ $key }}: {{ $val | quote }} |
| 67 | {{- end }} |
| 68 | {{- end }} |
| 69 | {{- if hasKey .Values "cli_pod_labels" }} |
| 70 | {{- range $key, $val := .Values.cli_pod_labels }} |
| 71 | {{ $key }}: {{ $val | quote }} |
| 72 | {{- end }} |
| 73 | {{- end }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 74 | annotations: |
| 75 | cni: "calico" |
| 76 | spec: |
| 77 | serviceAccountName: {{ .Values.serviceaccount }} |
| 78 | containers: |
| 79 | - name: vcli |
David Bainbridge | 5cb5d17 | 2019-07-24 02:30:19 +0000 | [diff] [blame] | 80 | image: {{ tpl .Values.images.cli.registry . }}{{ tpl .Values.images.cli.repository . }}:{{ tpl ( tpl .Values.images.cli.tag . ) . }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 81 | imagePullPolicy: {{ tpl .Values.images.cli.pullPolicy . }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 82 | env: |
| 83 | - name: POD_IP |
| 84 | valueFrom: |
| 85 | fieldRef: |
| 86 | fieldPath: status.podIP |
| 87 | args: |
| 88 | - "/voltha/python/cli/setup.sh" |
| 89 | - "-g voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555" |
| 90 | ports: |
| 91 | - containerPort: 22 |
| 92 | name: ssh-port |
| 93 | {{- end}} |