Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

15 minutes! Deploy Rancher management Kubernetes on Azure

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Brief introduction to the author: Steve BuchananSteve Buchanan,Avanade Cloud Transformation and DevOps team Leader. Nearly 20 years of experience in IT and has published a number of technical books on cloud and data center management. Steve has been Microsoft's MVP for seven consecutive years since 2012, and won Microsoft's "25 ITSM Experts to Watch in 2017" and "IT Unity Community Champ" in 2017.

Rancher is an open source Kubernetes multi-cluster operation and workload management solution. In short, you can use Rancher to deploy and manage Kubernetes clusters on public clouds (such as Azure, AWS, GCP, etc.). They can be public cloud-hosted Kubernetes such as GCE, EKS, AKS, or user-created clusters. Rancher also integrates many third-party authentication solutions, such as Active Directory, Azure Active Directory, Github, and logging solutions such as Splunk, Elasticsearch, or Syslog endpoints.

About running Rancher on a laptop or AWS through Terraform, I found a lot of ready-made instructions and setup scripts for users to use directly, but found that there was little about Azure + Rancher.

After trying it myself, I successfully got my Rancher environment running on Azure. But I think it would be nice to have some scripts or templates ready for you to start Rancher on Azure more quickly. I found some ARM templates contributed by others to drive Rancher, but they deployed the old version of Rancher and it was not clear how to update it in the template to deploy the latest version of Rancher. So I decided to build some ARM templates that could be used to quickly deploy Rancher on Azure and add a Kubernetes host to Rancher. In the ARM template I built, it will always pull the Rancher container from Docker Hub, so it can always keep the latest version of Rancher deployed. In this article, I will explain in detail how to get your Rancher up and running in 15 minutes.

First, you can find the ARM template on my Github:

Https://github.com/Buchatech/DeployRanchertoAzure .

This mirror library contains the ARM template for deploying Rancher and the host VM for Kubernetes. Note: the templates I have provided can be used for you to learn and use, but I do not recommend them for production.

In repo, the ARM template # 1 named RancherNode.JSON will deploy a Ubuntu VM with Docker and the latest version of Rancher (https://hub.docker.com/r/rancher/rancher). The ARM template # 2 named RancherHost.JSON will deploy Ubuntu VM with Docker as the Kubernetes host in Rancher.

Node deployment

Deploy RancherNode.JSON 's ARM templates to Azure subscriptions through template deployment or other deployment methods. You will be prompted to enter the information shown in the following screenshot:

Host deployment

Deploy RancherHost.JSON ARM templates to Azure subscriptions through template deployment or other deployment methods. It should be noted that this operation should deploy the Rancher Host ARM template to the same resource group as the Rancher Node ARM template. You will be prompted to enter the information shown in the following screenshot:

After you deploy the Rancher Node and Rancher Host ARM templates, you can see the following resources in the new resource group:

Next, in the Web browser, open the Rancher portal. URL is the DNS name of Rancher Node VM. If you don't know what the DNS name is, you can click Rancher Node VM in the Azure portal on the overview page. The following is an example of URL:

Https://ranchernode.centralus.cloudapp.azure.com

The Rancher portal will prompt you to set the password, as shown in the following figure:

Once the password is set, the Rancher portal will prompt you for the correct Rancher Server URL. This will automatically become the Rancher Node VM DNS name. Then click Save URL.

After saving, you will log in to the Rancher portal and see the cluster page. Now you can add a new Kubernetes cluster to Rancher. In this article, I'll show you how to add a cluster to Rancher Host VM. When all this is done, Rancher will successfully deploy Kubernetes to Rancher Host VM. You can also add a managed Kubernetes, such as AKS, but we won't demonstrate this for the time being in this article.

Click add Cluster

Under from my own existing nodes, click customize, name the cluster, and then click next.

Next, check all the options for the node option, because all roles will be on a single Kubernetes cluster. Copy the code shown at the bottom of the page, click finish, and run the code on the Rancher host.

To run the code on the Rancher host, you need SSH and run it from there. Follow these steps:

In the Azure portal, click Rancher Host VM in the resource group.

On the Overview page, click Connect.

A "Connect to virtual machine" screen will pop up later and copy the "ssh ranchuser@rancherhost.centralus.cloudapp.azure.com" on the screen.

Through the VS code, open the terminal of the Azure cloud shell or similar terminal, and then enter the "ssh ranchuser@rancherhost.centralus.cloudapp.azure.com" you just copied.

The running code will look like this:

When you are finished, run Docker PS to see if the Rancher agent container is running:

In the Rancher portal under the cluster, you can see that the Rancher host is being configured:

When the Kubernetes deployment is complete, the state changes:

After the configuration is complete, the Kubernetes cluster will be in an "active" state:

Now we can see a lot of information about this new Kubernetes cluster. We can even start Kubectl from here and start running commands! You can spend some time clicking around to see what you are familiar with when using Kubernetes. It can be said that Rancher has really greatly simplified the management experience of Kubernetes, Cool!

If you want to add more nodes or need to configure the code again, simply click the ellipsis button in my box below and edit it:

In Edit Cluster, you can change the cluster name, get and change settings, and copy the code to add more VM to the cluster:

This is the end of this article. Welcome to learn more about Azure, Kubernetes and Rancher in the author's blog:

Http://www.buchatech.com

About Rancher Labs

Founded by Silicon Valley cloud computing leader Liang Sheng, the father of CloudStack, Rancher Labs is committed to creating innovative open source software to help enterprises run containers and Kubernetes in a production environment. The flagship product Rancher is an open source enterprise Kubernetes platform that is the first and only platform in the industry that can manage all clouds, all distributions, and all Kubernetes clusters. It solves the difficulties of different infrastructure that enterprise users may face in the production environment, and improves the poor ease of use of Kubernetes native UI and the steep learning curve, which is the best choice for enterprises to land Kubernetes.

Rancher has more than 100 million downloads worldwide and more than 20000 corporate customers. Global famous companies such as China Life Insurance, Huawei, Ping an of China, Minsheng Bank, Industrial Bank, SAIC, Haier, Michelin, Trina, Toyota, Honda, Honeywell, Jinfeng, PricewaterhouseCoopers, Hainan Airlines, Xiamen Airlines, Evergrande, China Pacific, BNP Paribas, Bank of America, HSCIS Hang Seng Index, China Water Conservancy, Blizzard, CCTV and so on are all paying customers of Rancher.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report