Some bug fixes
[ealt-edge.git] / mecm / mepm / applcm / resources / deployment / postgres-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
16 # postgres database
17 ---
18 apiVersion: apps/v1
19 kind: Deployment
20 metadata:
21   name: postgres-db
22   namespace: default
23   labels:
24     app: postgres-db
25 spec:
26   replicas: 1
27   selector:
28     matchLabels:
29       app: postgres-db
30   template:
31     metadata:
32       labels:
33         app: postgres-db
34     spec:
35       volumes:
36         - name: postgres-data
37           persistentVolumeClaim:
38             claimName: postgres-pv-claim
39       containers:
40         - name: postgres-db
41           image: postgres:9.6
42           imagePullPolicy: "IfNotPresent"
43           env:
44             - name: POSTGRES_DB
45               value: mecmdb
46             - name: POSTGRES_USER
47               value: root
48             - name: POSTGRES_PASSWORD
49               value: password
50           volumeMounts:
51             - mountPath: /var/lib/postgresql/data
52               name: postgres-data
53           ports:
54             - containerPort: 5432
55
56 # postgres service
57 ---
58 apiVersion: v1
59 kind: Service
60 metadata:
61   name: mecmdb
62   namespace: default
63 spec:
64   selector:
65     app: postgres-db
66   ports:
67     - name: "5432"
68       port: 5432
69       targetPort: 5432