This repository contains configuration and deployment files for running Apache Kafka on OpenShift using the Strimzi Kafka Operator.
- References
- Table of Contents
- Repository Structure
- Concepts
- Prerequisites
- Strimzi Kafka Operator deployment
- Kafka Cluster
- Strimzi Kafka Operator uninstallation
kafka/
├── README.md # Main documentation
├── deploy/ # Deployment YAML files
│ ├── strimzi-values/ # Helm values files for different environments
│ │ ├── openshift-dev-example.yaml
│ │ └── openshift-prod-example.yaml
│ └── kafka-clusters/ # Additional Kafka cluster deployment examples
│ └── README.md # Documentation for Kafka cluster deployment
├── scripts/ # Installation and cleanup scripts
│ ├── install.sh # Script for automated installation
│ ├── uninstall.sh # Script for automated uninstallation
│ └── README.md # Documentation for the install script
-
Deploy the Strimzi operator in a dedicated namespace, separate from the Kafka cluster and its components, to maintain clear resource and configuration boundaries.
-
Use a single Strimzi operator to manage all Kafka instances within the cluster, avoiding conflicts and redundancy.
-
The Cluster Operator uses
ClusterRoleresources to access necessary resources, which may require cluster administrator privileges for setup.
Strimzi operators manage resources across namespaces with the following capabilities:
- Cluster Operator: Can watch a single namespace, multiple namespaces, or all namespaces in the cluster.
- Topic Operator and User Operator: Limited to watching a single namespace.
- Access Operator: Can watch a single namespace or all namespaces.
Strimzi provides custom roles to delegate permissions for managing Strimzi resources:
-
strimzi-view: Allows users to view and list Strimzi resources (aggregates into default Kubernetesviewrole). -
strimzi-admin: Grants additional permissions to create, edit, or delete Strimzi resources (aggregates into default Kuberneteseditandadminroles).
A cluster administrator can assign these roles to non-cluster administrators after deploying the Cluster Operator.
- On your Linux client
- OpenShift client utility:
oc - Helm client utility v3.11 or higher:
helm - Local clone of this repo
- OpenShift client utility:
- On OpenShift
- Cluster admin privileges
- Access to
quay.ioregistry
-
Add the Strimzi Helm Repository
helm repo add strimzi https://strimzi.io/charts/ helm repo update
-
Deploy the Strimzi Kafka Operator
NAMESPACE=kafka-operator helm install strimzi-kafka-operator strimzi/strimzi-kafka-operator \ --namespace $NAMESPACE \ --values deploy/strimzi-values/openshift-dev-example.yaml -
Verify the Deployment
NAMESPACE=kafka-operator helm status strimzi-kafka-operator -n $NAMESPACE oc get pods -n $NAMESPACE
The deployment process can be automated using the provided script. For additional details, please refer to the script README.
To deploy your Kafka cluster for different use cases and customizations, refer to the examples provided in Kafka Clusters deployment.
You can uninstall the Strimzi Kafka Operator and related resources either manually or using the provided script.
-
Delete Kafka Custom Resources
NAMESPACE=kafka-operator oc delete kafka --all -n $NAMESPACE -
Uninstall the Helm Release
NAMESPACE=kafka-operator helm uninstall strimzi-kafka-operator -n $NAMESPACE -
Delete Custom Resource Definitions (CRDs)
oc get crds | grep kafka | awk '{print $1}' | xargs oc delete crd
-
Delete the Namespace (Optional)
NAMESPACE=kafka-operator oc delete namespace $NAMESPACE
Use the provided uninstall.sh script to automate the uninstallation process.
For additional details, please refer to the script README.