diff --git a/services/Dawarich/_namespace-dawarich.yml b/services/Dawarich/_namespace-dawarich.yml new file mode 100644 index 0000000..c452ed7 --- /dev/null +++ b/services/Dawarich/_namespace-dawarich.yml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: dawarich diff --git a/services/Dawarich/deployment-dawarich.yaml b/services/Dawarich/deployment-dawarich.yaml new file mode 100644 index 0000000..91cf2df --- /dev/null +++ b/services/Dawarich/deployment-dawarich.yaml @@ -0,0 +1,116 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: dawarich + namespace: dawarich + labels: + app: dawarich +spec: + replicas: 1 + selector: + matchLabels: + app: dawarich + strategy: + type: Recreate + template: + metadata: + labels: + app: dawarich + spec: + enableServiceLinks: false + containers: + - name: dawarich + image: freikin/dawarich:0.24.0 + env: + - name: REDIS_URL + value: redis://dawarich.dawarich.svc.cluster.local:6379/0 + - name: DATABASE_HOST + value: dawarich.dawarich.svc.cluster.local + - name: DATABASE_USERNAME + value: dawarich + - name: DATABASE_PASSWORD + value: dawarich + - name: DATABASE_NAME + value: dawarich + - name: DISABLE_TELEMETRY + value: "true" + - name: APPLICATION_HOST + value: timeline.spamasaurus.com + - name: APPLICATION_HOSTS + value: timeline.spamasaurus.com + - name: TIME_ZONE + value: Australia/Melbourne + - name: REVERSE_GEOCODING_ENABLED + value: "true" + - name: MIN_MINUTES_SPENT_IN_CITY + value: "30" + - name: DISTANCE_UNIT + value: km + command: + - web-entrypoint.sh + args: + - 'bin/rails server -p 3000 -b ::' + ports: + - name: app + containerPort: 3000 + volumeMounts: + - name: flexvolsmb-dawarich-data + mountPath: /var/app/public + - name: sidekiq + image: freikin/dawarich:0.24.0 + env: + - name: REDIS_URL + value: redis://dawarich.dawarich.svc.cluster.local:6379/0 + - name: DATABASE_HOST + value: dawarich.dawarich.svc.cluster.local + - name: DATABASE_USERNAME + value: dawarich + - name: DATABASE_PASSWORD + value: dawarich + - name: DATABASE_NAME + value: dawarich + command: + - sidekiq-entrypoint.sh + args: + - "bundle exec sidekiq" + volumeMounts: + - name: flexvolsmb-dawarich-data + mountPath: /var/app/public + - name: redis + image: redis:7-alpine + ports: + - name: redis + containerPort: 6379 + volumeMounts: + - name: flexvolsmb-dawarich-redis + mountPath: /data + - name: db + image: postgis/postgis:16-3.5-alpine + securityContext: + runAsUser: 70 + runAsGroup: 70 + env: + - name: PGDATA + value: /var/lib/postgresql/data/pgdata + - name: POSTGRES_DATABASE + value: dawarich + - name: POSTGRES_PASSWORD + value: dawarich + - name: POSTGRES_USER + value: dawarich + volumeMounts: + - name: flexvolsmb-dawarich-db + mountPath: /var/lib/postgresql/data + ports: + - name: db + containerPort: 5432 + volumes: + - name: flexvolsmb-dawarich-db + persistentVolumeClaim: + claimName: flexvolsmb-dawarich-db + - name: flexvolsmb-dawarich-redis + persistentVolumeClaim: + claimName: flexvolsmb-dawarich-redis + - name: flexvolsmb-dawarich-data + persistentVolumeClaim: + claimName: flexvolsmb-dawarich-data diff --git a/services/Dawarich/ingressroute-dawarich.yaml b/services/Dawarich/ingressroute-dawarich.yaml new file mode 100644 index 0000000..b233040 --- /dev/null +++ b/services/Dawarich/ingressroute-dawarich.yaml @@ -0,0 +1,17 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: dawarich + namespace: dawarich +spec: + entryPoints: + - websecure + routes: + - match: Host(`timeline.spamasaurus.com`) + kind: Rule + services: + - name: dawarich + port: 3000 + middlewares: + - name: security-headers@file + - name: compression@file diff --git a/services/Dawarich/persistentVolume-dawarich.yml b/services/Dawarich/persistentVolume-dawarich.yml new file mode 100644 index 0000000..4fa6ef8 --- /dev/null +++ b/services/Dawarich/persistentVolume-dawarich.yml @@ -0,0 +1,56 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: flexvolsmb-dawarich-db +spec: + capacity: + storage: 1Gi + accessModes: + - ReadWriteMany + storageClassName: flexvolsmb-dawarich-db + flexVolume: + driver: mount/smb + secretRef: + name: flexvolsmb-credentials + options: + opts: file_mode=0755,dir_mode=0700,uid=70,gid=70,iocharset=utf8,nobrl + server: 192.168.154.225 + share: /K3s.Volumes/dawarich/db +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: flexvolsmb-dawarich-redis +spec: + capacity: + storage: 1Gi + accessModes: + - ReadWriteMany + storageClassName: flexvolsmb-dawarich-redis + flexVolume: + driver: mount/smb + secretRef: + name: flexvolsmb-credentials + options: + opts: file_mode=0700,dir_mode=0700,uid=999,gid=1000,iocharset=utf8,nobrl + server: 192.168.154.225 + share: /K3s.Volumes/dawarich/redis +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: flexvolsmb-dawarich-data +spec: + capacity: + storage: 1Gi + accessModes: + - ReadWriteMany + storageClassName: flexvolsmb-dawarich-data + flexVolume: + driver: mount/smb + secretRef: + name: flexvolsmb-credentials + options: + opts: file_mode=0755,dir_mode=0755,iocharset=utf8 + server: 192.168.154.225 + share: /K3s.Volumes/dawarich/data diff --git a/services/Dawarich/persistentVolumeClaim-dawarich.yml b/services/Dawarich/persistentVolumeClaim-dawarich.yml new file mode 100644 index 0000000..95e1247 --- /dev/null +++ b/services/Dawarich/persistentVolumeClaim-dawarich.yml @@ -0,0 +1,38 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: flexvolsmb-dawarich-db + namespace: dawarich +spec: + accessModes: + - ReadWriteMany + storageClassName: flexvolsmb-dawarich-db + resources: + requests: + storage: 1Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: flexvolsmb-dawarich-redis + namespace: dawarich +spec: + accessModes: + - ReadWriteMany + storageClassName: flexvolsmb-dawarich-redis + resources: + requests: + storage: 1Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: flexvolsmb-dawarich-data + namespace: dawarich +spec: + accessModes: + - ReadWriteMany + storageClassName: flexvolsmb-dawarich-data + resources: + requests: + storage: 1Gi diff --git a/services/Dawarich/sealedsecret-flexvolsmb-credentials.yaml b/services/Dawarich/sealedsecret-flexvolsmb-credentials.yaml new file mode 100644 index 0000000..391051c --- /dev/null +++ b/services/Dawarich/sealedsecret-flexvolsmb-credentials.yaml @@ -0,0 +1,16 @@ +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + creationTimestamp: null + name: flexvolsmb-credentials + namespace: dawarich +spec: + encryptedData: + password: AgDB1T2hBs8kf5sPcAQ1EQopYDsoHBS2a32V0C556RCOvZ9BR45Esx69L3Ug6LcSW3LlfsN0EYfxCEVJMhshfWvPEeyZpcrml1twP7EsnyEfkvBmWpCM2M4bDe6eD5A6gkqnIKt4vpNn87xT4WCnnXK77cal42E1EA4DDrHv5Np+4ju87FOV3UtClFwoRbNgs0wpKk/glVokSu62qHaXWqUULSGZbF13TLG1aFv3/FAnY7i7UwPQcEPbx1mHaBsWZ4JvWRze49gBb9s+6AFgLxTwd7oPQCjONvSKfz9xesjLaxAGjgEm3e8v5ramjSaTqOd4V5Tv96L5MJUIpHIw4fFCdi+++pR2ZAjNEkQrrL9Q+keF+TWhz/IH8T5bY7KST9TXVNPGAlHuvBduFklx/0bSU7UXA7X88E3t4Yjp1n5ggp0xgggene4pAZrly361v1LjzXtV6Cb6v0EUxgWn62Rf1ikRszc4ab+Y4JZZHPJuiSyBZGw0RUCf44iTVR2I0ScgTTSywElKGjGyzrP7FxZ5VK0kPqKkJIsBNm5shBigU1EbD3Gos5g61gzIRtvl3XsT4bDnqASDRVMPsM2biIdYr3ITZy/8uzFsqUH9EA+ZUFhDxHZUgIdRa0Jgx9wMs1ptKl/pRGo0MiZqev/m6aO/KDv1I/aGXQEG1wUtWvGAWJ87WdUVB/5Gz8u0hg9Z9IRHgkldhrgO1f6aZXxE6MwJ + username: AgCQYNKlpsSZ8PkkFkUJXKxCFK5Xl2Jr1AuokM7uXiAPYWHeNal+MrTBbJL6oWab53oBeHu1fou45aGYKKnXQN8yNHNoyrpDTEP65AUlUzLJshaB56vLrPAqPdHUpmHyMWZIQxHqlU7c7vZ4TgWkuFS7oXmuFptsDp36tpL6dANKKBIvMniWLiWouZgZSDiJdSwdOGoMqvKp1L9vbkcYstbMHOfAry1hYHxcBa/BYdjV9mvZqwa0GWJ0Zq+q5iwlSInrLa0xH08M1cuNRGjTXIuY+qV7pmVv6HuuhhUAUI8RJTs6g/0et/caFVKpMbj0LnmI7y8c6wMawexbqLD2t6lrBn1bQD4TBuuxk1hh9IiJ2ju18POv11eMPbYQRiNygytFsZ7iYTF4nxxeIExfb9OoYlkfdHl9855DmJHKWkRF1eSRkrtdxnT69BTPXi3wugf50LTUTIuXXEcXp6hdWeZLOytyQDeVoEZsknLuVemJ62iz/IhN+EHfhnibx0DwS2doPn3rzg4gt7zThRk+8I4g1yyqywoLMw+79Rk1ft+2XjZlWr6TPo8T6lCM/3aVNrtuNfrMWiQPKRxXdLX6syjkd8pb7yUMXVtvofGIhyHVXgQA5PJQRQzNcEU/Mm5oFdjpfEFQhtIef6u0urg+37dRb5liVYWmhnPozOvD52B3I99md9rzEwK20faK7XoiHENlsRFExwI= + template: + metadata: + creationTimestamp: null + name: flexvolsmb-credentials + namespace: dawarich + type: mount/smb diff --git a/services/Dawarich/service-dawarich.yaml b/services/Dawarich/service-dawarich.yaml new file mode 100644 index 0000000..afaf8f3 --- /dev/null +++ b/services/Dawarich/service-dawarich.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: dawarich + namespace: dawarich +spec: + ports: + - protocol: TCP + name: app + port: 3000 + - protocol: TCP + name: redis + port: 6379 + - protocol: TCP + name: db + port: 5432 + selector: + app: dawarich