Error handing and execution issue fixed
[ealt-edge.git] / mecm / mepm / applcm / resources / deployment / dbhost.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 # dbhost pod
15 ---
16 apiVersion: apps/v1
17 kind: Deployment
18 metadata:
19   labels:
20     dbhost.app: dbhost
21   name: dbhost
22 spec:
23   replicas: 1
24   selector:
25     matchLabels:
26       dbhost.app: dbhost
27   strategy:
28     type: Recreate
29   template:
30     metadata:
31       labels:
32         dbhost.app: dbhost
33     spec:
34       containers:
35         - image: mysql:5.7
36           imagePullPolicy: IfNotPresent
37           name: dbhost
38           ports:
39             - containerPort: 3306
40           env:
41             - name: MYSQL_DATABASE
42               value: dbhost
43             - name: MYSQL_PASSWORD
44               value: password
45             - name: MYSQL_ROOT_PASSWORD
46               value: password
47             - name: MYSQL_USER
48               value: root
49           volumeMounts:
50             - mountPath: /var/lib/mysql
51               name: my-db
52       volumes:
53         - name: my-db
54           hostPath:
55             # data folder needs to be created in host machine
56             path: /data
57
58 # dbhost service
59 ---
60 apiVersion: v1
61 kind: Service
62 metadata:
63   labels:
64     dbhost.service: dbhost
65   name: dbhost
66 spec: