# Quickstart

"  control  https://127.0.0.1:6443  (0.2175.0)\n  node     node-1\n  kubectl  export KUBECONFIG=/Users/you/.kite/local/kubeconfig";

  "NAME     STATUS   ROLES    AGE   VERSION\nnode-1   Ready    <none>   11s   v1.37.0+kite";

  "kubectl create deployment web --image=nginx:1.27-alpine --replicas=2\nkubectl expose deployment web --port=80\nkubectl rollout status deployment/web\nkubectl get pods -o wide";

  "NAME              READY   STATUS    RESTARTS   AGE   IP          NODE\nweb-0e9okk4-1g0   1/1     Running   0          7s    10.64.0.2   node-1\nweb-0e9okk4-1g1   1/1     Running   0          7s    10.64.0.3   node-1";

## Before you begin

The control plane and one node each run in a Docker container on your machine.

<div class="tscroll">
  <table class="tbl">
    <thead>
      <tr>
        <th style="width:22%">Requirement</th>
        <th style="width:22%">Value</th>
        <th>Note</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="p">Machine</td>
        <td class="mono">Mac or Linux</td>
        <td class="c">amd64 or arm64</td>
      </tr>
      <tr>
        <td class="p">
          <a href="https://docs.docker.com/get-started/get-docker/">Docker</a>
        </td>
        <td class="mono">running</td>
        <td class="c">On macOS, use Docker Desktop.</td>
      </tr>
      <tr>
        <td class="p">
          <a href="https://kubernetes.io/docs/tasks/tools/">kubectl</a>
        </td>
        <td class="mono">1.36 to 1.38</td>
        <td class="c">Kite serves Kubernetes 1.37.</td>
      </tr>
      <tr>
        <td class="p">Cloudflare account</td>
        <td class="mono">not needed</td>
        <td class="c">The control plane runs in a container too.</td>
      </tr>
    </tbody>
  </table>
</div>

## Install the CLI

<Step n={1} title="Run the installer" cmd="curl -fsSL https://get.runkite.io | sh">

The installer puts `kite` in `~/.local/bin`. If it tells you to, add that
directory to your `PATH`.

</Step>

## Start a cluster

<Step n={2} title="Start the cluster" cmd="kite local up" out={up}>

The first run downloads the release and its two images, which takes a minute
or two. Later runs start in seconds. `kite local up` prints these lines when
the node is ready.

</Step>

<Step n={3} title="Point kubectl at it" cmd={nodesCmd} out={nodesOut}>

Use the `export` line that `kite local up` printed. The node agent reports the
node `Ready`.

</Step>

:::tip
`kite local up --update-kubeconfig` also adds the `kite-local` context to your default
kubeconfig and makes it current. `kite local up --nodes 3` starts three nodes.
:::

## Deploy nginx

<Step n={4} title="Create a Deployment and a Service" cmd={deployCmd} out={deployOut}>

The first rollout waits while the node downloads the image. Each pod gets an
address from the node's range.

<div class="changed">
  <b>What changed</b>+ deployment/web, 2 pods
  <br />+ service/web, port 80
</div>

</Step>

## Open nginx

<Step n={5} title="Forward a local port to the Service" cmd="kubectl port-forward service/web 8081:80">

Open [`http://localhost:8081`](http://localhost:8081) to see the nginx welcome
page. Press `Ctrl+C` to stop forwarding. The guide uses 8081 because 8080 is
the address that `kubectl` tries when it has no kubeconfig, so a `kubectl` run
in another shell would reach nginx instead of an error.

</Step>

## Clean up

<Step n={6} title="Delete what you deployed, then stop the cluster" cmd={cleanCmd}>

`kite local down` stops the control plane and the node, and keeps the objects
you created, so the next `kite local up` starts with them.

<div class="changed">
  <b>What changed</b>− service/web, deployment/web
  <br />
  The control plane and the node stop. Your other objects stay.
</div>

To remove the containers, their volumes and `~/.kite/local`, run
`kite local delete`.

</Step>

## If something goes wrong

| What you see                                 | What to do                                                           |
| -------------------------------------------- | -------------------------------------------------------------------- |
| `Docker is not running`                      | Start Docker, check `docker info`, and run `kite local up` again.    |
| Port 6443 is in use                          | Run `kite local up --port 7443`, or another free port.               |
| The control plane doesn't respond            | Run `kite local logs` and read the first error.                      |
| The node isn't `Ready`                       | Run `kite local logs node-1` to read its install log and agent log.  |
| A pod stays `Pending` or `ContainerCreating` | Run `kubectl describe pod <name>` and read the events at the bottom. |
| Port 8081 is in use                          | Forward another port, for example `8082:80`, and open that one.      |

## Next

- [Deploy to Cloudflare](/docs/deploy-cloudflare/): run the control plane in
  your Cloudflare account and join a real host.
- [Deploy to your own servers](/docs/deploy-servers/): run the control
  plane on a Linux server of your own and join a real host.
- [Compatibility and limitations](/docs/reference/compatibility/): check what your workload
  needs before you move it.
