K8S Install and Configuration - Amdingo/wiki GitHub Wiki

Installing Kubernetes on different linux distros

CentOS

  • install ntp service
    • yum install -y ntp
    • systemctl enable ntpd && systemctl start ntpd && systemctl status ntpd
  • add master and minion IPs to /etc/hosts for name resolution
  • iptables and firewalld modifications
  • install etcd, kubernetes and docker
    • add repository for latest k8s, docker
      • vim /etc/yum.repos/virt7-docker-common-release.repo
      • [virt7-docker-common-release]
        name=virt7-docker-common-release
        baseurl=http://cbs.centos.org/repos/virt7-docker-common-release/x86_64/os/
        gpgcheck=0
        
      • yum update
    • enable repo and install
      • yum install --enablerepo=virt7-docker-common-release etcd kubernetes docker
  • configure master controller
    • cd /etc/kubernetes && vim config
      • KUBE_MASTER="--master=http://<masterdns>:8080" # allow for dns resolution instead of IP
      • KUBE_ETCD_SERVERS="--etcd-servers=http://<masterdns>:2379" # allow for dns resolution instead of IP
    • cd /etc/etcd && vim etcd.conf
      • ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379" # allow for listen on all interfaces
      • ETCD_ADVERTISE_CLIENT_URLS="http://0.0.0.0:2379" # allow for listen on all interfaces
    • cd /etc/kubernetes && vim apiserver
      • KUBE_API_ADDRESS="--address=0.0.0.0" # all interfaces
      • uncomment KUBE_API_PORT
      • uncomment KUBELET_PORT
      • comment or modify KUBE_ADMISSION_CONTROL as needed
    • start services
      • systemctl enable etcd kube-apiserver kube-controller-manager kube-scheduler
      • system ctl start ...
  • configure minions
    • cd /etc/kubernetes && vim config
      • KUBE_MASTER="--master=http://<dnsmastername>:8080"
      • KUBE_ETCD_SERVERS="--etcd-servers=http://<dnsmastername>:2379"
    • cd /etc/kubernetes && vim kubelet
      • `KUBELET_ADDRESS="--address=0.0.0.0"
      • uncomment KUBELET_PORT and modify port if needed
      • `KUBELET_HOSTNAME="--hostname-override="
      • `KUBELET_API_SERVER="--api-servers=http://:8080"
      • comment or modify KUBELET_POD_INFRA_CONTAINER unless using rhel containers
    • start services
      • systemctl enable kubeproxy kubelet docker
      • systemctl start ....
⚠️ **GitHub.com Fallback** ⚠️