Skip to content

Commit

Permalink
🔨 chore: k8s manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
Zerohertz committed Jan 7, 2025
1 parent 9c4d769 commit e5a4bd6
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ out/

### Credentials ###
.env
k8s/secrets.yaml
secrets.yaml

### Etc ###
.DS_Store
86 changes: 86 additions & 0 deletions k8s/deploy/backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend
spec:
replicas: 1
selector:
matchLabels:
app: backend
template:
metadata:
labels:
app: backend
spec:
containers:
- name: backend
image: ghcr.io/co-co-gong-server:tag
env:
- name: POSTGRES_HOST
value: "postgres"
- name: POSTGRES_PORT
valueFrom:
configMapKeyRef:
name: postgres-config
key: POSTGRES_PORT
- name: POSTGRES_USER
valueFrom:
configMapKeyRef:
name: postgres-config
key: POSTGRES_USER
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-secret
key: POSTGRES_PASSWORD
- name: POSTGRES_DB
valueFrom:
configMapKeyRef:
name: postgres-config
key: POSTGRES_DB
- name: GITHUB_REDIRECT_URI
valueFrom:
secretKeyRef:
name: oauth-secret
key: GITHUB_REDIRECT_URI
- name: GITHUB_CLIENT_ID
valueFrom:
secretKeyRef:
name: oauth-secret
key: GITHUB_CLIENT_ID
- name: GITHUB_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: oauth-secret
key: GITHUB_CLIENT_SECRET
- name: JWT_SECRET_KEY
valueFrom:
secretKeyRef:
name: jwt-secret
key: JWT_SECRET_KEY
---
apiVersion: v1
kind: Service
metadata:
name: backend
spec:
ports:
- port: 8080
selector:
app: backend
---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: co-co-gong
spec:
entryPoints:
- websecure
routes:
- match: Host(`co-co-gong.zerohertz.xyz`)
kind: Rule
services:
- name: backend
port: 8080
tls:
certResolver: zerohertz-resolver
File renamed without changes.
2 changes: 1 addition & 1 deletion k8s/backend.yaml → k8s/local/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ spec:
entryPoints:
- websecure
routes:
- match: Host(`co-co-gong.zerohertz.xyz`)
- match: Host(`co-co-gong-dev.zerohertz.xyz`)
kind: Rule
services:
- name: backend
Expand Down
47 changes: 47 additions & 0 deletions k8s/local/postgresql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:latest
env:
- name: POSTGRES_DB
valueFrom:
configMapKeyRef:
name: postgres-config
key: POSTGRES_DB
- name: POSTGRES_USER
valueFrom:
configMapKeyRef:
name: postgres-config
key: POSTGRES_USER
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-secret
key: POSTGRES_PASSWORD
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
ports:
- containerPort: 5432
---
apiVersion: v1
kind: Service
metadata:
name: postgres
spec:
ports:
- port: 5432
selector:
app: postgres

0 comments on commit e5a4bd6

Please sign in to comment.