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 }} |
| 39 | spec: |
| 40 | replicas: {{ .Values.replicas.cli }} |
| 41 | template: |
| 42 | metadata: |
| 43 | labels: |
| 44 | app: vcli |
| 45 | annotations: |
| 46 | cni: "calico" |
| 47 | spec: |
| 48 | serviceAccountName: {{ .Values.serviceaccount }} |
| 49 | containers: |
| 50 | - name: vcli |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 51 | image: {{ tpl .Values.images.cli.registry . }}{{ tpl .Values.images.cli.repository . }}:{{ tpl .Values.images.cli.tag . }} |
| 52 | imagePullPolicy: {{ tpl .Values.images.cli.pullPolicy . }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 53 | env: |
| 54 | - name: POD_IP |
| 55 | valueFrom: |
| 56 | fieldRef: |
| 57 | fieldPath: status.podIP |
| 58 | args: |
| 59 | - "/voltha/python/cli/setup.sh" |
| 60 | - "-g voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555" |
| 61 | ports: |
| 62 | - containerPort: 22 |
| 63 | name: ssh-port |
| 64 | {{- end}} |