Kubernetes Build
The Mint System collection of Helm charts.
- 🚀 Install: Install Helm repository and get started with Odoo.
- 🛠️ Develop: Deploy Odoo and Postgres to a local Kubernetes cluster.
- 🏗️ Build: Fork and build your own Helm charts.
- 🚀 Deploy: Configure and deploy Helm charts to remote clusters.
Usage
You can use this project as any other Helm chart repository.
Add this Helm repository.
helm repo add kubernetes-build https://kubernetes.buildInstall a chart.
helm install "$NAME" "kubernetes-build/$NAME"Charts
List of charts:
- clusterIssuer
- odoo
- nextcloud
- postgres
- vshnPostgres
- hugo
- vuepress
- deploymentUpdater
- forgejoRunner
- taskfileBuild
Develop
Setup a local Kubernetes cluster and deploy the Helm charts.
Requirements
Setup the required tools:
- helm, kubectl and kubctx
- Setup kind or minikube
- Optional: bash/zsh alias
task='./task'with completion.
Clone the repository:
git clone git@github.com:Mint-System/Kubernetes-Build.git
cd Kubernetes-BuildStart Kubernetes cluster
Start cluster with kind.
task start-kindOr start cluster with minikube.
task start-minikubeDeploy Odoo chart
Add Helm chart repos.
task add-reposSsetup the local hostnames.
task setup-hostsInstall the CloudNativePG chart:
task install-chart cnpg values/knd.local.yamlInstall ingress-nginx in the current cluster.
task install-chart ingress-nginx values/knd.local.yamlInstall the Odoo chart:
task install-chart odoo values/odoo.knd.local.yamlThe Odoo database will be initialized automatically.
Forward the ingress-nginx port.
task forward ingress-nginxSetup haproxy ingress
Install haproxy-ingress in the current cluster.
task install-chart haproxy-ingress values/knd.local.yamlForward the haproxy-ingress port.
task forward haproxy-ingressDeploy
You can use this project to deploy the charts to these Kubernetes clusters:
APPUiO
Setup and deploy the Helm charts with APPUiO.
Login with OpenShift
Open the OpenShift console in your zone.
Click on the username on the top right and select Copy login command.
In the new tab click Display token and copy the Login with this token command.
Run the command in your shell.
Setup project
If not alrady done, create a project with the oc cli.
oc new-project odooCreate Odoo release
Add Helm repos to the local index.
task add-reposSwitch context to axo.
task switch-context axoInstall the Helm release.
task install-chart odoo values/odoo.axo.mintcloud.ch.yamlInfomaniak
Deploy the Helm charts to Infomaniak Managed Kubernetes service.
Setup project
Create new Kubernetes cluster in the Infomaniak manager. Then add an instance group.
Download the Kubeconfig file and move it.
mv ~/Downloads/pck-XXXXXXX-kubeconfig ~/.kube/config.chk
export KUBECONFIG=~/.kube/config.chk
kubectl get namespacesSwitch context to chk.
task switch-context chkCreate a namespace for the application.
k create <namespace>Setup ingress nginx
Add all repos and install the ingress nginx.
task add-repos
task install-chart ingress-nginx values/chk.mintcloud.ch.yamlSetup cert manager
Create an Infomaniak API token with domain scope: https://manager.infomaniak.com/v3/infomaniak-api
Setup the secret according to clusterIssuer > Secrets
Install cert manager with Infomaniak webhook.
task install-chart cert-manager values/chk.mintcloud.ch.yamlInstall cluster issuer.
task install-chart clusterIssuer values/chk.mintcloud.ch.yamlCreate Odoo release
Select the namespace.
kubensInstall the Odoo chart.
task install-chart odoo values/odoo.chk.mintcloud.chK3s
Setup project
Setup K3s cluster with Ansible: https://ansible.build/roles/k3s/
Setup Kubeconfig with alias rpi.
Switch context to rpi.
task switch-context rpiCreate a namespace for the application.
k create <namespace>Setup ingress nginx
Add all repos and install the ingress nginx.
task add-repos
task install-chart ingress-nginx values/k3s.raspberrypi.build.yamlSetup cert manager
Install cert manager.
task install-chart cert-manager values/k3s.raspberrypi.build.yamlInstall cluster issuer.
task install-chart clusterIssuer values/k3s.raspberrypi.build.yamlCreate Hugo release
Select the namespace.
kubensInstall the Hugo chart.
task install-chart hugoTroubleshooting
Reset the postgres password
The postgres data is persisted on the host. Removing the pvc will not deleted the postgres data. To update the password, enter the container and run:
psql -c "ALTER USER $PGUSER WITH PASSWORD '$PGPASSWORD';"