From 7ff6e9ea879a9f07b6453b65aef11d29a430f262 Mon Sep 17 00:00:00 2001 From: Ashutosh Ojha Date: Tue, 6 Aug 2024 15:19:24 +0530 Subject: [PATCH 1/2] Create kustomization.yaml --- 4.4/kubernetes/kustomization.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 4.4/kubernetes/kustomization.yaml diff --git a/4.4/kubernetes/kustomization.yaml b/4.4/kubernetes/kustomization.yaml new file mode 100644 index 0000000..1ad1ad4 --- /dev/null +++ b/4.4/kubernetes/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - configmap.yaml + - statefulset.yaml + - service.yaml From 0dc006b9ee53902d6ee1cbe2c9ffecfde871788a Mon Sep 17 00:00:00 2001 From: Ashutosh Ojha Date: Tue, 6 Aug 2024 15:20:09 +0530 Subject: [PATCH 2/2] added kubernetes deployment yaml files --- 4.4/kubernetes/configmap.yaml | 6 ++++ 4.4/kubernetes/service.yaml | 14 ++++++++ 4.4/kubernetes/statefulset.yaml | 64 +++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 4.4/kubernetes/configmap.yaml create mode 100644 4.4/kubernetes/service.yaml create mode 100644 4.4/kubernetes/statefulset.yaml diff --git a/4.4/kubernetes/configmap.yaml b/4.4/kubernetes/configmap.yaml new file mode 100644 index 0000000..574861d --- /dev/null +++ b/4.4/kubernetes/configmap.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: nominatim-config +data: + PBF_URL: https://download.geofabrik.de/asia/gcc-states-latest.osm.pbf \ No newline at end of file diff --git a/4.4/kubernetes/service.yaml b/4.4/kubernetes/service.yaml new file mode 100644 index 0000000..aeac57c --- /dev/null +++ b/4.4/kubernetes/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: nominatim + labels: + app: nominatim +spec: + ports: + - port: 8080 + targetPort: 8080 + protocol: TCP + name: http + selector: + app: nominatim \ No newline at end of file diff --git a/4.4/kubernetes/statefulset.yaml b/4.4/kubernetes/statefulset.yaml new file mode 100644 index 0000000..b9d9b63 --- /dev/null +++ b/4.4/kubernetes/statefulset.yaml @@ -0,0 +1,64 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: nominatim +spec: + serviceName: "nominatim" + replicas: 1 + selector: + matchLabels: + app: nominatim + template: + metadata: + labels: + app: nominatim + spec: + initContainers: + - name: init + image: mediagis/nominatim:4.4 + command: + - bash + args: + - '-c' + - 'mkdir -p /var/lib/postgresql/14/main && bash /app/init.sh' + envFrom: + - configMapRef: + name: nominatim-config + volumeMounts: + - name: nominatim-data + mountPath: /nominatim + - name: postgres-data + mountPath: /var/lib/postgresql + containers: + - name: nominatim + image: mediagis/nominatim:4.4 + command: + - bash + args: + - /app/start.sh + envFrom: + - configMapRef: + name: nominatim-config + ports: + - containerPort: 8080 + name: http + volumeMounts: + - name: nominatim-data + mountPath: /nominatim + - name: postgres-data + mountPath: /var/lib/postgresql + volumeClaimTemplates: + - metadata: + name: nominatim-data + spec: + accessModes: [ "ReadWriteOnce" ] + resources: + requests: + storage: 10Gi + - metadata: + name: postgres-data + spec: + accessModes: [ "ReadWriteOnce" ] + resources: + requests: + storage: 50Gi \ No newline at end of file