geoserver

by joaquinito2051

Helm chartv0.0.3App 1.0-RC2

A Helm chart for Geoserver

About this chart

Helm chart for geoserver-cloud

A Helm chart for Geoserver

include this chart as dependency of your own chart:

just include the following section in your Chart.yaml:

dependencies:
  - name: geoserver
    repository: https://camptocamp.github.io/helm-geoserver-cloud
    version: <version-numer-here>

See the value file for configuration options.

Developing on geoserver-cloud code using this chart

To develop in this chart, we recommend that you use k3d if you want to use your machine. Please follow the following steps to ensure that you have all the requirements for development:

install k3d

basically just do:

wget -q -O - https://raw.githubusercontent.com/rancher/k3d/main/install.sh | TAG=v4.4.8 bash

install kubectl

curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"

or follow the steps of the official documentation

install helm (version 3!!!!)

follow the steps of the official documentation

install k3d

wget -q -O - https://raw.githubusercontent.com/rancher/k3d/main/install.sh | TAG=v4.4.8 bash

create a cluster on your machine

The following configuration will create a single-node "cluster" on your machine, the kubelet parameters ensure that it works also if you have an almost full development PC. It will also bind the port localhost:8081 of your machine with the ingress controller port 80, just adapt accordingly to your needs. You also need a local image registry to push your local images into the cluster.

# create a local registry
k3d registry create registry.localhost --port 5000

# create a local cluster and enable the registry
k3d cluster create k3d-cluster-1 --registry-use k3d-registry.localhost --k3s-agent-arg '--kubelet-arg=eviction-soft-grace-period=imagefs.available=60s,nodefs.available=60s'  --k3s-agent-arg '--kubelet-arg=eviction-soft=imagefs.available<1%,nodefs.available<1%'  --k3s-agent-arg '--kubelet-arg=eviction-hard=imagefs.available<1%,nodefs.available<1%' --k3s-agent-arg '--kubelet-arg=eviction-minimum-reclaim=imagefs.available=1%,nodefs.available=1%'  -p "8081:80@loadbalancer" --agents 2

start the chart

# update the dependencies the first time as well
helm dependency update
# then install the chart
helm install geoserver .

test that it is working.

If everything went well you should see something similar with kubectl:

~# kubectl get po
NAME                                   READY   STATUS    RESTARTS   AGE
geoserver-postgresql-0                 1/1     Running   0          6m17s
geoserver-discovery-6694fdccb6-92sxn   1/1     Running   0          6m17s
geoserver-config-7b64cf454-hjqrv       1/1     Running   0          6m17s
geoserver-rabbitmq-0                   1/1     Running   0          6m17s
geoserver-gateway-7d99c5c864-wpbt4     1/1     Running   0          6m17s
geoserver-webui-67dfc967d7-x8cx8       1/1     Running   0          6m17s
geoserver-rest-577ddb7854-pjhv2        1/1     Running   0          6m17s
geoserver-wms-7798c78cfd-ngwdm         1/1     Running   0          6m17s
geoserver-wcs-748c9fb64b-flxts         1/1     Running   0          6m17s
geoserver-wfs-65947f5d4d-88g26         1/1     Running   0          6m17s

and you should be able to access the webui on http://localhost:8081/web/

use a local docker image and import it into the cluster

  1. build your image, tag and name it:
docker build -t k3d-registry.localhost:5000/geoserver-cloud-webui:test .

And push it to the localhost registry

docker push k3d-registry.localhost:5000/geoserver-cloud-webui:test

and then upgrade (or start) the chart with the following argument:

helm upgrade --set geoserver.webui.image.repository=k3d-registry.localhost:5000/geoserver-cloud-webui --set geoserver.webui.image.tag=test geoserver .

NB: this should not be the case with modern OS, but you might need to add the following to your /etc/hosts configuration:

127.0.0.1 k3d-registry.localhost

Chart Requirements

RepositoryNameVersion
https://charts.bitnami.com/bitnamirabbitmq8.0.1

Values

KeyTypeDefaultDescription
geoserver.config.affinityobject{}
geoserver.config.envlist[]
geoserver.config.image.repositorystring"geoservercloud/config-service"
geoserver.config.image.tagstring""
geoserver.config.nodeSelector."node.kubernetes.io/role"string"sig"
geoserver.config.podAnnotationsobject{}
geoserver.config.podSecurityContext.runAsUserint630
geoserver.config.replicaCountint1
geoserver.config.resources.limits.memorystring"600Mi"
geoserver.config.resources.requests.cpustring"100m"
geoserver.config.resources.requests.memorystring"300Mi"
geoserver.config.securityContextobject{}
geoserver.config.service.portint8080
geoserver.config.service.typestring"ClusterIP"
geoserver.config.tolerations[0].effectstring"NoSchedule"
geoserver.config.tolerations[0].keystring"node.kubernetes.io/role"
geoserver.config.tolerations[0].operatorstring"Equal"
geoserver.config.tolerations[0].valuestring"sig"
geoserver.database.dropOnDeleteboolfalse
geoserver.database.extensions[0]string"pg_stat_statements"
geoserver.database.secretConfigstring"jdbcconfig"
geoserver.discovery.affinityobject{}
geoserver.discovery.envlist[]
geoserver.discovery.image.repositorystring"geoservercloud/discovery-service"
geoserver.discovery.image.tagstring""
geoserver.discovery.nodeSelector."node.kubernetes.io/role"string"sig"
geoserver.discovery.podAnnotationsobject{}
geoserver.discovery.podSecurityContext.runAsUserint630
geoserver.discovery.replicaCountint1
geoserver.discovery.resources.limits.cpustring"300m"
geoserver.discovery.resources.limits.memorystring"600Mi"
geoserver.discovery.resources.requests.cpustring"100m"
geoserver.discovery.resources.requests.memorystring"300Mi"
geoserver.discovery.securityContextobject{}
geoserver.discovery.service.portint8761
geoserver.discovery.service.typestring"ClusterIP"
geoserver.discovery.tolerations[0].effectstring"NoSchedule"
geoserver.discovery.tolerations[0].keystring"node.kubernetes.io/role"
geoserver.discovery.tolerations[0].operatorstring"Equal"
geoserver.discovery.tolerations[0].valuestring"sig"
geoserver.gateway.affinityobject{}
geoserver.gateway.envlist[]
geoserver.gateway.image.repositorystring"geoservercloud/gateway-service"
geoserver.gateway.image.tagstring""
geoserver.gateway.nodeSelector."node.kubernetes.io/role"string"sig"
geoserver.gateway.podAnnotationsobject{}
geoserver.gateway.podSecurityContext.runAsUserint630
geoserver.gateway.replicaCountint1
geoserver.gateway.resources.limits.memorystring"800Mi"
geoserver.gateway.resources.requests.cpustring"100m"
geoserver.gateway.resources.requests.memorystring"400Mi"
geoserver.gateway.securityContextobject{}
geoserver.gateway.service.portint8080
geoserver.gateway.service.typestring"ClusterIP"
geoserver.gateway.tolerations[0].effectstring"NoSchedule"
geoserver.gateway.tolerations[0].keystring"node.kubernetes.io/role"
geoserver.gateway.tolerations[0].operatorstring"Equal"
geoserver.gateway.tolerations[0].valuestring"sig"
geoserver.namestring"geoserver"
geoserver.rabbitmq.portint5672
geoserver.rest.affinityobject{}
geoserver.rest.envlist[]
geoserver.rest.image.repositorystring"geoservercloud/rest-service"
geoserver.rest.image.tagstring""
geoserver.rest.nodeSelector."node.kubernetes.io/role"string"sig"
geoserver.rest.podAnnotationsobject{}
geoserver.rest.podSecurityContext.runAsUserint630
geoserver.rest.replicaCountint1
geoserver.rest.resources.limits.memorystring"1Gi"
geoserver.rest.resources.requests.cpustring"200m"
geoserver.rest.resources.requests.memorystring"512Mi"
geoserver.rest.securityContextobject{}
geoserver.rest.service.portint`

Deploy geoserver with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has geoserver on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartgeoserver is pinned at v0.0.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply