Skip to content

Latest commit

 

History

History
42 lines (35 loc) · 882 Bytes

k8s node-service.md

File metadata and controls

42 lines (35 loc) · 882 Bytes

Setting Up a Kubernetes Service Deployment

This guide demonstrates how to set up a service deployment for Kubernetes. You can follow the example YAML configuration provided below to create a service for your Kubernetes cluster.

Example YAML Configuration

apiVersion: v1
kind: Service
metadata:
    name: posts-srv
spec:
    type: NodePort
    selector:
        app: posts
    ports:
        - name: posts
          protocol: TCP
          port: 4000
          targetPort: 4000

Instructions for Deployment

  • Apply the configuration using the following command:
kubectl apply -f posts-srv.yaml
  • Verify the service deployment:
kubectl get services
  • Obtain detailed information about the service:
kubectl describe service posts-srv
  • Check the logs for the service:
kubectl logs service posts-srv