Skip to content

Commit

Permalink
Merge pull request #8 from jaycode/main
Browse files Browse the repository at this point in the history
Update psycopg requirement to one compatible with the workspace and update deployment yaml files to follow rubric requirements
  • Loading branch information
SudKul authored Apr 5, 2024
2 parents 884c8d4 + 08d670e commit b66d3b2
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 21 deletions.
2 changes: 1 addition & 1 deletion analytics/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ APScheduler==3.10.4
Flask==3.0.2
flask_sqlalchemy==3.1.1
SQLAlchemy==2.0.27
psycopg2==2.9.9
psycopg2-binary==2.9.9
17 changes: 17 additions & 0 deletions deployment-local/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: <NAME OF THE ConfigMap>
data:
DB_NAME: <ENTER YOUR DB NAME HERE>
DB_USER: <ENTER YOUR USER NAME HERE>
DB_HOST: <ENTER YOUR DB HOST HERE>
DB_PORT: <ENTER YOUR DB PORT HERE>
---
apiVersion: v1
kind: Secret
metadata:
name: <NAME OF THE Secret>
type: Opaque
data:
<THE KEY FROM Secret WHICH has THE ENCODED PASSWORD>: <OUTPUT OF `echo -n 'the password' | base64`>
17 changes: 7 additions & 10 deletions deployment-local/coworking.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: Service
metadata:
name: coworking
spec:
# A local environment doesn't generally have a LoadBalancer, so we use NodePort instead.
type: NodePort
selector:
service: coworking
Expand Down Expand Up @@ -30,6 +31,7 @@ spec:
spec:
containers:
- name: coworking
# Locally hosted docker image
image: <DOCKER_IMAGE_NAME>:<IMAGE_TAG>
imagePullPolicy: IfNotPresent
livenessProbe:
Expand All @@ -44,18 +46,13 @@ spec:
port: 5153
initialDelaySeconds: 5
timeoutSeconds: 5
envFrom:
- configMapRef:
name: <NAME OF THE ConfigMap>
env:
- name: DB_HOST
value: <SERVICE_NAME>-postgresql
- name: DB_PORT
value: "5432"
- name: DB_USERNAME
value: postgres
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: <SERVICE_NAME>-postgresql
key: postgres-password
- name: DB_NAME
value: postgres
name: <NAME OF THE Secret>
key: <THE KEY FROM Secret WHICH has THE ENCODED PASSWORD>
restartPolicy: Always
17 changes: 17 additions & 0 deletions deployment/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: <NAME OF THE ConfigMap>
data:
DB_NAME: <ENTER YOUR DB NAME HERE>
DB_USER: <ENTER YOUR USER NAME HERE>
DB_HOST: <ENTER YOUR DB HOST HERE>
DB_PORT: <ENTER YOUR DB PORT HERE>
---
apiVersion: v1
kind: Secret
metadata:
name: <NAME OF THE Secret>
type: Opaque
data:
<THE KEY FROM Secret WHICH has THE ENCODED PASSWORD>: <OUTPUT OF `echo -n 'the password' | base64`>
15 changes: 5 additions & 10 deletions deployment/coworking.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,13 @@ spec:
port: 5153
initialDelaySeconds: 5
timeoutSeconds: 5
envFrom:
- configMapRef:
name: <NAME OF THE ConfigMap>
env:
- name: DB_HOST
value: <SERVICE_NAME>-postgresql
- name: DB_PORT
value: "5432"
- name: DB_USERNAME
value: postgres
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: <SERVICE_NAME>-postgresql
key: postgres-password
- name: DB_NAME
value: postgres
name: <NAME OF THE Secret>
key: <THE KEY FROM Secret WHICH has THE ENCODED PASSWORD>
restartPolicy: Always

0 comments on commit b66d3b2

Please sign in to comment.