DocsKuberneteskubectl Access
Kubernetes

kubectl Access

Connect to your cluster and deploy applications.

Verify connection

bash
kubectl cluster-info
kubectl get nodes
kubectl get pods -A

Deploy a sample application

yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-demo
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: nginx-service
spec:
  type: LoadBalancer
  selector:
    app: nginx
  ports:
  - port: 80
    targetPort: 80

Apply and check

bash
kubectl apply -f nginx-demo.yaml
kubectl get pods
kubectl get svc nginx-service
# External IP will be assigned in ~60s
← Previous
Create a Cluster

Was this article helpful?

Need more help? Open a support ticket

On this page

Verify connection
Deploy a sample application
Apply and check
Get support