Confluent for Kubernetes Quickstart

Prerequisites

  • A Kubernetes cluster conforming to one of the supported versions.
  • kubectl installed, initialized, with the context set. You also must have the kubeconfig file configured for your cluster.
  • Helm 3 installed.
  • Access to the Confluent for Kubernetes bundle.
  • For this quick start guide, your Kubernetes cluster is assumed to have a default dynamic storage provisioner.

Step 1: Create a namespace

  1. Create the namespace to use.

    kubectl create namespace confluent
    
  2. Set this namespace to default for your Kubernetes context.

    kubectl config set-context --current --namespace confluent
    

Step 2: Install Confluent for Kubernetes

  1. Add the Confluent for Kubernetes Helm repository.

    helm repo add confluentinc https://packages.confluent.io/helm
    helm repo update
    
  2. Install Confluent for Kubernetes.

    helm upgrade --install confluent-operator confluentinc/confluent-for-kubernetes
    

Step 3: Install Confluent Platform

  1. Install all Confluent Platform components.

    kubectl apply -f https://raw.githubusercontent.com/confluentinc/confluent-kubernetes-examples/master/quickstart-deploy/confluent-platform.yaml
    
  2. Install a sample producer app and topic.

    kubectl apply -f https://raw.githubusercontent.com/confluentinc/confluent-kubernetes-examples/master/quickstart-deploy/producer-app-data.yaml
    
  3. Check that everything is deployed:

    kubectl get pods
    

Step 4: View Control Center

Use Control Center to monitor the Confluent Platform, and see the created topic and data.

  1. Set up port forwarding to Control Center web UI from local machine:

    kubectl port-forward controlcenter-0 9021:9021
    
  2. Browse to Control Center:

    http://localhost:9021

  3. Check that the elastic-0 topic was created and that messages are being produced to the topic.

Bonus: Install and use Confluent kubectl plugin

The Confluent for Kubernetes (CFK) bundle contains a Confluent kubectl plugin for interacting with Confluent for Kubernetes.

  1. Download the CFK bundle using the following command, and unpack the downloaded bundle:

    curl -O https://packages.confluent.io/bundle/cfk/confluent-for-kubernetes-2.2.4.tar.gz
    
  2. Unpack the kubectl plugin that matches your client environment, Linux, Windows or Mac OS (Darwin), into your client environment local executables directory. On Mac OS and Linux, this would be /usr/local/bin/. This will allow the standard CLI kubectl to find the plugin.

    tar -xvf kubectl-plugin/kubectl-confluent-<environment>-amd64.tar.gz \
       -C <local directory for the plugin>
    

    For example, on Mac OS:

    tar -xvf kubectl-plugin/kubectl-confluent-darwin-amd64.tar.gz \
       -C /usr/local/bin/
    
  3. Open Confluent Control Center.

    kubectl confluent dashboard controlcenter
    
  4. View the Confluent Platform version

    kubectl confluent version