added docker and kubenetes yaml file
[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: khemendra/backup:1.1
36           env:
37             - name: KUBE_CONFIG
38               value: "/usr/app/.kube/config"
39           ports:
40             - containerPort: 8091
41           volumeMounts:
42             - name: task-pv-storage
43               mountPath: "/usr/app/.kube/"
44
45 # PV with host path of kubeconfig in VM
46 ---
47 apiVersion: v1
48 kind: PersistentVolume
49 metadata:
50   name: task-pv-volume
51   labels:
52     type: local
53 spec:
54   storageClassName: manual
55   capacity:
56     storage: 1Gi
57   accessModes:
58     - ReadWriteOnce
59   hostPath:
60     path: "/home/root1/.kube/"
61
62 # pvc
63 ---
64 apiVersion: v1
65 kind: PersistentVolumeClaim
66 metadata:
67   name: task-pv-claim
68 spec:
69   storageClassName: manual
70   accessModes:
71     - ReadWriteOnce
72   resources:
73     requests:
74       storage: 1Gi
75
76 # backup-be serice
77 ---
78 apiVersion: v1
79 kind: Service
80 metadata:
81   name: backup-be
82 spec:
83   selector:
84     app: backup
85   type: NodePort
86   ports:
87     - port: 8091
88       name: service-port
89       nodePort: 30091