about summary refs log tree commit diff
path: root/bundles/timelinize/files/kube.yaml
blob: cb47ee2c1282c83e0dcb92364adfa50bf9b9abdd (plain) (blame)
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
apiVersion: v1
kind: ConfigMap
metadata:
  name: dawarich
data:
  RAILS_ENV: production
  REDIS_URL: redis://redis:6379
  DATABASE_HOST: postgis
  DATABASE_PORT: 5432
  MIN_MINUTES_SPENT_IN_CITY: 60
  APPLICATION_HOSTS: dawarich.iz.ts.gzr.im,dawarich.gzr.im
  TIME_ZONE: Europe/Berlin
  APPLICATION_PROTOCOL: http
  PROMETHEUS_EXPORTER_ENABLED: false
  PROMETHEUS_EXPORTER_HOST: 0.0.0.0
  PROMETHEUS_EXPORTER_PORT: 9394
  SECRET_KEY_BASE: 1234567890
  RAILS_LOG_TO_STDOUT: "true"
  SELF_HOSTED: "true"
  STORE_GEODATA: "true"
  BACKGROUND_PROCESSING_CONCURRENCY: 10
---
apiVersion: v1
kind: Pod
metadata:
  name: dawarich
  labels:
    traefik.enable: true
    traefik.http.routers.dawarich.tls: false
    traefik.http.routers.dawarich.tls.certresolver: le
    traefik.http.routers.dawarich.entrypoints: http,https
    traefik.http.routers.dawarich.rule: Host(`dawarich.iz.ts.gzr.im`)
    traefik.http.routers.dawarich.service: dawarich
    traefik.http.services.dawarich.loadbalancer.server.port: 3000
spec:
  restartPolicy: Always
  dnsPolicy: Default
  containers:
    - name: dawarich
      image: docker.io/freikin/dawarich:0.30.11
      command: ['web-entrypoint.sh', 'rails', 'server', '-p', '3000', '-b', '::']
      envFrom:
        - configMapRef:
            name: dawarich
        - secretRef:
            name: dawarich
      ports:
        - containerPort: 3000
          protocol: TCP
        # - containerPort: 9394 # prom
        #   protocol: TCP
      volumeMounts:
        - name: public
          mountPath: /var/app/public
        - name: import
          mountPath: /var/app/tmp/imports/watched
        - name: data
          mountPath: /var/app/storage
      livenessProbe:
        exec:
          command: ["sh", "-c", "wget -qO - http://127.0.0.1:3000/api/v1/health | grep -q '\"status\"\\s*:\\s*\"ok\"'"]
      # resources:
      #   limits:
      #     cpu: 300m
      #     memory: 512Mi

    - name: sidekiq
      image: docker.io/freikin/dawarich:0.30.11
      command: ['sidekiq-entrypoint.sh', 'sidekiq']
      envFrom:
        - configMapRef:
            name: dawarich
        - secretRef:
            name: dawarich
      livenessProbe:
        exec:
          command: ["sh", "-c", "pgrep -f sidekiq"]

    - name: redis
      image: docker.io/redis:7.4-alpine
      livenessProbe:
        exec:
          command: ["sh", "-c", "redis-cli ping || exit 1"]

    - name: postgis
      image: postgis/postgis:17-3.5-alpine
      envFrom:
        - secretRef:
            name: dawarich
      volumeMounts:
        - name: pg-data
          mountPath: /var/lib/postgresql/data
      livenessProbe:
        exec:
          command:
            - /bin/sh
            - -c
            - pg_isready -d '${POSTGRES_DB}' -U '${POSTGRES_USER}' || exit 1

  volumes:
    - name: public
      hostPath:
        path: /var/lib/dawarich/public
        type: DirectoryOrCreate
    - name: import
      hostPath:
        path: /var/lib/dawarich/import
        type: DirectoryOrCreate
    - name: data
      hostPath:
        path: /var/lib/dawarich/data
        type: DirectoryOrCreate
    - name: pg-data
      hostPath:
        path: /var/lib/dawarich/db
        type: DirectoryOrCreate