blob: fe5afa549fca76b8fc0363f4970062b959260de2 [file] [log] [blame]
David Bainbridge2f9b76f2019-05-15 13:48:11 -07001# 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---
17apiVersion: v1
18kind: Service
19metadata:
20 name: voltha-cli
21 serviceAccountName: {{ .Values.serviceaccount }}
22 labels:
23 name: vcli
24spec:
25 serviceAccountName: {{ .Values.serviceaccount }}
26 ports:
27 - name: ssh
28 port: 5022
29 targetPort: 22
30 selector:
31 app: vcli
32
33---
34apiVersion: apps/v1beta1
35kind: Deployment
36metadata:
37 name: voltha-cli-server
38 serviceAccountName: {{ .Values.serviceaccount }}
39spec:
40 replicas: {{ .Values.replicas.cli }}
41 template:
42 metadata:
43 labels:
44 app: vcli
David Bainbridge1f888042019-06-24 18:02:01 +000045 app.kubernetes.io/name: "cli-server"
46 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
47 app.kubernetes.io/component: "cli"
48 app.kubernetes.io/part-of: "voltha"
49 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
50 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
David Bainbridge2f9b76f2019-05-15 13:48:11 -070051 annotations:
52 cni: "calico"
53 spec:
54 serviceAccountName: {{ .Values.serviceaccount }}
55 containers:
56 - name: vcli
David Bainbridgecd30e542019-05-31 20:52:56 +000057 image: {{ tpl .Values.images.cli.registry . }}{{ tpl .Values.images.cli.repository . }}:{{ tpl .Values.images.cli.tag . }}
58 imagePullPolicy: {{ tpl .Values.images.cli.pullPolicy . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070059 env:
60 - name: POD_IP
61 valueFrom:
62 fieldRef:
63 fieldPath: status.podIP
64 args:
65 - "/voltha/python/cli/setup.sh"
66 - "-g voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555"
67 ports:
68 - containerPort: 22
69 name: ssh-port
70{{- end}}