Skip to content

Contributor guide

Submitting PRs

To make the review process as smooth as possible for everyone we have some steps that we'd like you to follow

  • Look through our DEVELOPMENT.md

  • The pre-commit hook will run on all PRs to main, so either make sure to have it installed by running:

    pre-commit install
    

    Or manually run it before committing

    pre-commit run
    
  • Make sure to follow the PR template, see this for more details. Alternatively start a PR and you'll see it there.

Setting up your environment

To install all required tools, please follow the instructions here.

Tips and tricks

To make your life easier we suggest to use language server for the language that you're editing.

E.g.

To catch pre-commit errors early, direct in your editor, it's also suggested to install plugins for these tools.

When developing and you only working on a single application it will be faster to only deploy that application instead of applying all charts. This can be done by figuring out the app label for the application in question by running:

bin/ck8s ops helmfile {wc|sc} list

When you figured out the app label (lets say it's dex in this case) you can check the diff of your work by running:

bin/ck8s ops helmfile {wc|sc} -l app=dex diff

Instead of running helmfile apply, it might be useful to run helmfile sync. This will do a 3-way upgrade and make sure that the helm state matches the objects actually running in kubernetes. This will make sure that you haven't manually edited something for debugging and forgot about it.

bin/ck8s ops helmfile {wc|sc} -l app=dex sync

Object storage

To make creating and deletion of buckets easy, we've a script to help you with that, see here (the quickstart has instructions on how to use it).

DNS

These following snippets can be used to setup/remove all DNS records required for ck8s using exoscales cli.

Start by setting up some variables:

DOMAIN="example.com"
IP="203.0.113.123" # IP to LB/ingress endpoint for the service cluster
CK8S_ENVIRONMENT_NAME="my-cluster-name"

SUBDOMAINS=(  "*.ops.${CK8S_ENVIRONMENT_NAME}"
              "grafana.${CK8S_ENVIRONMENT_NAME}"
              "harbor.${CK8S_ENVIRONMENT_NAME}"
              "kibana.${CK8S_ENVIRONMENT_NAME}"
              "dex.${CK8S_ENVIRONMENT_NAME}"
              "notary.harbor.${CK8S_ENVIRONMENT_NAME}" )
# Adding the A records
for SUBDOMAIN in "${SUBDOMAINS[@]}"; do
  exo dns add A "${DOMAIN}" -a "${IP}" -n "${SUBDOMAIN}"
done
# Removing the records
for SUBDOMAIN in "${SUBDOMAINS[@]}"; do
  exo dns remove "${DOMAIN}" "${SUBDOMAIN}"
done

Reusing clusters

If you for some reason need to reinstall Compliant Kubernetes from scratch, we have some scripts that removes all objects created by this repo. The scripts can be found here (clean-sc.sh and clean-wc.sh).