1. Operating StreamNative Platform
  2. Deploy

Deploy StreamNative Platform on native Kubernetes clusters

After creating a Kubernetes cluster, you can deploy StreamNative Platform.

Prerequisites

  • kubectl: v1.16 or higher
  • Helm: v3.0 or higher
  • Kubernetes server v1.16 or higher
  • cert-manager operator: v1.0.0 or higher
  • Vault operator: v1.5.0 or higher
  • Function Mesh operator: v0.1.7 (recommended)
  • Pulsar operator: v0.9.0 (recommended)

Install StreamNative Platform

This section describes how to install StreamNative Platform in online mode.

Install StreamNative Platform using original images within operators

Note

By default, the helm upgrade --install command installs the latest operators. If you want to install a specific operator, use the --version option to specify the operator image version. For details about the version relationship between operator images and StreamNative Platform 1.9.0, see StreamNative Platform version matrix.

This section describes how to install StreamNative Platform using original images within the operators.

  1. Install the StreamNative repositories.

    helm repo add streamnative https://charts.streamnative.io
    helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com
    helm repo add jetstack https://charts.jetstack.io
    helm repo add function-mesh http://charts.functionmesh.io/
    helm repo update
    
  2. Create a Kubernetes namespace.

    kubectl create namespace <k8s_namespace>
    
  3. Install the Vault operator.

    The Vault operator creates and maintains highly-available Vault clusters on Kubernetes, allowing you to easily deploy and manage Vault clusters for your applications.

    helm upgrade --install vault-operator banzaicloud-stable/vault-operator -n <k8s_namespace>
    
  4. Install the cert-manager.

    The cert-manager is a native Kubernetes certificate management controller. It helps issue certificates from HashiCorp Vault. The cert-manager ensures that certificates are valid and up-to-date, and attempts to renew certificates at a configured time before expiry.

    The cert-manager requires a number of CRD resources to be installed into your cluster as part of installation. To automatically install and manage the CRDs as part of your Helm release, you must add the --set installCRDs=true flag to your Helm installation command.

    helm upgrade --install cert-manager jetstack/cert-manager -n <k8s_namespace> --set installCRDs=true
    
  5. Install the Pulsar operator.

    helm upgrade --install pulsar-operator streamnative/pulsar-operator -n <k8s_namespace>
    
  6. Install the Function Mesh operator.

    Function Mesh is a serverless and purpose-built framework for orchestrating multiple Pulsar Functions and Pulsar IO connectors for stream processing applications.

    helm upgrade --install function-mesh-operator function-mesh/function-mesh-operator -n <k8s_namespace>
    

Install StreamNative Platform using customized images

This section describes how to install StreamNative Platform using customized images.

  1. Install the StreamNative repositories.

    helm repo add streamnative https://charts.streamnative.io
    helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com
    helm repo add jetstack https://charts.jetstack.io
    helm repo add function-mesh http://charts.functionmesh.io/
    helm repo update
    
  2. Create a Kubernetes namespace.

    kubectl create namespace <k8s_namespace>
    
  3. Install the Vault operator.

    The Vault operator creates and maintains highly-available Vault clusters on Kubernetes, allowing you to easily deploy and manage Vault clusters for your applications.

    a. Inspect the chart used for installing the Vault operator and save the contents of values.yaml file as a local YAML file.

    This example saves the values.yaml file as value_vault-operator.yaml file.

    helm inspect values banzaicloud-stable/vault-operator  > value_vault-operator.yaml
    

    b. Update the image setting in the value_vault-operator.yaml file.

    You can specify the location and version of the image using the image.bankVaultsRepository and image.tag parameters. This example specifies the Vault image published to the Docker Hub by Banzai Cloud.

    image:
      bankVaultsRepository: banzaicloud/bank-vaults
      repository: banzaicloud/vault-operator
      # tag: ""
      pullPolicy: IfNotPresent
      imagePullSecrets: [] # global.imagePullSecrets is also supported
    

    c. Install the Vault operator with the customized image.

    helm upgrade --install -f value_vault-operator.yaml vault-operator banzaicloud-stable/vault-operator -n <k8s_namespace>
    
  4. Install the cert-manager.

    The cert-manager is a native Kubernetes certificate management controller. It helps issue certificates from HashiCorp Vault. The cert-manager ensures that certificates are valid and up-to-date, and attempts to renew certificates at a configured time before expiry.

    The cert-manager requires a number of CRD resources to be installed into your cluster as part of installation. To automatically install and manage the CRDs as part of your Helm release, you must add the --set installCRDs=true flag to your Helm installation command.

    a. Inspect the chart used for installing the cert-manager and save the contents of values.yaml file as a local YAML file.

    This example saves the values.yaml file as value_cert-manager.yaml file.

    helm inspect values jetstack/cert-manager  > value_cert-manager.yaml
    

    b. Update the image settings in the value_cert-manager.yaml file.

    You can specify the location and version of images using the image.repository and image.tag parameters. StreamNative mirrors the cert-manager images to the Docker Hub. This example specifies the cert-manager images published to the Docker Hub by StreamNative.

    image:
      repository: quay.io/jetstack/cert-manager-controller
      tag: v1.4.0
      pullPolicy: IfNotPresent
      image:
        repository: quay.io/jetstack/cert-manager-webhook
        tag: v1.4.0
        pullPolicy: IfNotPresent
      image:
        repository: quay.io/jetstack/cert-manager-cainjector
        tag: v1.4.0
        pullPolicy: IfNotPresent
    

    c. Install the cert-manager with the customized images.

    helm upgrade --install -f value_cert-manager.yaml  cert-manager jetstack/cert-manager -n <k8s_namespace> --set installCRDs=true
    
  5. Install the Pulsar operator.

    a. Inspect the chart used for installing the Pulsar operator and save the contents of values.yaml file as a local YAML file.

    This example saves the values.yaml file as value_pulsar-operator.yaml file.

    helm inspect values streamnative/pulsar-operator  > value_pulsar-operator.yaml
    

    b. Update the image setting in the value_pulsar-operator.yaml file.

    You can specify the location and version of images using the images.repository and images.tag parameters. This example specifies the images for ZooKeeper, BookKeeper, and Pulsar published to the Docker Hub by StreamNative.

    images:
      zookeeper:
        repository: docker.cloudsmith.io/streamnative/operators/zookeeper-operator
        tag: v0.9.0
        pullPolicy: IfNotPresent
      bookkeeper:
        repository: docker.cloudsmith.io/streamnative/operators/bookkeeper-operator
        tag: v0.9.0
        pullPolicy: IfNotPresent
      pulsar:
        repository: docker.cloudsmith.io/streamnative/operators/pulsar-operator
        tag: v0.9.0
        pullPolicy: IfNotPresent
    

    c. Install the Pulsar operator with the customized YAML file.

    helm upgrade --install pulsar-operator -f value_pulsar-operator.yaml streamnative/pulsar-operator -n <k8s_namespace>
    
  6. Install the Function Mesh operator.

    Function Mesh is a serverless and purpose-built framework for orchestrating multiple Pulsar Functions and Pulsar IO connectors for stream processing applications.

    a. Inspect the chart used for installing the Function Mesh operator and save the contents of values.yaml file as a local YAML file.

    This example saves the values.yaml file as value_function-mesh-operator.yaml file.

    helm inspect values function-mesh/function-mesh-operator  > value_function-mesh-operator.yaml
    

    b. Update the image setting in the value_function-mesh-operator.yaml file.

    You can specify the location and version of the image using the operatorImage parameter. This example specifies the FunctionMesh image published to the Docker Hub by StreamNative.

    # operatorImage is Function Mesh Operator image
    operatorImage: streamnative/function-mesh:v0.1.6-rc1
    imagePullPolicy: IfNotPresent
    imagePullSecrets: []
    

    c. Install the Function Mesh operator with the customized YAML file.

    helm upgrade --install function-mesh -f value_function-mesh-operator.yaml function-mesh/function-mesh-operator -n <k8s_namespace>
    

Deploy Pulsar clusters

To deploy a Pulsar cluster, follow these steps.

  1. Create a Kubernetes namespace for your Pulsar cluster.

    kubectl create namespace <k8s_namespace>
    
  2. Define a Pulsar cluster configuration file.

  3. Apply the YAML file to create a Pulsar cluster.

    helm install -f /path/to/pulsar/file.yaml <release_name> streamnative/sn-platform --set initialize=true -n <k8s_namespace>
    
  4. (Optional) Update your Pulsar cluster.

    You can update your Pulsar cluster by updating the YAML file and then execute the helm upgrade command.

    helm upgrade -f /path/to/pulsar/file.yaml <release_name> streamnative/sn-platform -n <k8s_namespace>
    

Uninstallation

This section describes how to uninstall Pulsar cluster and StreamNative Platform.

  • Execute the following command to uninstall the Pulsar cluster.

    helm uninstall <release_name> -n <k8s_namespace>
    
  • Execute the following commands to uninstall StreamNative Platform.

    helm uninstall vault-operator -n <k8s_namespace>
    helm uninstall cert-manager -n <k8s_namespace>
    helm uninstall pulsar-operator -n <k8s_namespace>
    helm uninstall function-mesh-operator -n <k8s_namespace>
    

Note

If you want to delete the PVCs or the Secret, you need to delete them together. Otherwise, you will fail to reinstall the StreamNative Platform. It is recommended that you exercise caution when deleting the PVCs or the Secret because some of your significant information cannot be restored once you have deleted them.

Previous
Prepare a Kubernetes Cluster