updaed docker file for ssh pass support
[ealt-edge.git] / example-apps / ROBO / backup_BE / backup-k8s.yaml
1 # Copyright 2020 Huawei Technologies Co., Ltd.
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 apiVersion: apps/v1
16 kind: Deployment
17 metadata:
18   name: backup-be
19 spec:
20   replicas: 1
21   selector:
22     matchLabels:
23       app: backup
24   template:
25     metadata:
26       labels:
27         app: backup
28     spec:
29       volumes:
30         - name: task-pv-storage
31           persistentVolumeClaim:
32             claimName: task-pv-claim
33       containers:
34         - name: backup-be
35           image: ealtedge/robo-be
36           env:
37             - name: KUBE_CONFIG
38               value: "/usr/app/.kube/config"
39             - name: HOSTIP
40               value: "10.10.0.54"
41
42           ports:
43             - containerPort: 8091
44           volumeMounts:
45             - name: task-pv-storage
46               mountPath: "/usr/app/.kube/"
47
48 # PV with host path of kubeconfig in VM
49 ---
50 apiVersion: v1
51 kind: PersistentVolume
52 metadata:
53   name: task-pv-volume
54   labels:
55     type: local
56 spec:
57   storageClassName: manual
58   capacity:
59     storage: 1Gi
60   accessModes:
61     - ReadWriteOnce
62   hostPath:
63     path: "/root/.kube/"
64
65 # pvc
66 ---
67 apiVersion: v1
68 kind: PersistentVolumeClaim
69 metadata:
70   name: task-pv-claim
71 spec:
72   storageClassName: manual
73   accessModes:
74     - ReadWriteOnce
75   resources:
76     requests:
77       storage: 1Gi
78
79 # backup-be serice
80 ---
81 apiVersion: v1
82 kind: Service
83 metadata:
84   name: backup-be
85 spec:
86   selector:
87     app: backup
88   type: NodePort
89   ports:
90     - port: 8091
91       name: service-port
92       nodePort: 30091