Installation of the Kubernetes+docker cloud Platform on the CentOS7 system

Source: Internet
Author: User
Tags etcd

Kubernetes+docker the cloud platform in CentOS7 installation on the system 1. Run VIRTUALBOX5. 2. Install the CENTOS7 system.

Note: Select the basic server type

The installation process is slightly. 3. Modify the computer IP and computer name.

1) Nmtui

1.

Modify Host Name:

NMCLI General hostname slave1.smartmap.com

2.

Modify Network Connections

NMCLI Connection Edit ENP0S3

Nmcli> Goto IPv4

Nmcli ipv4> Set Method manual

NMCLI ipv4> Set Addresses 192.168.1.203/16

NMCLI ipv4> Set Gateway 192.168.0.6

NMCLI ipv4> Set Dns-search smartmap.com

NMCLI ipv4> Set DNS 192.168.0.3 192.168.0.12

Nmcli ipv4> Back

Nmcli> Save

Nmcli> Goto Connection

NMCLI ipv4> Set AutoConnect True

Nmcli ipv4> Back

Nmcli> Save

Nmcli> Goto IPv4

Nmcli> Q

3. Restart the NIC

Systemctl restart Network.service4. Turn off SELinux.

1)

Vi/etc/sysconfig/selinux

Modify Selinux=enforcing to Selinux=disabled

2)

Reboot5. Close firewall.

Systemctl Stop Firewalld.service

Systemctl Disable Firewalld.service

Reboot

Install on Master Host 6. Add OpenStack's Yum library.

Install on Master Host

Yum Install kubernetes Etcd Flannel

Slave on-Machine installation

Yum install Kubernetes Flannel7. Start the Docker service and download the image.

Systemctl Start Docker.service

Systemctl Enable Docker.service

Docker Pull CentOS

Docker Pull Index.tenxcloud.com

Docker pull index.tenxcloud.com/centos:latest8. Configure Kubernetes.

1) Generate RSA Certificate

OpenSSL Genrsa-out/etc/kubernetes/service.key 2048

2) Set the controller's certificate

Vi/etc/kubernetes/controller-manager

Kube_controller_manager_args= "--service_account_private_key_file=/etc/kubernetes/service.key"

3) Set the configuration of the Apiserver

Vi/etc/kubernetes/apiserver

Kube_api_address= "--address=0.0.0.0"

Kube_etcd_servers= "--etcd_servers=http://192.168.1.201:2379"

Kube_service_addresses= "--SERVICE-CLUSTER-IP-RANGE=10.254.0.0/16"

Kube_api_args= "--service_account_key_file=/etc/kubernetes/service.key"

4) Set the configuration of Master (Management node)

Vi/etc/kubernetes/config

Kube_master= "--master=http://192.168.1.201:8080" 9. Configure ETCD.

Vi/etc/etcd/etcd.conf

Etcd_listen_peer_urls= "http://192.168.1.201:2380,http://localhost:2380"

etcd_listen_client_urls= "http://192.168.1.201:2379,http://localhost:2379" 10. Start the Kubernetes service.

Systemctl start Etcd kube-apiserver kube-controller-manager Kube-scheduler

Systemctl enable ETCD Kube-apiserver Kube-controller-manager Kube-scheduler

11. Configure Flannel.

1) Create configuration information

VI Flannel-config.json

{

"Network": "172.16.0.0/16",

"Subnetlen": 24,

"Backend": {

"Type": "Vxlan",

"VNI": 1

}

}

2) configuration file

Vi/etc/sysconfig/flanneld

Flannel_etcd= "http://192.168.1.201:2379"

3) Write flannel configuration information to the ETCD service

Etcdctl set Atomic.io/network/config < Flannel-config.json12. Start the Flanneld service.

Systemctl Start Flanneld

Systemctl Enable Flanneld

Installation of the Kubernetes+docker cloud Platform on the CentOS7 system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.