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

Rke deploys k8s cluster

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

I. basic environment

Operating system: CentOS7.6

Kernel version: Linux 3.10.0-957.el7.x86_64

Kubernetes:v1.13.5

Docker version: 18.06.1-ce

II. Preparatory work

You need to prepare the following things

1 rke installation package

Https://github.com/rancher/rke/releases this link, find the version you want, this example is v0.2.1

2 cluster.yml Fil

Https://rancher.com/docs/rke/latest/en/example-yamls/ here is a sample of the cluster.yml file.

3 Host assigns IP role remarks 10.3.222.222rke deployment machine 10.3.222.223master110.3.222.224master210.3.222.225node310.3.222.226node110.3.222.227node210.3.222.224node34 closes selinux and firewalld of all hosts

# setenforce 0

# sed-I's bind SELINUXPRENTENFINGUGUG SELINUXPRONFORCING

# systemctl stop firewalld & & systemctl disable firewalld

III. Deployment process 1. Install docker

# yum install-y epel-release

# yum install-y yum-utils net-tools conntrack-tools wget

# yum-config-manager\

-- add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

# yum install-y docker-ce-18.06.1.ce

2 add users

# useradd-g docker docker

3 secret-free login

Add the public key of the 10.3.222.222 host root user to the authorized_keys file under the docker user of all nodes in K8s.

# echo "your key" > > / home/docker/.ssh/authorized_keys

4 rke operation

On 10.3.222.222 (rke deployment machine)

Download rke

# wget https://github.com/rancher/rke/releases/download/v0.2.1/rke_linux-amd64

# chmod 777 rke_linux-amd64

# mv rke_linux-amd64 rke

5 cluster.yml file nodes:-address: 10.3.222.223 user: docker role:-controlplane-etcd labels: ingress: 'true'-address: 10.3.222.224 user: docker role:-controlplane-etcd labels: ingress:' true'-address: 10.3.222.225 user: Docker role:-controlplane-etcd labels: ingress: 'true'-address: 10.3.222.226 user: docker role:-worker-address: 10.3.222.227 user: docker role:-worker-address: 10.3.222.228 user: docker role:-workeringress: provider: noneignore_docker_ Version: truecluster_name: k8s_testservices: kube-api: service_cluster_ip_range: 10.96.0.0 pod_security_policy 16 service_node_port_range: 30000-42767 pod_security_policy: false kubelet: cluster_domain: cluster.local cluster_dns_server: 10.96.0.10 fail_swap_on: false extra_args: max-pods: 250 Cgroup-driver: cgroupfs kube-controller: cluster_cidr: 10.244.0. 16 service_cluster_ip_range: 10.96.0.0/16authentication: strategy: x509authorization: mode: rbacnetwork: plugin: flanneladdons_include:-https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/v1.11/nvidia-device-plugin.yml

The cluster.yml file in this example provides an example that you can add or remove some parameters from the file according to your actual needs.

6 install the cluster

Put cluster.yml and downloaded rke in the same directory

#. / rke up

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