Install with Helm

In this section, you will find how to install Horusec web application in your Kubernetes cluster using Helm.

What is it?

Helm is a package manager that gathers in one file named Chart all Kubernetes' features to make an application. Check out Helm’s documentation for more details.

In this installation case here, the goal is for you to use Horusec’s web application together with you Kubernete’s cluster with Helm.

Requisites

For this configuration, you will need:

  • Access to the cluster where you want to install Horusec Manager (If tou are using multiple clusters clusters, check out to see how to configure how to configure their access).

  • Helm client with a version > 3.1.1.

  • PostgreSQL connection to store data.

  • RabbitMQ connection as a message-broker (Optional).

Horusec Helm Charts

Horusec’s web application solution has 7 different services and each one of them has a specific chart.

The commands in this guide use Helm Charts already included in Horusec’s release package according to each service:

  1. Account
  2. Analytic
  3. Api
  4. Auth
  5. Manager
  6. Messages
  7. Webhook

Pre-configuration

Before start the Horusec’s web application service installation, it is important you have performed some previously configurations:

Data storage and message-broker

Follow the steps below to configure Horusec Helm Charts:

Step 1. Create the namespace horusec-system for Horusec’s components (if you have already done it, go to next step):

kubectl create namespace horusec-system

Step 2. Add the Bitnami’s Chart repository and install what you need:

helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update

helm install rabbitmq bitnami/rabbitmq -n horusec-system

helm install postgresql --set postgresqlDatabase=horusec_db bitnami/postgresql -n horusec-system

Sensitive data configuration

If you haven’t configured yet, start with:

Step 1: Create horusec-system namespace for the Horusec’s components:

kubectl create namespace horusec-system

Step 2: The services that make this solution use Kubernetes' Secrets to manage sensitive data like passwords, oAuth tokens and SSH keys. Because of that, you have to configure some Secrets before starting the installation.

Step 3: Create Kubernetes' Secrets:

kubectl create secret generic database-username --from-literal=database-username=$POSTGRES_USERNAME
kubectl create secret generic database-password --from-literal=database-password=$POSTGRES_PASSWORD
kubectl create secret generic database-uri --from-literal=database-uri=postgresql://$POSTGRES_USERNAME:$POSTGRES_PASSWORD@postgresql:5432/horusec_db?sslmode=disable

kubectl create secret generic broker-username --from-literal=broker-username=$RABBITMQ_USERNAME
kubectl create secret generic broker-password --from-literal=broker-password=$RABBITMQ_PASSWORD

kubectl create secret generic jwt-token --from-literal=jwt-token=$JWT_SECRET

Horusec’s services installation

After finishing all configuration, you can go to Horusec’s release package’s root directory and follow the next instructions to install the services:

helm install account horusec-account/deployments/helm/horusec-account -n horusec-system
helm install analytic horusec-analytic/deployments/helm/horusec-analytic -n horusec-system
helm install api horusec-api/deployments/helm/horusec-api -n horusec-system
helm install auth horusec-auth/deployments/helm/horusec-auth -n horusec-system
helm install manager horusec-manager/deployments/helm/horusec-manager -n horusec-system
helm install messages horusec-messages/deployments/helm/horusec-messages -n horusec-system
helm install webhook horusec-webhook/deployments/helm/horusec-webhook -n horusec-system

Access to Horusec Helm Charts

After all the services are installed and running in your enviroment, you can access the graphic interface through a link offered by [Horusec-Manager](https://horusec.io/docs-v1/web/services/manager/ service.

The Charts default behaviour is to create an Ingress with an input rule routing the HTTP traffic to your service based on a specific host. Because of that, it’s recommended to use Ingress Controller to manage the external access to your Kubernetes' cluster services.

kubectl -n horusec-system get ingresses manager-horusec-manager -o jsonpath='{.status.loadBalancer.ingress[0].ip}'

The easiest way to access these addresses without the DNS configuration is to add them to the Host files in your machine. For example:

export INGRESS_HOST=$(kubectl -n horusec-system get ingresses manager-horusec-manager -o jsonpath='{.status.loadBalancer.ingress[0].ip}')

echo "$INGRESS_HOST        api-horus-dev.zup.com.br" | sudo tee -a /etc/hosts
echo "$INGRESS_HOST        horus-dev.zup.com.br" | sudo tee -a /etc/hosts
echo "$INGRESS_HOST        account-horus-dev.zup.com.br" | sudo tee -a /etc/hosts
echo "$INGRESS_HOST        analytic-horus-dev.zup.com.br" | sudo tee -a /etc/hosts
echo "$INGRESS_HOST        auth-horus-dev.zup.com.br" | sudo tee -a /etc/hosts

After you’ve done that, access the configured URL to access Horusec’s Manager http://horus-dev.zup.com.br/