Working Offline

    You can first prepare the necessary environment according to the .

    KIND provides some pre-built images, these images contain everything necessary to create a cluster and can be used in an offline environment.

    You can find available image tags on the releases page. Please include the from the image in the release notes.

    You can pull it when you have network access, or pull it on another machine and then transfer it to the target machine.

    1. ~ docker save -o kind.v1.17.0.tar kindest/node:v1.17.0@sha256:9512edae126da271b66b990b6fff768fbb7cd786c7d39e86bdf55906352fdf62
    2. # or
    3. ~ docker save kindest/node:v1.17.0@sha256:9512edae126da271b66b990b6fff768fbb7cd786c7d39e86bdf55906352fdf62 | gzip > kind.v1.17.0.tar.gz

    When you transport image tarball to the machine, you can load the node image by docker load command.

    1. ~ docker load -i kind.v1.17.0.tar
    2. Loaded image ID: sha256:ec6ab22d89efc045f4da4fc862f6a13c64c0670fa7656fbecdec5307380f9cb0
    3. # or
    4. ~ docker load -i kind.v1.17.0.tar.gz
    5. Loaded image ID: sha256:ec6ab22d89efc045f4da4fc862f6a13c64c0670fa7656fbecdec5307380f9cb0

    And for it.

    Finally, you can create a cluster by specifying the --image flag.

    1. ~ kind create cluster --image kindest/node:v1.17.0
    2. Creating cluster "kind" ...
    3. Ensuring node image (kindest/node:v1.17.0) 🖼
    4. Preparing nodes 📦
    5. Starting control-plane 🕹️
    6. Installing StorageClass 💾
    7. Set kubectl context to "kind-kind"
    8. You can now use your cluster with:
    9. kubectl cluster-info --context kind-kind
    10. Have a question, bug, or feature request? Let us know! https://kind.sigs.k8s.io/#community 🙂

    In addition to using pre-built node image, KIND also provides the ability to build node image from Kubernetes source code.

    The node-image in turn is built off the , See building the base image for more advanced information.

    You can clone Kubernetes source code.

    1. ~ mkdir -p $GOPATH/src/k8s.io
    2. ~ cd $GOPATH/src/k8s.io
    3. ~ git clone https://github.com/kubernetes/kubernetes

    Building image

    When the image build is complete, you can create a cluster by passing the --image flag.

    1. ~ kind create cluster --image kindest/node:master
    2. Creating cluster "kind" ...
    3. Ensuring node image (kindest/node:master) 🖼
    4. Preparing nodes 📦
    5. Writing configuration 📜
    6. Installing CNI 🔌
    7. Installing StorageClass 💾
    8. Set kubectl context to "kind-kind"
    9. You can now use your cluster with:
    10. kubectl cluster-info --context kind-kind
    11. Have a question, bug, or feature request? Let us know! https://kind.sigs.k8s.io/#community 🙂

    If you want to create a control-plane HA cluster then you need to create a config file and use this file to start the cluster.

    1. ~ cat << EOF | kind create cluster --config=-
    2. kind: Cluster
    3. apiVersion: kind.x-k8s.io/v1alpha4
    4. # 3 control plane node and 1 workers
    5. nodes:
    6. - role: control-plane
    7. - role: control-plane
    8. - role: control-plane

    You can find the specific tag currently in use at .