> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fly.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Fly Kubernetes Quickstart

<img src="https://mintcdn.com/fly-io/izaS1l2UMuz6sm1H/images/kubernetes.png?fit=max&auto=format&n=izaS1l2UMuz6sm1H&q=85&s=fa3cf263af1e4f2382d6d7c90f56ee59" alt="Illustration by Annie Ruygt of a figure sailing a ship with a balloon overhead" width="1200" height="735" data-path="images/kubernetes.png" />

<Note>
  Fly Kubernetes is in closed beta and not recommended for critical production usage. To report issues or provide feedback, email us at [beta@fly.io](mailto:beta@fly.io).
</Note>

To create a Kubernetes cluster, run:

```bash theme={null}
fly ext k8s create
```

This will start the provisioning process. You'll be asked for a cluster name, the organization, and the region in which to create the cluster.

Once a cluster is provisioned, it will return a kubeconfig that can be used to connect to your cluster's Kubernetes API server using kubectl.

For example:

```yaml theme={null}
apiVersion: v1
clusters:
  - name: fks-flyio-fksdemo
    cluster:
      certificate-authority-data: ...
      server: https://fks-flyio-fksdemo.flycast:6443
      extensions:
      ...
      ...
contexts:
  - context:
      cluster: fks-flyio-fksdemo
      user: default
    name: default
current-context: default
kind: Config
preferences: {}
users:
  - name: default
    user:
    ...
    ...
```

We're going to save the output into a file named `kubeconfig` and create an environment variable `KUBECONFIG` that points to the file:

```bash theme={null}
export KUBECONFIG=/path/to/kubeconfig/file
```

Our cluster is accessible over our organization's [private WireGuard network](/networking/private-networking). To connect to our cluster, we need a WireGuard configuration.

Follow the [Private Network VPN instructions](/networking/private-networking#private-network-vpn) to set up a permanent WireGuard connection to your Fly.io IPv6 private network.

From there, you can use standard YAML configuration to drive Kubernetes. Here's a simple deployment example from the [Kubernetes official documentation](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-deployment):

```yaml theme={null}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
```

This creates a `ReplicaSet` with 3 nginx pods. Using kubectl, we can apply this:

<CodeGroup>
  ```bash cmd theme={null}
  kubectl apply -f https://k8s.io/examples/controllers/nginx-deployment.yaml
  ```

  ```output output theme={null}
  deployment.apps/nginx-deployment created
  ```
</CodeGroup>

We can see our deployment:

<CodeGroup>
  ```bash cmd theme={null}
  kubectl get deployments
  ```

  ```output output theme={null}
  NAME               READY   UP-TO-DATE   AVAILABLE   AGE
  nginx-deployment   3/3     3            3           7s
  ```
</CodeGroup>

We can view the logs of all the pods in the deployment:

<CodeGroup>
  ```bash cmd theme={null}
  kubectl logs -l app=nginx
  ```

  ```output output theme={null}
  Pulling container image registry-1.docker.io/library/nginx:1.14.2
  Pulling container image registry-1.docker.io/library/nginx:1.14.2
  Pulling container image registry-1.docker.io/library/nginx:1.14.2
  Successfully prepared image registry-1.docker.io/library/nginx:1.14.2 (1.597714717s)
  Successfully prepared image registry-1.docker.io/library/nginx:1.14.2 (1.493016957s)
  Successfully prepared image registry-1.docker.io/library/nginx:1.14.2 (1.604003393s)
  Configuring firecracker
  Configuring firecracker
  Configuring firecracker
  ...
  ```
</CodeGroup>

<h2 id="what-we-dont-support">
  What we don't support
</h2>

* Multi-container pods (coming soon)
* Network policies
* Horizontal pod autoscaling
* Gateway API
* Daemon sets
* EmptyDir volumes
* Interactive pods (`kubectl run --interactive --tty`)

On container specs, we don't support the following fields:

* `workingDir`
* `ports`
* `livenessProbe`
* `readinessProbe`
* `startupProbe`
* `resizePolicy`
* `stdin`
* `stdinOnce`
* `tty`
* `EnvVarSource.fieldRef`
* `EnvVarSource.resourceFieldRef`
* `volumeDevices`
* `lifecycle`
* `terminationMessagePath`
* `terminationMessagePolicy`
* `imagePullPolicy`
* `securityContext`

## Other caveats

Right now we don't get logs from a single pod. If you try to get logs from a single pod, you'll get the logs from every pod in the namespace.

## Related topics

* [Create an FKS cluster](/kubernetes/clusters)
* [Connect to an FKS cluster](/kubernetes/connect-clusters)
* [Configure FKS Services](/kubernetes/services)
