Deploy Confluent for Kubernetes

The Confluent for Kubernetes (CFK) bundle contains Helm charts, templates, and scripts for deploying Confluent Platform to your Kubernetes cluster.

You can deploy CFK using one of the following methods:

You can install the optional Confluent plugin for interacting with CFK using one of the following methods:

Deploy Confluent for Kubernetes from Confluent’s Helm repo

  1. Add a Helm repo:

    helm repo add confluentinc https://packages.confluent.io/helm
    
    helm repo update
    
  2. Install CFK using the default configuration:

    helm upgrade --install confluent-operator \
      confluentinc/confluent-for-kubernetes \
      --namespace <namespace>
    

Deploy Confluent for Kubernetes using the download bundle

  1. Download and unpack the following CFK bundle:

    https://confluent-for-kubernetes.s3-us-west-1.amazonaws.com/confluent-for-kubernetes-2.2.0.tar.gz

  2. From the helm sub-directory of where you downloaded the CFK bundle, install CFK:

    helm upgrade --install confluent-operator \
      ./confluent-for-kubernetes \
      --namespace <namespace>
    

Deploy customized Confluent for Kubernetes

You can customize the configuration of CFK when you install or update it. Since CFK is installed and updated with helm, the methods for customing CFK configuration are as per helm, i.e. you can:

  • set configuration values in a YAML file which you can pass to helm commands via the --values or -f flag
  • set configuration values as key=value pairs directly in your helm commands via the --set, --set-string, and --set-file flags
  • combine the two above approaches, where you may set some configuration in a values file and others on the command line with the --set flags.

Refer to Helm documentation for more details on these flags.

To deploy customized Confluent for Kubernetes using the CFK values.yaml file:
  1. Find the default values.yaml file:

    • If you are using Helm repo to deploy CFK, pull the CFK Chart:

      mkdir -p <CFK-home>
      
      helm pull confluentinc/confluent-for-kubernetes \
        --untar \
        --untardir=<CFK-home> \
        --namespace <namespace>
      

      The values.yaml file is in the <CFK-home>/confluent-for-kubernetes directory.

    • If you are using a download bundle to deploy CFK, the values.yaml file is in the helm/confluent-for-kubernetes directory under where you downloaded the bundle.

  2. Create a copy of the values.yaml file to customize CFK configuration. Do not edit the default values.yaml file. Save your copy to any file location; we will refer to this location as <path-to-values-file>.

  3. Install CFK using the customized configuration:

    helm upgrade --install confluent-operator \
      confluentinc/confluent-for-kubernetes \
      --values <path-to-values-file> \
      --namespace <namespace>
    
To deploy customized Confluent for Kubernetes with the helm upgrade command:

Specify the configuration options using the --set flag:

helm upgrade --install confluent-operator \
  confluentinc/confluent-for-kubernetes \
  --set <setting1>=<value1> \
  --set <setting2>=<value2> \
  ...
  --namespace <namespace>

Configure CFK to manage Confluent Platform components across all namespaces

By default, CFK only deploys and manages Confluent Platform component clusters and resources in the same Kubernetes namespace where CFK itself is deployed. To enable CFK to manage Confluent Platform resources across all namespaces, set the namespaced configuration property to false in the install command:

helm upgrade --install confluent-operator \
  confluentinc/confluent-for-kubernetes \
  --set namespaced=false \
  --namespace <namespace>

Alternatively, you can update the values.yaml file as described above, and set the following property:

namespaced: false

Deploy Confluent for Kubernetes without creating roles and role bindings

By default, when you deploy CFK via helm, the helm installation will also create the Kubernetes role and role binding (or cluster role and cluster role binding) needed for CFK to function at the same time for convenience. However, as the user responsible for deploying CFK, you may not have the ability to manage Kubernetes RBAC permissions, so your helm installation would fail. The responsibility for managing Kubernetes RBAC permissions may only belong to your Kubernetes cluster administrator. In this situation, your Kubernetes cluster admin must have already created the requisite RBAC resources in advance (see Prepare Kubernetes Cluster for Confluent Platform). To instruct helm to skip trying to create RBAC resources again, add --set rbac=false to the install command:

helm upgrade --install confluent-operator \
  confluentinc/confluent-for-kubernetes \
  --set rbac=false \
  --namespace <namespace>

Alternatively, you can update the values.yaml file as described above, and set the following property:

rbac: false

Deploy Confluent for Kubernetes with custom service account

To provide a custom service account to manange CFK, add --set serviceAccount.create=false --set serviceAccount.name=<name> to the install command:

helm upgrade --install confluent-operator \
  confluentinc/confluent-for-kubernetes \
  --set serviceAccount.create=false \
  --set serviceAccount.name=<service-account-name> \
  --namespace <namespace>

Alternatively, you can update the values.yaml file as described above, and set the following property:

serviceAccount:
  create: false
  name: <service-account-name>

Note that if you use a custom service account and set rbac=false, meaning that the roles and role bindings were pre-created by your Kubernetes cluster admin, then you must ensure that your <service-account-name>> matches the subject name in the pre-created role binding.

Install Confluent plugin

The Confluent for Kubernetes (CFK) bundle contains a Confluent plugin for interacting with Confluent for Kubernetes. It is supported for three environments: Linux, Windows, and Darwin. See Confluent plugin for more information about the tool.

  1. If you deployed CFK using Helm repo, download and unpack the CFK bundle. If you used Deploy Confluent for Kubernetes using the download bundle, skip this step.

    https://confluent-for-kubernetes.s3-us-west-1.amazonaws.com/confluent-for-kubernetes-2.2.0.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/
    

Install Confluent plugin using Krew

Krew is the plugin manager for kubectl. Take the following steps if you want to use Krew to install the Confluent plugin.

  1. Install Krew as described in Krew User Guide.

  2. Run the following command to install the Confluent plugin:

    kubectl krew  install \
      --manifest=confluent-platform.yaml \
      --archive=kubectl-confluent-<environment>-amd64.tar.gz
    

    For example, to install the plugin on MacOS:

    kubectl krew  install \
      --manifest=confluent-platform.yaml \
      --archive=kubectl-confluent-darwin-amd64.tar.gz