Can't install Kubernetes on Vagrant

Use this guide to install Kubernetes on Vagrant cluster:

  • Centralized team development environment with docker
  • Centralized logging for simple docker applications
  • When pushing an image in GitLab registry using jenkins, the error fails: Invalid repository name
  • Test docker containers using travis-ci
  • Capture the output of a program run in Docker
  • How to forward a docker container port to the host
  • At (2/4) Initializing your master, there came some errors:

    [root@localhost ~]# kubeadm init
    [kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.
    [init] Using Kubernetes version: v1.6.4
    [init] Using Authorization mode: RBAC
    [preflight] Running pre-flight checks
    [preflight] Some fatal errors occurred:
        /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1
    [preflight] If you know what you are doing, you can skip pre-flight checks with `--skip-preflight-checks`

    I checked the /proc/sys/net/bridge/bridge-nf-call-iptables file content, there is only one 0 in it.

    At (3/4) Installing a pod network, I downloaded kube-flannel file:

    And run kubectl apply -f kube-flannel.yml, got error:

    [root@localhost ~]# kubectl apply -f kube-flannel.yml
    The connection to the server localhost:8080 was refused - did you specify the right host or port?

    Until here, I don’t know how to goon.

    My Vagrantfile:

      # Master Server
      config.vm.define "master", primary: true do |master| :private_network, ip: "" :forwarded_port, guest: 22, host: 1234, id: 'ssh'

  • Docker: google/docker-registry container usage
  • Executing a shell script within docker with RUN command
  • Run test cases for a tool across a fleet of windows hosts
  • MySQL in Docker frozen at root password config
  • Pacman: How to choose default choice when it asks to replace a package?
  • How to make Docker work on Debian Stretch
  • One Solution collect form web for “Can't install Kubernetes on Vagrant”

    In order to set /proc/sys/net/bridge/bridge-nf-call-iptables by editing /etc/sysctl.conf. There you can add [1]

    net.bridge.bridge-nf-call-iptables = 1

    Then execute

    sudo sysctl -p

    And the changes will be applied. With this the pre-flight check should pass.


    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.