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

How to install RKE

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

Share

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

This article mainly introduces how to install RKE, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to know about it.

RKE is a Kubernetes installer written in Golang that is extremely easy to use and users no longer need to do a lot of preparation to have a lightning fast Kubernetes installation and deployment experience.

How to install RKE

You can install RKE from the official GitHub repository. RKE can be run on Linux and MacOS machines. After the installation is complete, run the following code to ensure that you are using the latest version:

Preparation for RKE installation

RKE is a container-based installer, which means it needs to install Docker on a remote server, and currently Docker version 1.12 needs to be installed on the server.

RKE works by connecting to each server through SSH and establishing a tunnel to Docker socket on this server, which means that SSH users must be able to access the Docker engine on this server. To enable access to the SSH user, you can add this user to the Docker group:

Usermod-aG docker

This is the only preparation required by the remote server to start the installation of Kubernetes.

Getting started with RKE

The following example assumes that the user has configured three servers:

Node-1: 192.168.1.5node-2: 192.168.1.6node-3: 192.168.1.7 Cluster profile

By default, RKE looks for a file named cluster.yml that contains information about the remote servers and services that will run on the server.

The minimum file should look like this:

The cluster profile contains a list of nodes. Each node should contain at least the following values:

Address-SSH IP / FQDN of the server

User-SSH user connected to the server

Role-Host role list: worker,controlplane or etcd

The other section is "Services," which contains information about the Kubernetes components that will be deployed on the remote server.

There are three types of roles that can use hosts:

Etcd-these hosts can be used to hold cluster data.

Controlplane-these hosts can be used to hold the Kubernetes API server and other components needed to run K8s.

Worker-these are hosts that your application can deploy.

Run RKE

To run RKE, first make sure that the cluster.yml file is in the same directory, and then run the following command:

➜. / rke up

To point to another configuration file, run the following command:

➜. / rke up-- config / tmp/config.yml

The output will look like this:

Connect to the cluster

RKE deploys a local file in the same directory as the configuration file that contains kube configuration information to connect to the newly generated cluster. By default, the kube configuration file is called .kube _ config_cluster.yml. Copy this file to your local ~ / .kube / config, and you can use kubectl locally.

It is important to note that the local kube configuration name of the deployment is related to the cluster profile. For example, if you use a configuration file named mycluster.yml, the local kube configuration will be named .kube _ config_mycluster.yml.

A Peek Under the Hood

By default, RKE uses the x509 authentication method to set authentication between the Kubernetes component and the user. RKE first generates certificates for each component and user component.

After generating the certificate, RKE deploys the generated certificate to the / etc/kubernetes/ssl server and saves the local kube configuration file, which contains the primary user certificate, which can be used with RKE when you want to delete or upgrade the cluster.

RKE then deploys each service component as a container that can communicate with each other. RKE also saves the cluster state in Kubernetes as a configuration map for later use.

RKE is an idempotent tool that can be run multiple times and produce the same output each time. The following network plug-ins can be deployed:

Calico

Flannel (default)

Canal

To use different network plug-ins, you can specify in the configuration file:

Network: plugin: calico plug-in

RKE supports the use of pluggable plug-ins in the cluster bootstrapper. You can specify the YAML of the plug-in in the cluster.yml file.

RKE deploys the plug-in's YAML after the cluster starts. RKE first uploads the YAML file to the Kubernetes cluster as a configuration map, and then runs a Kubernetes job to mount the configuration map and deploy the plug-ins.

Please note that RKE does not support deleting plug-ins at this time. Once the plug-ins are deployed, you cannot use RKE to change them.

To start using the plug-in, use the addons: option in the cluster configuration file, for example:

Please note that we use |-

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