~sbaildon/dev_cluster

ref: dcdef6b0d7f5e3ec72a2b446205e0d8a97f6baf8 dev_cluster/plausible/deployment.yaml -rw-r--r-- 2.3 KiB
dcdef6b0Sean Baildon plausible restart on failure only 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
apiVersion: apps/v1
kind: Deployment
metadata:
  name: plausible
  labels:
    app.kubernetes.io/name: plausible
    app.kubernetes.io/component: server
spec:
  # Plausible is not currently designed to run in a clustered scenario. Increasing the replicas of this deployment is highly NOT recommended!
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: plausible
      app.kubernetes.io/component: server
  template:
    metadata:
      labels:
        app.kubernetes.io/name: plausible
        app.kubernetes.io/component: server
    spec:
      restartPolicy: OnFailure
      # 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:
            - secretRef:
                name: plausible-config
          securityContext:
            allowPrivilegeEscalation: false
          resources:
            limits:
              memory: 2Gi
              cpu: 1500m
            requests:
              memory: 50Mi
              cpu: 10m
      containers:
        - name: plausible
          image: plausible/analytics:latest
          imagePullPolicy: Always
          ports:
            - name: web
              containerPort: 8000
              protocol: TCP
          envFrom:
            - secretRef:
                name: plausible-config
          securityContext:
            allowPrivilegeEscalation: false
          resources:
            limits:
              memory: 2Gi
              cpu: 1500m
            requests:
              memory: 140Mi
              cpu: 10m
          readinessProbe:
            httpGet:
              path: /api/health
              port: 8000
            initialDelaySeconds: 35
            failureThreshold: 6
            periodSeconds: 10
          livenessProbe:
            httpGet:
              path: /api/health
              port: 8000
            initialDelaySeconds: 45
            failureThreshold: 3
            periodSeconds: 10