Skip to content

Commit

Permalink
Add kubernetes manifests for local cluster
Browse files Browse the repository at this point in the history
Signed-off-by: William <[email protected]>
  • Loading branch information
kwesidev committed Jan 29, 2024
1 parent 09a86b6 commit d7f1eee
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 0 deletions.
45 changes: 45 additions & 0 deletions kubernetes_local/mailhog_service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: mailhog
name: mailhog
spec:
replicas: 1
selector:
matchLabels:
app: mailhog
strategy: {}
template:
metadata:
labels:
app: mailhog
spec:
containers:
- image: mailhog/mailhog:latest
name: mailhog
ports:
- containerPort: 1025
- containerPort: 8025
resources: {}
restartPolicy: Always
status: {}
---
apiVersion: v1
kind: Service
metadata:
labels:
app: mailhog
name: mailhog
spec:
ports:
- name: "1025"
port: 1025
targetPort: 1025
- name: "8025"
port: 8025
targetPort: 8025
selector:
app: mailhog
status:
loadBalancer: {}
47 changes: 47 additions & 0 deletions kubernetes_local/postgresqldb_service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: postgresqldb
name: postgresqldb
spec:
replicas: 1
selector:
matchLabels:
app: postgresqldb
strategy: {}
template:
metadata:
labels:
app: postgresqldb
spec:
containers:
- env:
- name: POSTGRES_DB
value: speedyauth
- name: POSTGRES_PASSWORD
value: root
- name: POSTGRES_USER
value: postgres
image: postgres:16.1-alpine
name: postgresqldb
resources: {}
restartPolicy: Always
status: {}
---
apiVersion: v1
kind: Service
metadata:
labels:
app: postgresqldb
name: postgresqldb
spec:
ports:
- name: "5432"
port: 5432
targetPort: 5432
selector:
app: postgresqldb
status:
loadBalancer: {}

72 changes: 72 additions & 0 deletions kubernetes_local/speedy_auth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: speedyauth
name: speedyauth
spec:
replicas: 1
selector:
matchLabels:
app: speedyauth
strategy: {}
template:
metadata:
labels:
app: speedyauth
spec:
initContainers:
- name: migrations
image: migrate/migrate:latest
command: ['/migrate']
args: ['-source', 'github://kwesidev/speedyauth/db/migrations', '-database', 'postgres://postgres:root@postgresqldb:5432/speedyauth?sslmode=disable', 'up']
containers:
- env:
- name: FROM_EMAIL_ADDRESS
value: noreply@localhost
- name: ISSUER_NAME
value: localhost
- name: PG_DB
value: speedyauth
- name: PG_HOST
value: postgresqldb
- name: PG_PASSWORD
value: root
- name: PG_PORT
value: "5432"
- name: PG_SSL
value: "False"
- name: PG_USER
value: postgres
- name: SERVER_ADDRESS
- name: SERVER_PORT
value: "8080"
- name: SMTP_HOST
value: mailhog
- name: SMTP_PORT
value: "1025"
- name: TOKEN_EXPIRY_TIME
value: 15m
image: kwesidev/speedyauth:latest
name: app
ports:
- containerPort: 8080
resources: {}
restartPolicy: Always
status: {}
---
apiVersion: v1
kind: Service
metadata:
labels:
app: speedyauth
name: speedyauth
spec:
ports:
- name: "8080"
port: 8080
targetPort: 8080
selector:
app: speedyauth
status:
loadBalancer: {}

0 comments on commit d7f1eee

Please sign in to comment.