This section describes how to install Che on kind using chectl. Kind is a tool for running local Kubernetes clusters using Docker containers as nodes. It is useful for quickly creating ephemeral clusters, and is used as part of the test infrastructure of the Kubernetes project. Running Che in Kind is a great way to try it out, or for a contributor to test out their change quickly with a real cluster.

Prerequisites
Procedure
  1. Install csi-driver-host-path in the Kind cluster.

    $ git clone https://github.com/kubernetes-csi/csi-driver-host-path && cd csi-driver-host-path
    $ ./deploy/kubernetes-1.16/deploy-hostpath.sh
    $ kubectl apply -f examples/csi-storageclass.yaml
  2. Set csi-hostpath-sc as the default StorageClass.

    $ kubectl patch storageclass csi-hostpath-sc -p '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "true"}}}'
    $ kubectl patch storageclass standard -p '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "false"}}}'
  3. Install the NGINX Ingress Controller

    $ kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml
    $ kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/cloud-generic.yaml
  4. Install MetalLB.

    $ kubectl apply -f https://raw.githubusercontent.com/google/metallb/v0.8.3/manifests/metallb.yaml

    The above command may refer to an out-of-date version of MetalLB Kubernetes manifests. See the installation instructions for the most up-to-date command.

  5. Determine an IP range to allocate to MetalLB from the docker bridge network.

    $ docker inspect bridge | grep -C 5 Subnet
    "IPAM": {
                "Driver": "default",
                "Options": null,
                "Config": [
                    {
                        "Subnet": "172.17.0.0/16",
                        "Gateway": "172.17.0.1"
                    }
                ]
            },
            "Internal": false,

    In this case, we have a /16 subnet range to allocate, so we will choose a section in the 172.17.250.0 range.

  6. Create a ConfigMap for MetalLB specifying the IP range to expose.

    $ cat << EOF > metallb-config.yaml
    apiVersion: v1
    kind: ConfigMap
    metadata:
      namespace: metallb-system
      name: config
    data:
      config: |
        address-pools:
        - name: default
          protocol: layer2
          addresses:
          - 172.17.250.1-172.17.250.250
    EOF
    $ kubectl apply -f metallb-config.yaml
  7. The ingress-nginx service should now have an external IP.

    $ kubectl get svc -n ingress-nginx
    NAME            TYPE           CLUSTER-IP      EXTERNAL-IP    PORT(S)                      AGE
    ingress-nginx   LoadBalancer   10.107.194.26   172.17.255.1   80:32033/TCP,443:30428/TCP   19h
  8. Run chectl, using the external IP of the ingress-nginx Service, as an nip.io URL.

    $ chectl server:start --installer operator --platform k8s --domain 172.17.250.1.nip.io