Skip to main content
This guide creates a LayerRail Kubernetes cluster and deploys Nginx.

Create a cluster

1

Open Kubernetes Clusters

In the LayerRail console, open your project and choose Kubernetes Clusters.
2

Create a cluster

Choose a location, Kubernetes version, control plane count, worker count, and worker size.
3

Wait for readiness

The cluster starts in creating state. Wait until the overview page shows the cluster as ready.
4

Download kubeconfig

Open the cluster page and download the kubeconfig file.

Configure kubectl

export KUBECONFIG="$PWD/layerrail-kubeconfig.yaml"
kubectl get nodes

Deploy Nginx

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:
kubectl apply -f nginx.yaml
kubectl get pods

Expose the workload

kubectl expose deployment nginx --port 80 --target-port 80 --type LoadBalancer
kubectl get services
Use Expose an application using TLS when the service needs a secure public hostname.