Deploy and Manage Rancher Management Cluster with Workload Cluster in BMC


In the world of containerization and microservices, it has become increasingly important to manage and orchestrate container workloads across a large infrastructure. Rancher is an open-source container management platform that makes it easy to deploy and manage container workloads across multiple clusters and clouds. In this blog post, I will guide you through the process of deploying and managing a Rancher management cluster with a workload cluster in BMC.

Prerequisites

Before we begin, there are a few prerequisites you need to meet −

  • A BMC account with access to the BMC cloud infrastructure.

  • Familiarity with Kubernetes and containerization concepts.

  • Basic knowledge of Linux and command-line interface.

Deploying the Management Cluster

To deploy the Rancher management cluster, we need to create an environment in BMC. An environment is a logical grouping of resources within the BMC cloud infrastructure. Follow the steps below to create an environment −

  • Log in to the BMC console.

  • Click on the "Environments" tab.

  • Click on the "Create Environment" button.

  • Enter a name for your environment and select the region where you want to deploy your management cluster.

  • Click on the "Create Environment" button to create your environment.

Once you have created your environment, you can proceed with deploying the Rancher management cluster. Follow the steps below to deploy the cluster −

  • Log in to the BMC console.

  • Click on the "Environments" tab.

  • Click on the name of the environment where you want to deploy the cluster.

  • Click on the "Add Resource" button.

  • Select "Kubernetes Cluster" from the list of resources.

  • Enter a name for your cluster and select the Kubernetes version you want to use.

  • Choose the number of worker nodes you want to deploy.

  • Click on the "Create" button to deploy your cluster.

Once the Rancher management cluster is deployed, you can access the Kubernetes API server using the kubeconfig file. You can download the kubeconfig file by following the steps below −

  • Log in to the BMC console.

  • Click on the "Environments" tab.

  • Click on the name of the environment where you deployed the cluster.

  • Click on the "Resources" tab.

  • Click on the name of the Rancher management cluster.

  • Click on the "Download Kubeconfig" button.

  • Save the kubeconfig file to your local machine.

Deploying the Workload Cluster

Now that we have deployed the Rancher management cluster, we can proceed with deploying a workload cluster. A workload cluster is a Kubernetes cluster that is managed by the Rancher management cluster. Follow the steps below to deploy a workload cluster −

  • Log in to the Rancher management UI using the URL provided in the kubeconfig file.

  • Click on the "Global" tab.

  • Click on the "Add Cluster" button.

  • Select "From Existing Nodes" from the list of options.

  • Enter a name for your workload cluster and select the Kubernetes version you want to use.

  • Copy the command provided on the next page and run it on each node of your workload cluster to join them to the Rancher management cluster.

  • Click on the "Create" button to deploy your workload cluster.

Once the workload cluster is deployed, you can access the Kubernetes API server using the kubeconfig file provided by Rancher.

Managing the Clusters

Now that we have deployed both the Rancher management cluster and the workload cluster, we can start managing them. Rancher provides a user-friendly UI for managing Kubernetes clusters. Follow the steps below to access the Rancher UI −

  • Log in to the Rancher management cluster by navigating to https://<RANCHER_SERVER_IP>:8443 in your web browser. You should see the Rancher login page.

  • Enter the admin username and password that you set up during the installation process.

Once you are logged in, you will see the Rancher UI dashboard, which provides an overview of all the clusters managed by Rancher. To access the workload cluster that we just deployed, click on the cluster name under the "Clusters" section on the dashboard.

Adding Nodes to the Workload Cluster

By default, the workload cluster that we deployed only has a single node. If you want to add more nodes to the cluster to increase its capacity or resilience, you can do so using Rancher.

To add a node to the workload cluster, follow the steps below −

  • Navigate to the workload cluster in the Rancher UI by clicking on the cluster name under the "Clusters" section on the dashboard.

  • Click on the "Nodes" tab in the left sidebar.

  • Click the "Add Node" button in the top right corner of the screen.

  • Choose the method that you want to use to add the node. You can either run the rke command on the new node, or you can download a Kubernetes YAML file and run it on the new node.

  • Follow the instructions provided by Rancher to add the new node to the cluster.

Once the new node has been added to the cluster, it will automatically be configured with the necessary Kubernetes components and will begin running workloads.

Managing Workloads

Now that we have a functioning workload cluster, we can start deploying and managing workloads on it. Rancher provides a user-friendly UI for managing workloads, making it easy to deploy and scale applications.

To deploy a workload to the cluster, follow the steps below −

  • Navigate to the workload cluster in the Rancher UI by clicking on the cluster name under the "Clusters" section on the dashboard.

  • Click on the "Workloads" tab in the left sidebar.

  • Click the "Add Workload" button in the top right corner of the screen.

  • Choose the type of workload that you want to deploy. Rancher supports a wide range of workloads, including Deployments, StatefulSets, DaemonSets, and Jobs.

  • Follow the instructions provided by Rancher to configure the workload. You will need to specify the container image to use, the number of replicas to create, and any other required configuration options.

Once the workload has been deployed, you can use the Rancher UI to monitor its performance, scale it up or down, and perform other management tasks.

Advanced Configuration

Rancher provides a wide range of advanced configuration options that can be used to fine-tune the behavior of your clusters and workloads. Some of the most commonly used configuration options are described below −

Cluster Configuration

  • etcd Configuration − Rancher uses etcd as the distributed data store for Kubernetes. You can configure etcd to use external storage or adjust its performance settings to improve cluster performance.

  • Networking Configuration − Rancher supports a variety of networking options, including Calico, Flannel, and Canal. You can configure the networking options for your clusters to suit your specific requirements.

  • Authentication Configuration − Rancher supports a variety of authentication options, including LDAP and Active Directory. You can configure authentication to integrate with your existing identity management systems.

Workload Configuration

  • Resource Limits and Requests − You can specify resource limits and requests for your workloads to ensure that they have access to the necessary CPU and memory resources.

  • Auto-scaling − Rancher supports automatic scaling of workloads based on CPU or memory usage. You can configure auto-scaling to ensure that your workloads can handle fluctuations in traffic and usage.

  • Load balancing − Rancher provides built-in support for load balancing using various technologies such as Kubernetes Ingress and Rancher Load Balancer.

  • Monitoring − You can monitor your workloads using built-in monitoring tools in Rancher, or you can integrate with third-party monitoring tools such as Prometheus.

  • Logging − Rancher also provides built-in logging capabilities, allowing you to view logs for your workloads directly from the Rancher UI.

Advanced Workload Configuration

Rancher also provides advanced configuration options for workloads, allowing you to fine-tune various settings for optimal performance and scalability. Some of the advanced configuration options include −

  • Persistent Volumes − Rancher supports persistent volumes, allowing you to store data outside of the container and preserve it even if the container is terminated or rescheduled.

  • ConfigMaps − ConfigMaps allow you to decouple configuration data from your container images, making it easier to manage and update configurations.

  • Secrets − Rancher supports Secrets, allowing you to store sensitive information such as passwords and API keys securely.

  • StatefulSets − StatefulSets allow you to manage stateful applications such as databases and queues in a scalable and fault-tolerant manner.

Conclusion

In this article, we have covered the deployment and management of Rancher management cluster and workload cluster in BMC. Rancher provides a user-friendly interface for managing Kubernetes clusters, making it easy to deploy and manage workloads. Additionally, Rancher provides advanced configuration options for workloads, allowing you to fine-tune various settings for optimal performance and scalability.

By following the steps outlined in this blog post, you can easily deploy and manage Kubernetes workloads using Rancher in BMC. With its built-in support for load balancing, monitoring, and logging, Rancher provides a comprehensive solution for deploying and managing containerized applications.

Updated on: 26-Jun-2023

78 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements