Is there a kubernetes template?

Hello there,

I see “Kubernetes” mentioned left and right (I am a new user, and therefore I can only post 2 links :person_shrugging:)

  • I was thinking to spin this “in production” via Chart List | TrueCharts - but I am a total newbie in kubernetes.
  • There is also https://kompose.io/, but I am not sure if the auto-conversion is good enough
  • And then, hopefully, “minimum information” to actually stay inside the deployment, and instead carrying “a folder” that would make it trivial to “move around” if need be, and re-deploy it with the same Kubernetes configuration on a different server.
2 Likes

here Is Gramps Web Sync adaptable for broader use? - #8 by DavidMStraub and here Are there maintenance conflicts withe active users? - #2 by DavidMStraub

I use Kubernetes for Grampshub, but, believe me, it’s complicated, and if you’re a newbie, I would strongly advise you not to go down that road.

That’s also why I don’t want to share the setup - it’s highly specific, and supporting users who fail getting it to work would be a nightmare. I want to focus on supporting the default docker-compose based deployment which IMO is enough for >99% of users.

If some kubernetes pro wants to share a generic setup and support that also for the community, it would of course be welcome…

1 Like

I don’t want to do it either :sweat_smile:

However, my local server is a TrueNAS Scale, and I’d like it to host it for me.
At least - for the time being I am playing around it and see how it works. I don’t want it sitting temporarily on any laptop.

3 Likes

If there’s a current implementation of docker-compose template I think it’s fair to try and convert that into a Helm chart, I’m not experienced with it but I think it’s worth a shot.

I did start with kompose.io and didn’t find the result super useful.

1 Like

Yeah - that’s what I thought :confused:

And since I cannot “containerize” that Kubernetes result - I don’t want to apply it to my local laptop. (Since I don’t know how to expunge “everything it caused”). Starting a VM to test the result feels overly an overkill.

And then, if I make something nice (and then I’d like to transfer it around), I’d like the export/import artifact to be “just one directory/tar file”.

And I understand that you don’t want to “freely give” the fruits of your labor.
I wish the TrueNAS Scale would support also doing “simpler things”.

You can try and pull it off locally with kind which is pretty much compliant with any other K8s implementation.

I have the same use case as @stdedos. And would appreciate any help to get this done very much.
Im looking for a replacement to ancestry that is local hosted.

Was tinkering with kubernetes but I know nothing about gramps and probably not enough on kube either. Genea.app is another option that is avileble on Truecharts, but that is obviously a simpler feature set than gamps.

Truecharts has a opencollective for requesting new “charts” now. Is probably the best option if you need this in a timely manner.

A. Order a chart from us directly: TrueCharts - Order a Chart - Open Collective

This message was Flagged as possibly being spam… probably because it linked to a commercial alternative.

However, since Gramps doesn’t have this feature, it seems reasonable to suggest alternatives. (And even if Gramps did have such a feature, suggesting alternatives that might be more powerful or easier also seems reasonable.)

Do others feels the same way? Or is censorship the preferred path?

1 Like

If Genea.app is GEDCOM-compliant, then maybe I can use it for now.

Thank you for mentioning it :slight_smile:

2 Likes

If you want to host Gramps Web locally, why don’t you just use the documented way using compose?

Its not as easy to install compose apps and maintain them in truenas as kubernetes is.

Im not that familiar with compose or docker. I have a Truenas Scale NAS which runs all my home-server. Treafik-proxy app makes the domain names easy to handle with certificates.
All apps that I use are available as charts from Truecharts. New versions off the apps comes fast and is easy to rollback if something is wrong.

Posted a guide on how I got it running without Kubernetes on TrueNas Scale TrueNAS Scale with Portainer for local-hosting Gramps-web

2 Likes

I’m doing first steps with kubernetes. I have taken the docker-compose.yml (https://raw.githubusercontent.com/gramps-project/web/main/examples/docker-compose-base/docker-compose.yml). I then tried kompose to convert it to a helmchart. kompose convert -c and after that helm install gramps ./docker-compose. The resulting setup was almost usable. I changed the resulting files a bit and moved the changes back to the docker-compose.yml. This is my intermediary situation. Feedback welcome:

version: "3.7"

services:
  grampsweb: &grampsweb
    image: ghcr.io/gramps-project/grampsweb:latest
    restart: always
    ports:
      - "81:5000"  # host:docker
    environment:
      GRAMPSWEB_TREE: "Gramps Web"  # will create a new tree if not exists
      GRAMPSWEB_CELERY_CONFIG__broker_url: "redis://grampswebredis:6379/0"
      GRAMPSWEB_CELERY_CONFIG__result_backend: "redis://grampswebredis:6379/0"
      GRAMPSWEB_RATELIMIT_STORAGE_URI: redis://grampswebredis:6379/1
    depends_on:
      - grampswebredis
    volumes:
      - gramps_users:/app/users  # persist user database
      - gramps_index:/app/indexdir  # persist search index
      - gramps_thumb_cache:/app/thumbnail_cache  # persist thumbnails
      - gramps_cache:/app/cache  # persist export and report caches
      - gramps_secret:/app/secret  # persist flask secret
      - gramps_db:/root/.gramps/grampsdb  # persist Gramps database
      - gramps_media:/app/media  # persist media files
      - gramps_tmp:/tmp
    networks:
      - gramps-network
    labels:
      kompose.service.expose: "my.url"

  grampsweb_celery:
    <<: *grampsweb  # YAML merge key copying the entire grampsweb service config
    ports: []
    container_name: grampsweb_celery
    depends_on:
      - grampswebredis
    command: celery -A gramps_webapi.celery worker --loglevel=INFO

  grampswebredis:
    image: redis:alpine
    container_name: grampswebredis
    restart: always
    ports:
      - "6379"
    networks:
      - gramps-network

volumes:
  gramps_users:
  gramps_index:
  gramps_thumb_cache:
  gramps_cache:
  gramps_secret:
  gramps_db:
  gramps_media:
  gramps_tmp:

networks:
  gramps-network:

I have added a port with redis so that a service is constructed. I removed the underscore in grampsweb_redis as a service should not have an underscore in the name. I have added the networks. Both might be redundant but now it’s fixed that gramps web could not access redis. Port 80 was not avilable in my setting, so I changed it to 81. kompose.service.expose: “my.url” is quite useful as it installs an ingress for the url. Last step to take is to get https running.

2 Likes

The recent days I have worked some more on this. I had not gotten media upload to work (but had the same error with a normal docker image so it seemed not related to kubernetes). I fixed that error (mainly it was absolute paths which do not work, all media has to have relative paths). A kubernetes specific problem was that the default ingress (in minikube) has a size limit in proxying (leading to 413 errors). I do not know how to define that in the dockerfile so it gets taken over by kompose so I had to fix a helm template.

docker.yml:

version: "3.7"

services:
  grampsweb: &grampsweb
    image: ghcr.io/gramps-project/grampsweb:latest
    restart: always
    ports:
      - "81:5000"  # host:docker
    environment:
      GRAMPSWEB_TREE: "Gramps Web"  # will create a new tree if not exists
      GRAMPSWEB_BASE_URL: "https://grampsweb.some.url"
      GRAMPSWEB_CELERY_CONFIG__broker_url: "redis://grampswebredis:6379/0"
      GRAMPSWEB_CELERY_CONFIG__result_backend: "redis://grampswebredis:6379/0"
      GRAMPSWEB_RATELIMIT_STORAGE_URI: redis://grampswebredis:6379/1
      GRAMPSWEB_EMAIL_HOST: "somehost"
      GRAMPSWEB_EMAIL_PORT: 587
      GRAMPSWEB_EMAIL_USE_TLS: False
      GRAMPSWEB_EMAIL_HOST_USER: "some@us.er"
      GRAMPSWEB_EMAIL_HOST_PASSWORD: "password"
      GRAMPSWEB_DEFAULT_FROM_EMAIL: "gramps@some.host"
    depends_on:
      - grampswebredis
    volumes:
      - gramps_users:/app/users  # persist user database
      - gramps_index:/app/indexdir  # persist search index
      - gramps_thumb_cache:/app/thumbnail_cache  # persist thumbnails
      - gramps_cache:/app/cache  # persist export and report caches
      - gramps_secret:/app/secret  # persist flask secret
      - gramps_db:/root/.gramps/grampsdb  # persist Gramps database
      - gramps_media:/app/media  # persist media files
      - gramps_tmp:/tmp
    networks:
      - gramps-network
    labels:
      kompose.service.expose: "grampsweb.some.url"
      kompose.service.expose.ingress-class-name: "nginx"
  grampsweb_celery:
    <<: *grampsweb  # YAML merge key copying the entire grampsweb service config
    ports: []
    container_name: grampsweb_celery
    depends_on:
      - grampswebredis
    command: celery -A gramps_webapi.celery worker --loglevel=INFO

  grampswebredis:
    image: redis:alpine
    container_name: grampswebredis 
    restart: always
    ports:
      - "6379"
    networks:
      - gramps-network
volumes:
  gramps_users:
  gramps_index:
  gramps_thumb_cache:
  gramps_cache:
  gramps_secret:
  gramps_db:
  gramps_media:
  gramps_tmp:
  
networks:
  gramps-network:

then run

kompose convert -c

in the directory containing docker-compose.yml.

This creates template files in subfolder docker-compose.

Modify the ingress template to allow bigger requests. With my biggest image being about 70MB a limit of 256MB more than worked and has now allowed me to upload all media with gramps websync:

Beginning of template file docker-compose/templates/grampsweb-ingress.yaml:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kompose.cmd: kompose convert -c
...

add this line to annotations:

nginx.ingress.kubernetes.io/proxy-body-size: 256m

finally

helm install gramps ./docker-compose

and for modifications (like version updates) of the helm templates

helm upgrade gramps ./docker-compose

I use minikube. The ingress provides a domain that is working in minikube. To get connected to the internet I use an apache reverse proxy. The config is as follows. For simplicity I only include the http version. Https for proxying is in principal identical but adds settings specific for ssl.

<VirtualHost IP-OF-SERVER:80>
    ServerName grampsweb.some.url 
    ProxyPreserveHost On
    ProxyRequests Off
    ProxyVia Off
    ProxyPass / http://MINIKUBE-IP/ nocanon
    ProxyPassReverse / http://MINIKUBE-IP/
    AllowEncodedSlashes NoDecode
</VirtualHost>

Insert IP-OF-SERVER as the external IP of the server running the apache proxa and MINIKUBE-IP as the local ip of the minikube cluster. MINIKUBE-IP can be found using the command minikube ip. Providing IP-OF-SERVER might not be necessary in all cases.