Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Download kubectl

kubectl is a command-line tool for managing everything about your Kubernetes cluster.

The following set of commands can be used to install kubectl on your machine. You may need to change the version number below:

export K8S_VERSION=1.2.0
mkdir ~/bin
curl -L "https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl" > .
export PATH=$PATH:`pwd`
chmod +x ~/bin/*

Single-Node (Local Development) Cluster

...

Code Block
languagebash
#!/bin/sh
docker run \
    --volume=/:/rootfs:ro \
    --volume=/sys:/sys:ro \
    --volume=/var/lib/docker/:/var/lib/docker:rw \
    --volume=/var/lib/kubelet/:/var/lib/kubelet:rw \
    --volume=/var/run:/var/run:rw \
    --volume=`pwd`/manifests/etcd.json:/etc/kubernetes/manifests/etcd.json \
    --net=host \
    --pid=host \
    --privileged=true \
    -d \
    gcr.io/google_containers/hyperkube-amd64:v{K8S_VERSION} \
    /hyperkube kubelet \
        --containerized \
        --hostname-override="127.0.0.1" \
        --address="0.0.0.0" \
        --api-servers=http://localhost:8080 \
        --config=/etc/kubernetes/manifests \
        --allow-privileged=true --v=2
mkdir -p ~/bin
if [ ! -e ~/bin/kubectl ]; then
	curl http    curl -L https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl -o ~/bin/kubectl
	chmod +x ~/bin/kubectl
fi

...