mirror of
https://github.com/iflytek/skillhub.git
synced 2026-11-14 09:01:16 +00:00
Provide independent Kubernetes Umami deployment unit
Signed-off-by: 千乘妍 (Xiaoyaner) <258399167+xiaoyaner0201@users.noreply.github.com>
This commit is contained in:
parent
356a7e9366
commit
e499994912
1 changed files with 93 additions and 0 deletions
93
deploy/k8s/analytics-umami/umami.yaml
Normal file
93
deploy/k8s/analytics-umami/umami.yaml
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
# Independent analytics deployment unit; create namespace stats and secret umami-credentials first.
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: umami-postgres-data
|
||||
namespace: stats
|
||||
spec:
|
||||
accessModes: [ReadWriteOnce]
|
||||
resources:
|
||||
requests:
|
||||
storage: 2Gi
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: umami-postgres
|
||||
namespace: stats
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels: {app: umami-postgres}
|
||||
template:
|
||||
metadata:
|
||||
labels: {app: umami-postgres}
|
||||
spec:
|
||||
containers:
|
||||
- name: postgres
|
||||
image: postgres:16-alpine
|
||||
env:
|
||||
- {name: POSTGRES_DB, value: umami}
|
||||
- {name: POSTGRES_USER, value: umami}
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef: {name: umami-credentials, key: db-password}
|
||||
ports: [{containerPort: 5432}]
|
||||
readinessProbe:
|
||||
exec:
|
||||
command: [pg_isready, -U, umami, -d, umami]
|
||||
periodSeconds: 5
|
||||
volumeMounts:
|
||||
- {name: data, mountPath: /var/lib/postgresql/data}
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim: {claimName: umami-postgres-data}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: umami-postgres
|
||||
namespace: stats
|
||||
spec:
|
||||
selector: {app: umami-postgres}
|
||||
ports: [{port: 5432}]
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: umami
|
||||
namespace: stats
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels: {app: umami}
|
||||
template:
|
||||
metadata:
|
||||
labels: {app: umami}
|
||||
spec:
|
||||
containers:
|
||||
- name: umami
|
||||
image: ghcr.io/umami-software/umami:3.4.1
|
||||
env:
|
||||
- name: DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef: {name: umami-credentials, key: database-url}
|
||||
- name: APP_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef: {name: umami-credentials, key: app-secret}
|
||||
ports: [{containerPort: 3000}]
|
||||
readinessProbe:
|
||||
httpGet: {path: /login, port: 3000}
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: umami
|
||||
namespace: stats
|
||||
spec:
|
||||
selector: {app: umami}
|
||||
ports: [{port: 3000}]
|
||||
Loading…
Add table
Reference in a new issue