Adds umap app.
This commit is contained in:
5
umap/app.yaml
Normal file
5
umap/app.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
name: umap
|
||||||
|
is: umap
|
||||||
|
description: uMap is a self-hosted mapping tool that lets you create and share custom maps using OpenStreetMap data. Built with Django and Leaflet.
|
||||||
|
icon: https://raw.githubusercontent.com/umap-project/umap/master/umap/static/umap/img/logo.svg
|
||||||
|
latest: "3"
|
||||||
39
umap/versions/3/README.md
Normal file
39
umap/versions/3/README.md
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# uMap
|
||||||
|
|
||||||
|
uMap is a tool for creating and sharing custom maps using OpenStreetMap as the base layer.
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
- **PostgreSQL** (with PostGIS extension) - Database for storing maps and geographic data
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Key settings in `config.yaml`:
|
||||||
|
|
||||||
|
- **domain** - Where uMap will be accessible
|
||||||
|
- **storage** - Persistent volume size (default: `2Gi`)
|
||||||
|
- **db.name** - Database name (default: `umap`)
|
||||||
|
|
||||||
|
## First-Time Setup
|
||||||
|
|
||||||
|
1. Add and deploy the app:
|
||||||
|
```bash
|
||||||
|
wild app add umap
|
||||||
|
wild app deploy umap
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Create a superuser account:
|
||||||
|
```bash
|
||||||
|
kubectl exec -n umap deploy/umap -- umap createsuperuser
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Log in at `/en/login/` with the credentials you just created.
|
||||||
|
|
||||||
|
4. Create maps by clicking **Create a map** on the homepage — no account is required for anonymous map creation by default.
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
- uMap uses PostGIS for geographic queries — the db-init job installs the PostGIS extension automatically
|
||||||
|
- The Django `secretKey` is auto-generated in `secrets.yaml`
|
||||||
|
- Maps can be made public, unlisted, or private
|
||||||
|
- The admin panel is at `/admin/` for managing users and content
|
||||||
61
umap/versions/3/db-init-job.yaml
Normal file
61
umap/versions/3/db-init-job.yaml
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: umap-db-init
|
||||||
|
namespace: {{ .namespace }}
|
||||||
|
labels:
|
||||||
|
component: db-init
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
component: db-init
|
||||||
|
spec:
|
||||||
|
restartPolicy: OnFailure
|
||||||
|
securityContext:
|
||||||
|
runAsNonRoot: true
|
||||||
|
runAsUser: 999
|
||||||
|
runAsGroup: 999
|
||||||
|
seccompProfile:
|
||||||
|
type: RuntimeDefault
|
||||||
|
containers:
|
||||||
|
- name: postgres-init
|
||||||
|
image: postgres:15
|
||||||
|
securityContext:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
env:
|
||||||
|
- name: PGHOST
|
||||||
|
value: {{ .db.host }}
|
||||||
|
- name: PGUSER
|
||||||
|
value: postgres
|
||||||
|
- name: PGPASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: umap-secrets
|
||||||
|
key: postgres.password
|
||||||
|
- name: DB_NAME
|
||||||
|
value: {{ .db.name }}
|
||||||
|
- name: DB_USER
|
||||||
|
value: {{ .db.user }}
|
||||||
|
- name: DB_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: umap-secrets
|
||||||
|
key: dbPassword
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
set -e
|
||||||
|
until pg_isready; do sleep 2; done
|
||||||
|
psql -c "CREATE DATABASE ${DB_NAME};" || echo "Database already exists"
|
||||||
|
psql -c "CREATE USER ${DB_USER} WITH PASSWORD '${DB_PASSWORD}';" || echo "User already exists"
|
||||||
|
psql -c "ALTER USER ${DB_USER} WITH PASSWORD '${DB_PASSWORD}';"
|
||||||
|
psql -c "GRANT ALL PRIVILEGES ON DATABASE ${DB_NAME} TO ${DB_USER};"
|
||||||
|
psql -d ${DB_NAME} -c "GRANT ALL ON SCHEMA public TO ${DB_USER};"
|
||||||
|
psql -d ${DB_NAME} -c "CREATE EXTENSION IF NOT EXISTS postgis;" || echo "PostGIS extension not available - uMap requires PostGIS on the PostgreSQL server"
|
||||||
|
echo "Done"
|
||||||
92
umap/versions/3/deployment.yaml
Normal file
92
umap/versions/3/deployment.yaml
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: umap
|
||||||
|
namespace: {{ .namespace }}
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
strategy:
|
||||||
|
type: Recreate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
component: web
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
component: web
|
||||||
|
spec:
|
||||||
|
securityContext:
|
||||||
|
seccompProfile:
|
||||||
|
type: RuntimeDefault
|
||||||
|
containers:
|
||||||
|
- name: umap
|
||||||
|
image: umap/umap:3.7.3
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 8000
|
||||||
|
protocol: TCP
|
||||||
|
env:
|
||||||
|
- name: DATABASE_URL
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: umap-secrets
|
||||||
|
key: databaseUrl
|
||||||
|
- name: SECRET_KEY
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: umap-secrets
|
||||||
|
key: secretKey
|
||||||
|
- name: SITE_URL
|
||||||
|
value: https://{{ .domain }}
|
||||||
|
- name: STATIC_ROOT
|
||||||
|
value: /srv/umap/static
|
||||||
|
- name: MEDIA_ROOT
|
||||||
|
value: /srv/umap/uploads
|
||||||
|
- name: ALLOWED_HOSTS
|
||||||
|
value: "{{ .domain }}"
|
||||||
|
- name: CSRF_TRUSTED_ORIGINS
|
||||||
|
value: "https://{{ .domain }}"
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 1000m
|
||||||
|
ephemeral-storage: 1Gi
|
||||||
|
memory: 512Mi
|
||||||
|
requests:
|
||||||
|
cpu: 50m
|
||||||
|
ephemeral-storage: 50Mi
|
||||||
|
memory: 256Mi
|
||||||
|
volumeMounts:
|
||||||
|
- name: umap-uploads
|
||||||
|
mountPath: /srv/umap/uploads
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
port: 8000
|
||||||
|
httpHeaders:
|
||||||
|
- name: Host
|
||||||
|
value: "{{ .domain }}"
|
||||||
|
initialDelaySeconds: 60
|
||||||
|
timeoutSeconds: 5
|
||||||
|
periodSeconds: 15
|
||||||
|
failureThreshold: 6
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
port: 8000
|
||||||
|
httpHeaders:
|
||||||
|
- name: Host
|
||||||
|
value: "{{ .domain }}"
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
timeoutSeconds: 3
|
||||||
|
periodSeconds: 10
|
||||||
|
failureThreshold: 3
|
||||||
|
securityContext:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
|
volumes:
|
||||||
|
- name: umap-uploads
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: umap-uploads
|
||||||
|
restartPolicy: Always
|
||||||
26
umap/versions/3/ingress.yaml
Normal file
26
umap/versions/3/ingress.yaml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: umap
|
||||||
|
namespace: {{ .namespace }}
|
||||||
|
annotations:
|
||||||
|
external-dns.alpha.kubernetes.io/target: {{ .externalDnsDomain }}
|
||||||
|
external-dns.alpha.kubernetes.io/cloudflare-proxied: "false"
|
||||||
|
external-dns.alpha.kubernetes.io/ttl: "60"
|
||||||
|
spec:
|
||||||
|
ingressClassName: traefik
|
||||||
|
rules:
|
||||||
|
- host: {{ .domain }}
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: umap
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- {{ .domain }}
|
||||||
|
secretName: {{ .tlsSecretName }}
|
||||||
16
umap/versions/3/kustomization.yaml
Normal file
16
umap/versions/3/kustomization.yaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: {{ .namespace }}
|
||||||
|
labels:
|
||||||
|
- includeSelectors: true
|
||||||
|
pairs:
|
||||||
|
app: umap
|
||||||
|
managedBy: kustomize
|
||||||
|
partOf: wild-cloud
|
||||||
|
resources:
|
||||||
|
- namespace.yaml
|
||||||
|
- db-init-job.yaml
|
||||||
|
- deployment.yaml
|
||||||
|
- service.yaml
|
||||||
|
- ingress.yaml
|
||||||
|
- pvc.yaml
|
||||||
21
umap/versions/3/manifest.yaml
Normal file
21
umap/versions/3/manifest.yaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
version: 3.7.3-1
|
||||||
|
requires:
|
||||||
|
- name: postgres
|
||||||
|
defaultConfig:
|
||||||
|
namespace: umap
|
||||||
|
externalDnsDomain: '{{ .cloud.domain }}'
|
||||||
|
domain: umap.{{ .cloud.domain }}
|
||||||
|
tlsSecretName: wildcard-wild-cloud-tls
|
||||||
|
storage: 2Gi
|
||||||
|
db:
|
||||||
|
host: '{{ .apps.postgres.host }}'
|
||||||
|
port: '{{ .apps.postgres.port }}'
|
||||||
|
name: umap
|
||||||
|
user: umap
|
||||||
|
defaultSecrets:
|
||||||
|
- key: dbPassword
|
||||||
|
- key: secretKey
|
||||||
|
- key: databaseUrl
|
||||||
|
default: 'postgis://{{ .app.db.user }}:{{ .secrets.dbPassword }}@{{ .app.db.host }}:{{ .app.db.port }}/{{ .app.db.name }}'
|
||||||
|
requiredSecrets:
|
||||||
|
- postgres.password
|
||||||
4
umap/versions/3/namespace.yaml
Normal file
4
umap/versions/3/namespace.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: {{ .namespace }}
|
||||||
11
umap/versions/3/pvc.yaml
Normal file
11
umap/versions/3/pvc.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: umap-uploads
|
||||||
|
namespace: {{ .namespace }}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .storage }}
|
||||||
13
umap/versions/3/service.yaml
Normal file
13
umap/versions/3/service.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: umap
|
||||||
|
namespace: {{ .namespace }}
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
component: web
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 80
|
||||||
|
targetPort: 8000
|
||||||
|
protocol: TCP
|
||||||
Reference in New Issue
Block a user