mirror of
https://github.com/plausible/hosting.git
synced 2025-06-16 18:57:29 -05:00
added plausible init container, security context's & events-db configuration into configmap
This commit is contained in:
@ -36,14 +36,62 @@ spec:
|
||||
app.kubernetes.io/component: server
|
||||
spec:
|
||||
restartPolicy: Always
|
||||
# see https://github.com/plausible/analytics/blob/master/Dockerfile
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
fsGroup: 1000
|
||||
initContainers:
|
||||
- name: plausible-init
|
||||
image: plausible/analytics:latest
|
||||
command:
|
||||
- "/bin/sh"
|
||||
- "-c"
|
||||
args:
|
||||
- sleep 30 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh db init-admin
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: plausible-config
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: plausible-db-user
|
||||
key: username
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: plausible-db-user
|
||||
key: password
|
||||
- name: CLICKHOUSE_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: plausible-events-db-user
|
||||
key: username
|
||||
- name: CLICKHOUSE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: plausible-events-db-user
|
||||
key: password
|
||||
- name: DATABASE_URL
|
||||
value: postgres://$(POSTGRES_USER):$(POSTGRES_PASSWORD)@$(PLAUSIBLE_DB_SERVICE_HOST):$(PLAUSIBLE_DB_SERVICE_PORT)/plausible
|
||||
- name: CLICKHOUSE_DATABASE_URL
|
||||
value: http://$(CLICKHOUSE_USER):$(CLICKHOUSE_PASSWORD)@$(PLAUSIBLE_EVENTS_DB_SERVICE_HOST):$(PLAUSIBLE_EVENTS_DB_SERVICE_PORT)/plausible
|
||||
- name: SMTP_HOST_ADDR
|
||||
value: $(PLAUSIBLE_SMTP_SERVICE_HOST)
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
resources:
|
||||
limits:
|
||||
memory: 2Gi
|
||||
cpu: 1500m
|
||||
requests:
|
||||
memory: 50Mi
|
||||
cpu: 10m
|
||||
containers:
|
||||
- name: plausible
|
||||
image: plausible/analytics:latest
|
||||
imagePullPolicy: Always
|
||||
args:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh db init-admin && /entrypoint.sh run
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
envFrom:
|
||||
|
Reference in New Issue
Block a user