Overview 🔗︎

Banzai Cloud Pipeline Kubernetes Engine (PKE) is a simple, secure and powerful CNCF-certified Kubernetes distribution, the preferred Kubernetes run-time of the Pipeline platform. It was designed to work on any cloud, VM or on bare metal nodes to provide a scalable and secure foundation for private clouds. PKE is cloud-aware and includes an ever-increasing number of cloud and platform integrations.

This quickstart guides you through the steps needed to set up a PKE cluster on AWS with Banzai Cloud Pipeline.

Prerequisites 🔗︎

  • AWS credentials
  • Banzai CLI tool authenticated against the Pipeline instance

Create an AWS secret 🔗︎

In order to access resources on AWS the appropriate credentials need to be registered in the Banzai Cloud Pipeline’s secret store. (The reference to this secret will be used later on instead of passing the credentials around)

Follow this guide to create PKE AWS credentials

The following values are needed for the secret:

  • AWS Access Key ID
  • AWS Secret Access Key
  • Default region name

You can simply do this with the following command (replace the values in the mustache brackets) :

banzai secret create <<EOF 
{
    "name": "pke-aws",
    "type": "amazon",
    "values": {
      "AWS_ACCESS_KEY_ID": "{{aws_access_key_id}}",
      "AWS_DEFAULT_REGION": "{{aws_default_region}}",
      "AWS_SECRET_ACCESS_KEY": "{{aws_secret_access_key}}"
    }
  }
EOF
Id                                                                Name     Type    UpdatedBy  Tags
b32343e28d37e09c26d91b4271eaa8dd689b16d9f1aba07fdc73af2a27750309  pke-aws  amazon  lpuskas    []

Alternatively you could use the --magic flag for creating the secret provided the AWS credentials are available in the local environment:

banzai secret create -t amazon -n pke-aws-secret --magic --tag ""

Create a PKE cluster on AWS 🔗︎

To create PKE clusters on AWS using the CLI, complete the following steps. Alternatively, you can use the Pipeline web UI.

You can check the available regions and instance types in our Cloudinfo service.

  1. Create a cluster descriptor JSON file. This file specifies the properties of the cluster you want to create.

    For the details of the possible options and values you can use in the descriptor, see Create cluster descriptor reference for PKE on AWS and the examples on this page.

    1. To list the AWS regions where the PKE service is supported, run:

      curl https://banzaicloud.com/cloudinfo/api/v1/providers/amazon/services/pke/regions | jq .
      
    2. To list the supported Kubernetes versions in a given region, run the following command:

      curl https://banzaicloud.com/cloudinfo/api/v1/providers/amazon/services/pke/regions/us-east-2/versions | jq .
      
  2. Log in to Pipeline.

  3. Create the cluster by running the following command:

    banzai cluster create --file <path-to-cluster-descriptor-json>
    
  4. Check the status of the cluster.

    To check the status of the cluster, run the following command:

    banzai cluster get "<cluster-name>"
    

    Once the cluster is ready, you can try to run some simple commands. banzai cluster shell executes a shell within the context of the selected cluster. If you type a command in the shell opened, or pass arguments to it, it will be executed in a prepared environment. For example, you can list the nodes of the cluster using the original kubectl command by running:

    banzai cluster shell --cluster-name "<cluster-name>" -- kubectl get nodes
    

    Once the cluster is running, you can Deploy workload on it.

Create a single node PKE cluster on AWS 🔗︎

The command below creates a single-node PKE cluster on AWS (both the master and worker roles are assigned to the node pool).

banzai cluster create <<EOF
{
  "cloud": "amazon",
  "location": "us-east-2",
  "name": "pke-aws-cluster",
  "properties": {
    "pke": {
      "cri": {
        "runtime": "containerd"
      },
      "kubernetes": {
        "rbac": {
          "enabled": true
        },
        "version": "{{pke-version}}"
      },
      "nodePools": [
        {
          "autoscaling": false,
          "name": "master",
          "provider": "amazon",
          "providerConfig": {
            "autoScalingGroup": {
              "instanceType": "c5.large",
              "size": {
                "desired": 1,
                "max": 1,
                "min": 1
              },
              "spotPrice": "",
              "zones": [
                "us-east-2a"
              ]
            }
          },
          "roles": [
            "master",
            "worker"
          ]
        }
      ]
    }
  },
  "secretName": "my-aws-secret"
}
EOF

INFO[0011] cluster is being created
INFO[0011] you can check its status with the command `banzai cluster get "pke-aws-cluster"`
Id    Name
1     pke-aws-cluster

Check the status of the cluster 🔗︎

To check the status of the cluster, run the following command:

banzai cluster get "<cluster-name>"

Once the cluster is ready, you can try to run some simple commands. banzai cluster shell executes a shell within the context of the selected cluster. If you type a command in the shell opened, or pass arguments to it, it will be executed in a prepared environment. For example, you can list the nodes of the cluster using the original kubectl command by running:

banzai cluster shell --cluster-name "<cluster-name>" -- kubectl get nodes

Further reading 🔗︎

For further examples and the description of the fields in the cluster descriptor, see Create cluster descriptor reference for PKE on AWS.