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

# Managed Kubernetes quickstart

> Create a LayerRail Kubernetes cluster, download the kubeconfig, and deploy your first workload with kubectl in a few guided steps.

This guide creates a LayerRail Kubernetes cluster and deploys Nginx.

## Create a cluster

<Steps>
  <Step title="Open Kubernetes Clusters">
    In the LayerRail console, open your project and choose **Kubernetes Clusters**.
  </Step>

  <Step title="Create a cluster">
    Choose a location, Kubernetes version, control plane count, worker count, and worker size.
  </Step>

  <Step title="Wait for readiness">
    The cluster starts in **creating** state. Wait until the overview page shows the cluster as ready.
  </Step>

  <Step title="Download kubeconfig">
    Open the cluster page and download the kubeconfig file.
  </Step>
</Steps>

## Configure kubectl

```bash theme={null}
export KUBECONFIG="$PWD/layerrail-kubeconfig.yaml"
kubectl get nodes
```

## Deploy Nginx

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

Apply the deployment:

```bash theme={null}
kubectl apply -f nginx.yaml
kubectl get pods
```

## Expose the workload

```bash theme={null}
kubectl expose deployment nginx --port 80 --target-port 80 --type LoadBalancer
kubectl get services
```

<Tip>
  Use [Expose an application using TLS](/managed-kubernetes/expose-application-using-tls) when the service needs a secure public hostname.
</Tip>
