Skip to content

K8 convert#1113

Merged
fbacall merged 6 commits intoElixirTeSS:masterfrom
kennethrioja:k8-convert
Jul 7, 2025
Merged

K8 convert#1113
fbacall merged 6 commits intoElixirTeSS:masterfrom
kennethrioja:k8-convert

Conversation

@kennethrioja
Copy link
Contributor

Summary of changes

Concerns #1112

Additions:

  • Everything related to a Kubernetes deployment: Dockerfile-k8, docs/kubernetes.md and every Kubernetes manifests (i.e., files) under k8s/

Modifications:

  • As I needed a DB_PORT in my db-deployment.yaml Kubernetes manifest, I added the mention of PORT everywhere that I needed.
    • in env.sample
    • in config/database.yml
  • .gitignore: added app-secrets* which are Kubernetes manifests created by the users and act like the tess.yml and secrets.yml files, but for Kubernetes
  • .dockerignore: added .DS_Store, a MacOS folder/Finder config file
  • CONTRIBUTORS.md: added Kenneth and listed in alphabetical order

Motivation and context

I needed to deploy TeSS using OpenShift/Kubernetes in my institution, this is why I share the knowledge here!

Screenshots

Checklist

  • I have read and followed the CONTRIBUTING guide.
  • I confirm that I have the authority necessary to make this contribution on behalf of its copyright owner and agree
    to license it to the TeSS codebase under the
    BSD license.

@fbacall fbacall requested a review from Copilot June 13, 2025 13:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces Kubernetes deployment support for TeSS by adding new manifests, documentation and updating configuration files, as well as adjusting contributor listings and ignore files.

  • Added new Kubernetes manifests for deploying TeSS components (app, db, redis, sidekiq, backup, and setup job)
  • Updated environment configuration and database setups to include DB_PORT and other necessary changes
  • Updated documentation and contributor information to reflect new deployment workflows and team contributions

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
k8s/sidekiq-deployment.yaml Added Sidekiq deployment manifest
k8s/redis-service.yaml Added Redis service manifest
k8s/redis-persistentvolumeclaim.yaml Added PVC for Redis
k8s/redis-deployment.yaml Added Redis deployment manifest
k8s/logs-persistentvolumeclaim.yaml Added PVC for logs
k8s/db-service.yaml Added Service manifest for DB
k8s/db-persistentvolumeclaim.yaml Added PVC for DB
k8s/db-deployment.yaml Added DB deployment manifest
k8s/backup-persistenvolumeclaim.yaml Added PVC for backups (file name appears misspelled)
k8s/backup-cronjob.yaml Added cronjob manifest for backups
k8s/app-setup-job.yaml Added job manifest for app setup
k8s/app-service.yaml Added app service manifest
k8s/app-route.yaml Added route manifest for app (openshift)
k8s/app-deployment.yaml Added app deployment manifest
env.sample Updated sample env file to include DB_PORT
docs/kubernetes.md Added documentation for Kubernetes deployment
config/database.yml Updated database config to fetch DB_PORT
Dockerfile-k8 Added Dockerfile for Kubernetes builds
CONTRIBUTORS.md Updated contributor listing and ordering
.dockerignore Updated dockerignore file with .DS_Store
Comments suppressed due to low confidence (1)

docs/kubernetes.md:7

  • The word 'aswell' should be corrected to 'as well' for clarity and correctness.
Any modification of this `k8s/` directory must be updated in the [TeSS Helm repo](https://github.com/ElixirTeSS/TeSS-Helm) aswell. Thank you 🙏

@@ -0,0 +1,10 @@
apiVersion: v1
Copy link

Copilot AI Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file name 'backup-persistenvolumeclaim.yaml' appears to have a typo. Consider renaming it to 'backup-persistentvolumeclaim.yaml' for clarity and consistency.

Copilot uses AI. Check for mistakes.
to:
kind: Service
name: app-service
weight: null
Copy link

Copilot AI Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'weight: null' field might be unnecessary; consider removing it or assigning a numeric value to improve clarity.

Suggested change
weight: null

Copilot uses AI. Check for mistakes.
env.sample Outdated

# Database (db is the docker container name)
DB_HOST=db
DB_PORT=
Copy link

Copilot AI Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty DB_PORT in env.sample may lead to deployment issues; consider providing a default value (e.g., DB_PORT=5432) consistent with the documentation.

Suggested change
DB_PORT=
DB_PORT=5432

Copilot uses AI. Check for mistakes.
* Finn Bacall <finn.bacall@manchester.ac.uk>
* Servilio Afre Puentes <afrepues@sharcnet.ca>
* Aitor Apaolaza
* Finn Bacall <finn.bacall@manchester.ac.uk>
Copy link

Copilot AI Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appear to be duplicate contributor entries. Consider deduplicating to maintain a clear and accurate contributor list.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

@kennethrioja kennethrioja Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong, there are no duplicates in CONTRIBUTORS.md

@kennethrioja
Copy link
Contributor Author

kennethrioja commented Jun 26, 2025

After discussions with @fbacall, we decided to only have a Helm chart deployment through a separate Helm chart repository. This is avoiding maintenance of a k8 directory here and the Helm chart repository.

Before approving the PR I'd suggest to :

  1. fork the TeSS Helm chart repo in the ElixirTeSS organisation
  2. verify if the links in docs/kubernetes-helm-chart.md are correct

Dockerfile-k8 Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to avoid duplicating the existing Dockerfile?

For example, this dockerfile is out of sync with the main Dockerfile (different ruby version): https://github.com/ElixirTeSS/TeSS/blob/master/Dockerfile#L1

Could we inject the necessary K8 steps in there somehow?

Dockerfile Outdated
Comment on lines +33 to +34
SHELL [ "/bin/bash", "-c" ]
ENTRYPOINT bundle exec rails server -b 0.0.0.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change (and the one at the end of the file) seems to prevent running an alternative command in the container, for example to run tests: https://github.com/ElixirTeSS/TeSS/actions/runs/15994949196/job/45116138794

was there a specific reason for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was for linting reasons (ref), we can skip it.

@fbacall fbacall merged commit 9b0d17a into ElixirTeSS:master Jul 7, 2025
7 checks passed
@kennethrioja kennethrioja deleted the k8-convert branch July 7, 2025 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants