Kubernetes Lab Sample Application

VM side On the master node create two files sample-deployment.yaml # file: sample-deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: sample-app spec: replicas: 2 selector: matchLabels: app: sample-app template: metadata: labels: app: sample-app spec: containers: - name: nginx image: nginx:alpine ports: - containerPort: 80 sample-service-nodeport.yaml # file: sample-service-nodeport.yaml apiVersion: v1 kind: Service metadata: name: sample-service-nodeport spec: type: NodePort selector: app: sample-app ports: - protocol: TCP port: 80 # ClusterIP port targetPort: 80 # Container port nodePort: 30080 # Node port (any available >30000) Deploy application ...

August 14, 2025 · 2 min · 214 words · Dmitry Konovalov