Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions k8s/database/postgresql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres-db
namespace: portfolio
spec:
replicas: 1
selector:
matchLabels:
app: postgres-db
template:
metadata:
labels:
app: postgres-db
spec:
containers:

Check warning on line 16 in k8s/database/postgresql.yaml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Bind this resource's automounted service account to RBAC or disable automounting.

See more on https://sonarcloud.io/project/issues?id=devflima_flima.dev&issues=AZ3-h52TN4MsFItISaZm&open=AZ3-h52TN4MsFItISaZm&pullRequest=16
- name: postgres-db

Check warning on line 17 in k8s/database/postgresql.yaml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Specify a storage limit for this container.

See more on https://sonarcloud.io/project/issues?id=devflima_flima.dev&issues=AZ3-h52TN4MsFItISaZn&open=AZ3-h52TN4MsFItISaZn&pullRequest=16

Check warning on line 17 in k8s/database/postgresql.yaml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Specify a memory limit for this container.

See more on https://sonarcloud.io/project/issues?id=devflima_flima.dev&issues=AZ3-h52TN4MsFItISaZk&open=AZ3-h52TN4MsFItISaZk&pullRequest=16

Check warning on line 17 in k8s/database/postgresql.yaml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Specify a memory request for this container.

See more on https://sonarcloud.io/project/issues?id=devflima_flima.dev&issues=AZ3-h52TN4MsFItISaZp&open=AZ3-h52TN4MsFItISaZp&pullRequest=16

Check warning on line 17 in k8s/database/postgresql.yaml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Specify a CPU request for this container.

See more on https://sonarcloud.io/project/issues?id=devflima_flima.dev&issues=AZ3-h52TN4MsFItISaZo&open=AZ3-h52TN4MsFItISaZo&pullRequest=16

Check warning on line 17 in k8s/database/postgresql.yaml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Specify a storage request for this container.

See more on https://sonarcloud.io/project/issues?id=devflima_flima.dev&issues=AZ3-h52TN4MsFItISaZl&open=AZ3-h52TN4MsFItISaZl&pullRequest=16
image: postgres:16
ports:
- containerPort: 5432
env:
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: backend-secrets
key: DB_USER
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: backend-secrets
key: DB_PASSWORD
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: backend-secrets
key: DB_NAME
volumeMounts:
- name: postgres-storage
mountPath: /var/lib/postgresql/data
volumes:
- name: postgres-storage
persistentVolumeClaim:
claimName: postgres-pvc
---
apiVersion: v1
kind: Service
metadata:
name: postgres-db
namespace: portfolio
spec:
selector:
app: postgres-db
ports:
- protocol: TCP
port: 5432
targetPort: 5432
type: ClusterIP
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pvc
namespace: portfolio
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi