Skip to content

Commit bc86180

Browse files
committed
Moved PostgreSQL manifests to separate folder
1 parent 4ee27eb commit bc86180

File tree

6 files changed

+31
-30
lines changed

6 files changed

+31
-30
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,13 @@ push: ## Push to a Docker image registry
7575
$(info Logging into IBM Cloud cluster $(CLUSTER)...)
7676
docker push $(IMAGE)
7777

78+
.PHONY: postgres
79+
postgres: ## Deploy the PostgreSQL service on local Kubernetes
80+
$(info Deploying PostgreSQL service to Kubernetes...)
81+
kubectl apply -f k8s/postgres
82+
7883
.PHONY: deploy
79-
deploy: ## Deploy the service on local Kubernetes
84+
deploy: postgres ## Deploy the service on local Kubernetes
8085
$(info Deploying service locally...)
8186
kubectl apply -f k8s/
8287

k8s/pv.yaml renamed to k8s/postgres/pv.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ spec:
1111
persistentVolumeReclaimPolicy: Recycle
1212
hostPath:
1313
path: /data/pv0001
14-
storageClassName: "default"

k8s/postgres/pvc.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
apiVersion: v1
3+
kind: PersistentVolumeClaim
4+
metadata:
5+
name: postgres-pvc
6+
spec:
7+
accessModes:
8+
- ReadWriteOnce
9+
resources:
10+
requests:
11+
storage: 1Gi
File renamed without changes.

k8s/postgres/service.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: postgres
6+
labels:
7+
app: postgres
8+
spec:
9+
type: ClusterIP
10+
selector:
11+
app: postgres
12+
ports:
13+
- port: 5432
14+
targetPort: 5432

k8s/postgresql.yaml renamed to k8s/postgres/statefulset.yaml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,3 @@ spec:
4343
persistentVolumeClaim:
4444
claimName: postgres-pvc
4545
# emptyDir: {}
46-
47-
---
48-
apiVersion: v1
49-
kind: PersistentVolumeClaim
50-
metadata:
51-
name: postgres-pvc
52-
spec:
53-
accessModes:
54-
- ReadWriteOnce
55-
resources:
56-
requests:
57-
storage: 1Gi
58-
storageClassName: "default"
59-
60-
---
61-
apiVersion: v1
62-
kind: Service
63-
metadata:
64-
name: postgres
65-
labels:
66-
app: postgres
67-
spec:
68-
type: ClusterIP
69-
selector:
70-
app: postgres
71-
ports:
72-
- port: 5432
73-
targetPort: 5432

0 commit comments

Comments
 (0)