# Installation
On this page, you find a guide on how to run CincoCloud locally for development purposes on Linux, Windows and macOS.
# Preparations
In order to run CincoCloud locally, ensure that you have at least 8GB of RAM and at least 60GB of free disc space available.
# 1. Install necessary software
Install the following software:
- Docker (opens new window)
- buildx (opens new window)
- Helm (opens new window)
- Skaffold (opens new window) Use a version >= v1.37.0 & < v2.0.0, e.g. v1.39.4
- Minikube (opens new window)
- Kubectl (opens new window)
# 2. Run a local Kubernetes cluster
(CincoCloud works best with 4 CPU cores, 8Gb of RAM and 60GB of free disc space)
- Start the cluster with the Docker driver
minikube start --cpus 4 --memory 8192 --disk-size 60000mb --driver=docker
- Enable necessary plugins:
minikube addons enable default-storageclass && \
minikube addons enable ingress && \
minikube addons enable ingress-dns && \
minikube addons enable storage-provisioner
2
3
4
Add the minikube IP address to the hosts file (typically, this only has to be setup once)
Linux
- Execute
minikube ipto retrieve the IP address of the cluster - Add the entry
<IP> cinco-cloudto the/etc/hostsfile
Windows
- Add the entry
127.0.0.1 cinco-cloudto theC:\Windows\System32\drivers\etc\hostsfile
MacOS
- Add the entry
127.0.0.1 cinco-cloudto the/etc/hostsfile
- Execute
# 3. Get the Sources
- Clone the CincoCloud repository (opens new window)
# 4. Install necessary secrets
Apply preset development secrets to the cluster:
kubectl apply -f infrastructure/helm/secrets-local.yaml.Alternatively, create your own
secrets.yamlfile. The contents of the file should look like the following template. Ensure that the name of the secret iscinco-cloud-main-secretsand replace the placeholders with actual values of your choice:--- apiVersion: v1 kind: Secret metadata: name: cinco-cloud-main-secrets type: Opaque data: passwordSecret: <BASE64_ENCODED_SECRET> postgresUserPassword: <BASE64_ENCODED_DB_PASSWORD> postgresAdminPassword: <BASE64_ENCODED_DB_PASSWORD> root-user: <BASE64_ENCODED_MINIO_USER> root-password: <BASE64_ENCODED_MINIO_PASSWORD> minioAccessKey: <BASE64_ENCODED_MINIO_ACCESS_KEY> minioSecretKey: <BASE64_ENCODED_MINIO_ACCESS_KEY_SECRET> authPublicKey: <BASE64_ENCODED_RSA_PUBLIC_KEY> authPrivateKey: <BASE64_ENCODED_RSA_PUBLIC_KEY>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16Create the public and private key, e.g., using
openssl:openssl genrsa -out rsaPrivateKey.pem 2048 openssl rsa -pubout -in rsaPrivateKey.pem -out publicKey.pem1
2
# 5. Install Cert Manager
- Follow the following guide to install the cert manager for local SSL support: cert-manager (opens new window).
# Run CincoCloud
Ensure that the local cluster is running. Run
minikube statusand check if the output looks likeminikube type: Control Plane host: Running kubelet: Running apiserver: Running kubeconfig: Configured ``1
2
3
4
5
6
7In the root directory, execute
skaffold dev -p local-devand wait for all pods to be deployed. All pods listed bykubectl get podsshould have the statusrunning. Thanks to skaffold, you can now change the code and skaffold automatically rebuilds and redeploys new images with the changes.After the first start, extract the root certificate from the cluster:
Windows
kubectl get secret cinco-cloud-local-ca-cert-secret -o jsonpath="{.data['tls\.crt']}" | ForEach-Object {[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($_))} > cinco-cloud-local-rootCA.pemLinux/MacOS
kubectl get secret cinco-cloud-local-ca-cert-secret -o jsonpath={.data.'tls\.crt'} | base64 -d > cinco-cloud-local-rootCA.pem
Add
cinco-cloud-local-rootCA.pemto your browser's certificate store.Windows / MacOS: Open a terminal and execute
minikube tunnelto tunnel ingress ports to the host. Leave the terminal session open during the development.Open
https://cinco-cloud/frontendin a web browser to check if CincoCloud is reachable.Setup Minio Storage Server (only once)
Windows / Linux
- Execute
kubectl port-forward release-minio-0 9001:9001. Leave the terminal session open until you finished setting up Minio. - Open
http://127.0.0.1:9001
- Execute
MacOS
- Open a terminal and execute
minikube service release-minio --url. Two URLs starting withhttp://127.0.0.1:<PORT>will be displayed. One of them (propably the latter one) is the URL to the Minio admin console. Open the displayed URL in a web browser. You can close the session after having created the access key.
- Open a terminal and execute
- Login with the credentials provided in
cinco-cloud-main-secrets. Per default, the credentials areminioadmin:minioadmin. - Navigate to User > Access Keys and click on Create access key
- Create an access key with the details provided in
cinco-cloud-main-secretsand click oncreate. In the default development secrets, the access key and the secret key are both set tominio-sa. - Restart the pod of the main service:
kubectl delete pods -l app=main
# Skaffold development profiles
Use one of the following profiles in conjunction with skaffold dev -p <profile>.
| No | Name | SSL | Hot reload | Frontend URL | API URL |
|---|---|---|---|---|---|
| 1) | local-dev | yes | yes | /frontend | / |
| 2) | local-prod | yes | no | / | / |
- provides a local development environment with hot reload. If you want to simulate a production build on your local machine use 2).
# Access Mailhog
During registration, emails with activation links are sent to users. In the developement these emails are send to Mailhog. To access the Mailhog interface, perform the following steps:
kubectl (Linux)
- Execute
kubectl port-forward $(kubectl get pods -l app.kubernetes.io/name=mailhog -o name) 8025:8025. Leave the terminal session open as long as you access Mailhog. - Open
http://127.0.0.1:8025
kubectl (Windows)
- Execute
kubectl get pods -l app.kubernetes.io/name=mailhog -o nameto get the name of the Mailhog pod. - Execute
kubectl port-forward <RELEASE>-mailhog-<ID> 8025:8025. Leave the terminal session open as long as you access Mailhog. - Open
http://127.0.0.1:8025
minikube Linux/MacOS
- Execute
kubectl get serviceto list all services. - Open a terminal and execute
minikube service <RELEASE>-mailhog --url. Two URLs starting withhttp://127.0.0.1:<PORT>will be displayed. One of them (propably the latter one) is the URL to the Mailhog interface.