blob: c92c00c54ed8b843657a33da7f5cc76570f7c293 [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 }}
David Bainbridge534a73d2019-08-30 18:57:23 +000039 {{- 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 Bainbridge2f9b76f2019-05-15 13:48:11 -070052spec:
53 replicas: {{ .Values.replicas.cli }}
54 template:
55 metadata:
56 labels:
57 app: vcli
David Bainbridge1f888042019-06-24 18:02:01 +000058 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 Bainbridge534a73d2019-08-30 18:57:23 +000064 {{- 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 Bainbridge2f9b76f2019-05-15 13:48:11 -070074 annotations:
75 cni: "calico"
76 spec:
77 serviceAccountName: {{ .Values.serviceaccount }}
78 containers:
79 - name: vcli
David Bainbridge03706e62019-10-18 17:59:24 +000080 image: '{{ tpl .Values.images.cli.registry . }}{{ tpl .Values.images.cli.repository . }}:{{ tpl .Values.images.cli.tag . }}'
David Bainbridgecd30e542019-05-31 20:52:56 +000081 imagePullPolicy: {{ tpl .Values.images.cli.pullPolicy . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070082 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}}