Overview 🔗︎

As an example, this guide shows you how to deploy the WordPress application on a Kubernetes cluster using the Banzai CLI tool.

Prerequisites 🔗︎

To complete this procedure, you must already have:

Deploying WordPress 🔗︎

  1. (Optional) If you have multiple clusters, list your clusters to select the cluster where you’d like to deploy the WordPress application:

    banzai cluster list
  2. Start an interactive shell to the your cluster. You can use the banzai CLI to open a new shell session with the kubeconfig environment of your selected cluster:

    banzai cluster shell

    Select the cluster to connect from the terminal. Alternatively, you can use the banzai cluster --cluster=cluster-name shell command to select the cluster.

  3. The shell command opens a session to the cluster using your default shell. The Banzai CLI automatically installs the kubectl and helm commands on your cluster and adds them to the path. It also synchronizes the repository list with Pipeline so you can manage the same packages from the command line and the web interface.

    Helm is the de-facto package manager for Kubernetes, which helps you manage Kubernetes applications. You can install, upgrade, list, or delete applications. Read our blog for more information about Helm post.

  4. Update the Helm repository:

    helm repo update
  5. Install the WordPress chart using the helm client. The command you have to use differs depending on the type of cluster you are running Banzai Cloud Pipeline platform on. For example:

    Expected output: The login credentials for the installed WordPress instance are displayed, for example:

    Login with the following credentials to see your blog
    echo Username: banzai
    echo Password: $(kubectl get secret --namespace default my-wordpress -o jsonpath="{.data.wordpress-password}" | base64 --decode)

    To distinguish releases from each other, Helm attaches a release name to every deployment. You can specify the name of the release with the --name option, or let Helm generate one. Helm Charts are identified by [repository name]/[chart-name]:[version].

  6. List the deployments on the cluster and check their status:

    helm list
  7. (Optional) If you want to access the deployed application, open the WordPress service in a browser window by running the following command (as displayed in the Helm output).

    • If you have installed Banzai Cloud Pipeline to AWS:

      open http://$(kubectl get svc  my-wordpress -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')

      The WordPress page automatically opens in your default browser.

    • If you have installed Banzai Cloud Pipeline locally:

      kubectl port-forward --namespace default svc/my-wordpress 8080:80

      Open the following address in your browser:

  8. Finally if you don’t need the deployment anymore, simply delete it.

    helm uninstall my-wordpress

Next steps 🔗︎

Once you have deployed workload, try out the cluster features of Banzai Cloud Pipeline, or dive into the details of deployments.