Deploying a Custom Component to Your Cluster

Deploy a custom component to your self-hosted cluster

🔍 Introduction

Your custom component code is packaged inside a Docker image, and you have generated a Helm configuration file for your deployment. Now, how do you apply your helm configuration so your code gets deployed to your cluster?

NOTE: This guide only applies to clusters that are not hosted by Indico. To deploy a custom component to an Indico-hosted cluster, please email the values.yaml file to [email protected], and we will take care of the rest.

Prerequisites

Before deploying your component, you must package it in a Docker image ( Containerizing a Custom Component) and generate a values.yaml file that Helm can use to deploy your service ( Configuring your Custom Component Deployment).

🔨 Required Tools

Helm

Indico uses Helm charts to manage deployment. To learn more about Helm, check out their documentation.

Please ensure Helm is installed on your machine before proceeding with this guide. The Helm docs include installation instructions.

Kubectl

Kubectl is a command line tool for communicating with Kubernetes clusters. Helm uses kubectl to authenicate and determine which clusters to edit.

Before continuing with this guide, please make sure kubectl is pointing to the cluster where you want to deploy your component. Reach out to Indico customer support at [email protected] if you need help connecting to your cluster.

⬆️ Applying your Helm Chart

For self-hosted clusters

  1. Make sure you are connected to the cluster where you would like to deploy. The command kubectl config current-context will show which cluster you are connected to.
  2. Install your service on the cluster.
helm install <your release name> -f values.yaml indico/custom-component\`

💯 Verifying Deployment

✅ Check that your Pod is running

To verify that your pods Kubernetes deployment is added, run kubectl get deployments | grep <YOURAPP>. This will let you know that there is a successful deployment was created. So, assuming your app is named custom-app-name (which we will use for the rest of this doc) you'll see something like the below:

you@your-machine:~/cod$ kubectl get deployments | grep custom-app-name
cusotm-app-name-default                    1/1     1            1           41d

Once you have verified that, you can verify the pod containing this new app is running.

Run kubectl get pods | grep <YOURAPP> and make sure the pod status is RUNNING.

custom-app-name-default-7f6794977-9bhvq                     1/1     Running     0                16d   

✅ Check that Queues are created

Next, check that rabbitmq has the appropriate queues created for your app:

kubectl get pods | grep rabbitmq

you@your-machine:~/cod$ kubectl get pods | grep rabbitmq
rabbitmq-0                                             1/1     Running     0                26d
rabbitmq-1                                             1/1     Running     0                11d

kubectl exec --stdin --tty rabbitmq-0 -- /bin/bash

rabbitmqctl list_queues | grep custom-app-name

In the list of queues, you should see reference to your app, for example:

I have no name!@rabbitmq-0:/$ rabbitmqctl list_queues | grep custom-app-name
[email protected] 0
custom-app-name_default      0
I have no name!@rabbitmq-0:/$

📔 Accessing logs

With a successful deployment and running pod(s), the next step is to access the logs. There are a few ways to access these logs. First, you can access all logs for all associated pods using the deployment name: kubectl logs deployment/custom-app-name-default -f. The -f flag will cause it to tail (follow) the pods' logs.

You can also inspect a specific pod, if you have more than one, by invoking the same command but substituting in the pod's name instead. kubectl logs custom-app-name-default-7f6794977-9bhvq -f