Skip to main content

Quickstart

LH for Kubernetes is delivered via LittleHorse Enterprises LLC's Kubernetes Operator. A Kubernetes Operator extends the Kubernetes API to make it easy, simple, and painless to manage complex applications on Kubernetes through declarative API's.

To access LittleHorse for Kubernetes, contact info@littlehorse.io to request production access or a free trial. You will receive through 1Password shared note a Kubernetes Secret that contains credentials to pull the Operator's docker image from our private Quay repository.

tip

If you just want to get started with LittleHorse to test it out, we recommend that you:

  1. Join our Slack Community for quick help!
  2. Try our open-source Quickstart to get up and running quickly.

Getting Started

In our quickstart, we'll deploy a minimal, bare-bones LittleHorse cluster.

Installing the Operators

First, add the LittleHorse Operator repo to your helm repository list:

helm repo add littlehorse https://littlehorse-enterprises.github.io/lh-helm-charts/

The LittleHorse Operator is namespace-scoped, so we recommend creating a namespace for LittleHorse:

kubectl create namespace littlehorse
kubectl config set-context --current --namespace littlehorse

Before installing the Operator, you will need to get our Image Pull Secrets by contacting info@littlehorse.io. Once you have done that, you can create the image pull secret as follows:

kubectl apply -f image-pull-secret.yaml

Next, you can install the LittleHorse Operator which comes bundled with Strimzi to manage Kafka.

helm upgrade --install lh \
--namespace littlehorse \
--set image.repository=quay.io/littlehorse/lh-operator \
--set image.tag=0.11.0 \
--set strimzi.deploy=true \
--set strimzi.enabled=true \
--set 'imagePullSecrets[0].name=littlehorse-pull-secret' \
littlehorse/lh-operator

You should see the following once you're done:

-> kubectl get pods -nlittlehorse
NAME READY STATUS RESTARTS AGE
lh-lh-operator-676687bff8-jdl56 1/1 Running 0 24s
strimzi-cluster-operator-6948497896-w7cx7 1/1 Running 0 38s
info

Strimzi is fantastic; however, the LHKafka CRD has several value-added features over Strimzi, such as:

  • Automatic rebalancing upon cluster scaling.
  • Cluster-wide quota approximations.
  • Simpler API.
  • Support for TLSRoute to access Kafka from outside the K8s cluster.
  • Automated migration from mixed controllers and brokers to separate nodes.

Deploying an LHCluster

The LHCluster CRD allows you to manage LittleHorse clusters on your Kubernetes environment. In order to run LittleHorse, you also need to run a Kafka cluster, but the good news is that our operator does that for you! All you need to do to deploy a LittleHorse cluster is to apply the following yaml:

---
apiVersion: littlehorse.io/v1
kind: LHKafka
metadata:
namespace: littlehorse
name: lh-kafka
spec:
controllers:
storage:
storageClassName: standard # TODO: Replace with your storageclass
volumeSize: "10G"
replicas: 3
---
apiVersion: littlehorse.io/v1
kind: LHCluster
metadata:
name: quickstart
namespace: littlehorse
spec:
server:
image: ghcr.io/littlehorse-enterprises/littlehorse/lh-server:0.11.2
listeners:
- name: internal
port: 2023
imagePullPolicy: IfNotPresent
hotStandbyReplicas: 1
replicas: 2
compute:
cpu: "2000m"
memory: "4G"
storage:
storageClassName: standard # TODO: Replace with your storageclass
volumeSize: "10G"
kafka:
replicationFactor: 3
clusterPartitions: 12
lhKafkaRef:
clusterName: 'lh-kafka'
clusterWideQuotas:
producerThroughputPerSecond: 5M
consumerThroughputPerSecond: 10M
---
apiVersion: littlehorse.io/v1
kind: LHDashboard
metadata:
name: quickstart-dashboard
namespace: littlehorse
spec:
image: ghcr.io/littlehorse-enterprises/littlehorse/lh-dashboard:0.11.2
imagePullPolicy: IfNotPresent
replicas: 1
api:
port: 2023
host: quickstart-server

Next Steps

This LHCluster is not configured for access from outside of your K8s cluster. You can follow along with our other guides to do that; however, most use-cases do not require accessing the LittleHorse from outside the Kubernetes cluster (just like you generally don't access Postgres from outside your VPN).

tip

If your applications require access to LittleHorse from outside of your Kubernetes Cluster, check out the Networking Docs.

Access the Dashboard

To verify that everything is working, you can do the following. In one terminal, run this command:

kubectl port-forward svc/quickstart-dashboard 3000:3000

Then go to http://localhost:3000 to view the dashboard.

Get lhctl Access

Your littlehorse.config can be empty, or look like the following:

LHC_API_HOST=localhost
LHC_API_PORT=2023

In one terminal, run:

kubectl port-forward svc/quickstart-server 2023:2023

Then in another terminal, test lhctl!

lhctl whoami

It should print out that you are the anonymous user.