---
title: Fly Kubernetes Quickstart
layout: docs
nav: firecracker
---
<figure class="flex justify-center">
<img src="/static/images/kubernetes.png" alt="Illustration by Annie Ruygt of a figure sailing a ship with a balloon overhead" class="w-full max-w-lg mx-auto">
</figure>
<div class= "important icon">
Fly Kubernetes is in beta and not recommended for critical production usage. To report issues or provide feedback, email us at beta@fly.io.
</div>
To create a Kubernetes cluster, run:
```cmd
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
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:
```cmd
export KUBECONFIG=/path/to/kubeconfig/file
```
Our cluster is accessible over our organization's [private WireGuard network](/docs/reference/private-networking). To connect to our cluster, we need a WireGuard configuration.
Follow the [Private Network VPN instructions](/docs/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
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:
```cmd
kubectl apply -f https://k8s.io/examples/controllers/nginx-deployment.yaml
```
```output
deployment.apps/nginx-deployment created
```
We can see our deployment:
```cmd
kubectl get deployments
```
```output
NAME READY UP-TO-DATE AVAILABLE AGE
nginx-deployment 3/3 3 3 7s
```
We can view the logs of all the pods in the deployment:
```cmd
kubectl logs -l app=nginx
```
```output
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
...
```
## What we don't support
- 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](/docs/kubernetes/clusters/)
- [Connect to an FKS cluster](/docs/kubernetes/connect-clusters/)
- [Configure FKS Services](/docs/kubernetes/services)
Fly Kubernetes Quickstart
Fly Kubernetes is in beta and not recommended for critical production usage. To report issues or provide feedback, email us at beta@fly.io.
To create a Kubernetes cluster, run:
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.
From there, you can use standard YAML configuration to drive Kubernetes. Here’s a simple deployment example from the Kubernetes official documentation: