CentOS7 Installing Kubernetes V1.0 version

Source: Internet
Author: User
Tags etcd

The component versions are as follows:

1.kubernetes-1.0
2.docker-1.8.0
3.flannel-0.5.3
4.etcd-2.1.1

Kubernetes Environment Deployment:

1.master:172.16.198.129
2.slave:172.16.198.128

Two virtual machines ready to work:

1. Disable FIREWALLD for each machine:

Systemctl Stop Firewalld
Systemctl Disable FIREWALLD

2. Disable SELinux:

Vi/etc/selinux/config
#SELINUX =enforcing
Selinux=disabled
#也可用命令
Sed-i '/selinux/s/enforcing/disabled/'/etc/selinux/config

Master machine Installation and configuration

Yum-y Install ETCD kubernetes
Vi/etc/etcd/etcd.conf
Etcd_name=default
Etcd_data_dir= "/var/lib/etcd/default.etcd"
Etcd_listen_client_urls= "http://0.0.0.0:2379"
Etcd_advertise_client_urls= "
Vi/etc/kubernetes/apiserver
Kube_api_address= "--address=0.0.0.0"
Kube_etcd_servers= "--etcd_servers=http://172.16.198.129:2379"
Kube_service_addresses= "--SERVICE-CLUSTER-IP-RANGE=10.254.0.0/16"
Kube_admission_control= "--admission_control=namespacelifecycle,namespaceexists,limitranger,securitycontextdeny , Serviceaccount,resourcequota "
Kube_api_args= ""
Vi/etc/kubernetes/controller-manager
kube_controller_manager_args= "--node-monitor-grace-period=10s--pod-eviction-timeout=10s"
Vi/etc/kubernetes/config
Kube_logtostderr= "--logtostderr=true"
Kube_log_level= "--v=0"
kube_allow_priv= "--allow_privileged=false"
Kube_master= "--master=http://172.16.198.129:8080"
Start the service:
For SERVICES in Etcd kube-apiserver Kube-controller-manager Kube-scheduler; Do
Systemctl Restart $SERVICES
Systemctl Enable $SERVICES
Systemctl Status $SERVICES
Done
Define flannel network configuration to ETCD, this configuration will be pushed to the flannel service of each slave
Etcdctl mk/coreos.com/network/config ' {"Network": "172.17.0.0/16"} '

Slave: Installation and configuration of the machine

Installing Docker and updating reboots
Yum-y Install Docker
Yum-y Update
Reboot
Yum-y Install Kubernetes-node Flannel
Vi/etc/kubernetes/config
Kube_logtostderr= "--logtostderr=true"
Kube_log_level= "--v=0"
kube_allow_priv= "--allow_privileged=false"
Kube_master= "--master=http://172.16.198.129:8080"
Vi/etc/kubernetes/kubelet
Kubelet_address= "--address=127.0.0.1"
Kubelet_hostname= "--hostname_override=172.16.198.128"
Kubelet_api_server= "--api_servers=http://172.16.198.129:8080"
Kubelet_args= "--pod-infra-container-image=kubernetes/pause"
Vi/etc/sysconfig/flanneld
Flannel_etcd= "http://172.16.198.129:2379"
flannel_etcd_key= "/coreos.com/network"
Start the service:
For SERVICES in Kube-proxy Kubelet Docker Flanneld; Do
Systemctl Restart $SERVICES
Systemctl Enable $SERVICES
Systemctl Status $SERVICES
Done

Login Master to confirm the status of Minions:

[[email protected] ~]# Kubectl get nodes
NAME LABELS STATUS
172.16.198.128 kubernetes.io/hostname=172.16.198.128 Ready

Note : If you need more than one slave node, you only need to repeat the operation on the Slava machine above .

CentOS7 Installing Kubernetes V1.0 version

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.