Skip to content

Commit

Permalink
Moved PostgreSQL manifests to separate folder
Browse files Browse the repository at this point in the history
  • Loading branch information
rofrano committed Jul 13, 2024
1 parent 4ee27eb commit bc86180
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 30 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,13 @@ push: ## Push to a Docker image registry
$(info Logging into IBM Cloud cluster $(CLUSTER)...)
docker push $(IMAGE)

.PHONY: postgres
postgres: ## Deploy the PostgreSQL service on local Kubernetes
$(info Deploying PostgreSQL service to Kubernetes...)
kubectl apply -f k8s/postgres

.PHONY: deploy
deploy: ## Deploy the service on local Kubernetes
deploy: postgres ## Deploy the service on local Kubernetes
$(info Deploying service locally...)
kubectl apply -f k8s/

Expand Down
1 change: 0 additions & 1 deletion k8s/pv.yaml → k8s/postgres/pv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ spec:
persistentVolumeReclaimPolicy: Recycle
hostPath:
path: /data/pv0001
storageClassName: "default"
11 changes: 11 additions & 0 deletions k8s/postgres/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
File renamed without changes.
14 changes: 14 additions & 0 deletions k8s/postgres/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: v1
kind: Service
metadata:
name: postgres
labels:
app: postgres
spec:
type: ClusterIP
selector:
app: postgres
ports:
- port: 5432
targetPort: 5432
28 changes: 0 additions & 28 deletions k8s/postgresql.yaml → k8s/postgres/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,3 @@ spec:
persistentVolumeClaim:
claimName: postgres-pvc
# emptyDir: {}

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: "default"

---
apiVersion: v1
kind: Service
metadata:
name: postgres
labels:
app: postgres
spec:
type: ClusterIP
selector:
app: postgres
ports:
- port: 5432
targetPort: 5432

0 comments on commit bc86180

Please sign in to comment.