Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
608 changes: 608 additions & 0 deletions components/geocoder/configmap.yaml

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions components/geocoder/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: geocode-proxy
labels:
app: geocode-proxy
spec:
replicas: 1
selector:
matchLabels:
app: geocode-proxy
template:
metadata:
labels:
app: geocode-proxy
spec:
containers:
- name: geocode-proxy
image: kommonitor/geocoder-proxy
imagePullPolicy: Always
resources:
requests:
memory: "16M"
cpu: "1m"
limits:
memory: "500M"
cpu: "500m"
ports:
- containerPort: 8092
env:
- name: NOMINATIM_URL
value: "http://nominatim:8080"
- name: PORT
value: "8092"

envFrom:
- configMapRef:
name: geocode-proxy
volumeMounts:
- name: openapi-config-volume
mountPath: /code/api/openapi.yaml
subPath: openapi.yaml
volumes:
- name: openapi-config-volume
configMap:
name: geocode-proxy
items:
- key: openapi.yaml
path: openapi.yaml
14 changes: 14 additions & 0 deletions components/geocoder/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: "nginx"
cert-manager.io/issuer: letsencrypt
name: de-kommonitor-geocoder
spec:
tls:
- hosts:
- demo.kommonitor-geocoder.de.52north.org
secretName: de-kommonitor-geocoder-tls
rules:
- host: demo.kommonitor-geocoder.de.52north.org
9 changes: 9 additions & 0 deletions components/geocoder/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml
- configmap.yaml
- namespace.yaml
- rolebinding.yaml
- ingress.yaml
4 changes: 4 additions & 0 deletions components/geocoder/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: de-kommonitor-geocoder
11 changes: 11 additions & 0 deletions components/geocoder/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: de-kommonitor-geocoder-admin-access
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: admin
subjects:
- kind: Group
name: de-kommonitor-geocoder-admin # This is the link between k8s and the IAM role
15 changes: 15 additions & 0 deletions components/geocoder/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: geocode-proxy
labels:
app: geocode-proxy
spec:
selector:
app: geocode-proxy
ports:
- name: http
port: 8092
targetPort: 8092
nodePort: 30920
type: NodePort
9 changes: 9 additions & 0 deletions components/kubegres/my-postgres-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: mypostgres-secret
namespace: default
type: Opaque
stringData:
superUserPassword: postgresSuperUserPsw
replicationUserPassword: postgresReplicaPsw
26 changes: 26 additions & 0 deletions components/kubegres/my-postgres.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: kubegres.reactive-tech.io/v1
kind: Kubegres
metadata:
name: mypostgres
namespace: default

spec:

replicas: 3
image: postgres:16.1

database:
size: 200Mi

env:
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: mypostgres-secret
key: superUserPassword

- name: POSTGRES_REPLICATION_PASSWORD
valueFrom:
secretKeyRef:
name: mypostgres-secret
key: replicationUserPassword
10 changes: 10 additions & 0 deletions components/nominatim/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: nominatim
data:
PBF_URL: "https://download.geofabrik.de/europe/germany/nordrhein-westfalen/duesseldorf-regbez-latest.osm.pbf"
REPLICATION_URL: "https://download.geofabrik.de/europe/germany/nordrhein-westfalen/duesseldorf-regbez-updates/"
REPLICATION_UPDATE_INTERVAL: "86400"
UPDATE_MODE: "once"
REPLICATION_RECHECK_INTERVAL: "300"
96 changes: 96 additions & 0 deletions components/nominatim/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nominatim
labels:
app: nominatim
spec:
replicas: 1
selector:
matchLabels:
app: nominatim
template:
metadata:
labels:
app: nominatim
spec:
initContainers:
- name: init
image: mediagis/nominatim:4.4
resources:
limits:
memory: "3Gi"
cpu: "1000m"
command:
- bash
args:
- '-c'
- 'mkdir -p /var/lib/postgresql/14/main && sudo chown postgres:postgres /var/lib/postgresql/14/main && bash /app/init.sh'
env:
- name: PBF_URL
valueFrom:
configMapKeyRef:
name: nominatim
key: PBF_URL
- name: REPLICATION_URL
valueFrom:
configMapKeyRef:
name: nominatim
key: REPLICATION_URL
volumeMounts:
- name: nominatim-storage
mountPath: /var/lib/nominatim
- name: nominatim-db-data
mountPath: /var/lib/postgresql/14/
containers:
- name: nominatim
image: mediagis/nominatim:4.4
imagePullPolicy: Always
resources:
requests:
memory: "1Gi"
cpu: "100m"
limits:
memory: "3Gi"
cpu: "1000m"
ports:
- containerPort: 8080
env:
- name: PBF_URL
valueFrom:
configMapKeyRef:
name: nominatim
key: PBF_URL
- name: REPLICATION_URL
valueFrom:
configMapKeyRef:
name: nominatim
key: REPLICATION_URL
- name: REPLICATION_UPDATE_INTERVAL
valueFrom:
configMapKeyRef:
name: nominatim
key: REPLICATION_UPDATE_INTERVAL
- name: UPDATE_MODE
valueFrom:
configMapKeyRef:
name: nominatim
key: UPDATE_MODE
- name: REPLICATION_RECHECK_INTERVAL
valueFrom:
configMapKeyRef:
name: nominatim
key: REPLICATION_RECHECK_INTERVAL
volumeMounts:
- name: nominatim-storage
mountPath: /var/lib/nominatim
- name: nominatim-db-data
mountPath: /var/lib/postgresql/14/
volumes:
- name: nominatim-storage
persistentVolumeClaim:
claimName: nominatim-storage
- name: nominatim-db-data
persistentVolumeClaim:
claimName: nominatim-db-data

14 changes: 14 additions & 0 deletions components/nominatim/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: "nginx"
cert-manager.io/issuer: letsencrypt
name: de-kommonitor-geocoder
spec:
tls:
- hosts:
- demo.kommonitor-geocoder.de.52north.org
secretName: de-kommonitor-geocoder-tls
rules:
- host: demo.kommonitor-geocoder.de.52north.org
11 changes: 11 additions & 0 deletions components/nominatim/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml
- configmap.yaml
- namespace.yaml
- rolebinding.yaml
- ingress.yaml
- pvc.yaml

4 changes: 4 additions & 0 deletions components/nominatim/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: de-kommonitor-geocoder
28 changes: 28 additions & 0 deletions components/nominatim/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nominatim-storage
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
storageClassName: retained-ssd-gp3
volumeMode: Filesystem

---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nominatim-db-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: retained-ssd-gp3
volumeMode: Filesystem

11 changes: 11 additions & 0 deletions components/nominatim/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: de-kommonitor-geocoder-admin-access
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: admin
subjects:
- kind: Group
name: de-kommonitor-geocoder-admin # This is the link between k8s and the IAM role
16 changes: 16 additions & 0 deletions components/nominatim/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: nominatim
labels:
app: nominatim
spec:
selector:
app: nominatim
ports:
- name: http1
port: 8080
targetPort: 8080
nodePort: 30922
type: NodePort