Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

feat: backstage with all postgres instances #395

Merged
merged 1 commit into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions hack/manifests/backstage/app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ parodos:
workflows:
assessment: 'onboardingAssessment_ASSESSMENT_WORKFLOW'
assessmentTask: 'onboardingAssessmentTask'
pollingInterval: 10000

organization:
name: My Company
Expand Down
2 changes: 1 addition & 1 deletion hack/manifests/backstage/backstage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
- "packages/backend"
- "--config"
- "/app/app-config.yaml"
image: quay.io/parodos-dev/backstage-parodos:latest
image: quay.io/parodos-dev/backstage-parodos:latest-openshift
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any changes how we build the image specific to ocp?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As agreed, let's have this in and check whether we can use the same image everywhere

imagePullPolicy: Always
ports:
- name: backend
Expand Down
13 changes: 13 additions & 0 deletions hack/manifests/backstage/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ bases:
resources:
- namespace.yaml
- postgres.yaml
- postgres-parodos.yaml
- backstage.yaml

patchesStrategicMerge:
- parodos-patch.yaml

configMapGenerator:
- name: app-config
namespace: backstage
Expand All @@ -18,3 +22,12 @@ secretGenerator:
literals:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=admin
- PGDATA=/var/lib/postgresql/data/mydata

- name: postgres-secrets-default
namespace: default
literals:
- POSTGRES_USER=parodos
- POSTGRES_PASSWORD=parodos
- POSTGRES_DB=parodos
- PGDATA=/var/lib/postgresql/data/mydata
23 changes: 23 additions & 0 deletions hack/manifests/backstage/parodos-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: workflow-service-config
data:
DATASOURCE_URL: "jdbc:postgresql://postgres:5432/parodos"
DATASOURCE_DRIVER: "org.postgresql.Driver"
DATASOURCE_USERNAME: "parodos"
DATASOURCE_PASSWORD: "parodos"
SPRING_PROFILES_ACTIVE: "local"
NOTIFICATION_SERVER_ADDRESS: "notification-service.default.svc.cluster.local"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: notification-service-config
data:
DATASOURCE_URL: "jdbc:postgresql://postgres:5432/parodos"
DATASOURCE_DRIVER: "org.postgresql.Driver"
DATASOURCE_USERNAME: "parodos"
DATASOURCE_PASSWORD: "parodos"
SPRING_PROFILES_ACTIVE: "local"
65 changes: 65 additions & 0 deletions hack/manifests/backstage/postgres-parodos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pvc
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:13.2-alpine
imagePullPolicy: 'IfNotPresent'
ports:
- containerPort: 5432
volumeMounts:
- name: storage
mountPath: /var/lib/postgresql/data
envFrom:
- secretRef:
name: postgres-secrets-default
readinessProbe:
exec:
command: ["pg_isready"]
initialDelaySeconds: 15
timeoutSeconds: 2
livenessProbe:
exec:
command: ["pg_isready"]
initialDelaySeconds: 15
timeoutSeconds: 2
volumes:
- name: storage
persistentVolumeClaim:
claimName: postgres-pvc
---
apiVersion: v1
kind: Service
metadata:
name: postgres
namespace: default
spec:
selector:
app: postgres
ports:
- port: 5432
29 changes: 29 additions & 0 deletions hack/manifests/backstage/postgres.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pvc
namespace: backstage
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -20,9 +32,26 @@ spec:
imagePullPolicy: 'IfNotPresent'
ports:
- containerPort: 5432
volumeMounts:
- name: storage
mountPath: /var/lib/postgresql/data
envFrom:
- secretRef:
name: postgres-secrets
readinessProbe:
exec:
command: ["pg_isready"]
initialDelaySeconds: 15
timeoutSeconds: 2
livenessProbe:
exec:
command: ["pg_isready"]
initialDelaySeconds: 15
timeoutSeconds: 2
volumes:
- name: storage
persistentVolumeClaim:
claimName: postgres-pvc
---
apiVersion: v1
kind: Service
Expand Down