Author : MD TAREQ HASSAN | Updated : 2021/04/24

What is Strimzi Operators?

Strimzi Deployment of Kafka

Installing Helm

Azure cloudshell already have kubectl and helm installed

Check versions

az aks get-credentials --resource-group xyz-rg --name xyz-aks-cluster

kubectl version
kubectl version --short

helm version
helm version --short

Installing Strimzi Operators Using Helm

Open cloudshell and initialize to execute commands

az aks get-credentials --resource-group xyz-rg --name xyz-aks-cluster

Add and update repo

# add and update repo
helm repo add strimzi https://strimzi.io/charts/
helm repo update

Check versions

helm search repo strimzi --versions

Check current namespace

kubectl config view --minify | grep namespace # nothing returned -> means default namespace

Create namespace if needed

kubectl create ns xyz

# Or -> kubectl create namespace xyz

Switch to target namespace

kubectl config set-context --current --namespace xyz

# check switched to correct namespace
kubectl config view --minify | grep namespace

Install Command

# Again: Switch to target namespace if needed
kubectl config set-context --current --namespace xyz

#
# Release name "strimzi-kafka-release"
# helm install <release-name> <chart-name>
# helm install -generate-name <chart-name>
# helm install -g <chart-name>
# 
helm install strimzi-kafka-release strimzi/strimzi-kafka-operator


# Let helm to generate release name
helm install -g strimzi/strimzi-kafka-operator  


# Install in target namespace
helm install -g strimzi/strimzi-kafka-operator --namespace xyz


# Install target version
helm install -g strimzi/strimzi-kafka-operator --version 0.22.1

Checking Strimzi Installation

# Set target context (don't forget to change namespace if you have multiple namespaces)
kubectl config set-context --current --namespace xyz

# current context set in above command
helm list # check release

kubectl get deployments
kubectl get pods

# Check CRDs (Custom Resource Definition)
kubectl get crd
kubectl get crd | grep strimzi

More checking

kubectl get pod -n kafka --watch

# will show huge info -> 'Ctrl + C' to exit
kubectl logs deployment/strimzi-cluster-operator -n kafka -f

Deleting Strimzi Operators

In case you want to delete Strimzi and start again

Helm commands

# Check current namespace before executing command
kubectl config view --minify | grep namespace
kubectl config set-context --current --namespace xyz


# get release name
helm list


helm delete strimzi-release-name  # current context is set in above command


# if -g (--generate-name) was used during installation, delete command example:
helm delete strimzi-kafka-operator-1619204

Check deleted successfully

helm list
kubectl get pods # check namespace is set

Now, check CRDs

kubectl get crd

If CRDs were not deleted, then need to delete CRDs manually. See: Solution of Helm Error rendered manifests contain a resource that already exists

Installing Strimzi Operators Using kubectl

In case you don’t have Helm (for some reason), use kubectl commands

kubectl create namespace kafka

kubectl create -f 'https://strimzi.io/install/latest?namespace=kafka' -n kafka

Next

Kafka on Kubernetes Using Strimzi Operators