Skip to content

K8s Services

Philip Fourie edited this page Apr 13, 2020 · 1 revision

Service uses selector to forward traffic to the selected pods

apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  type: ClusterIP
  selector:
    app: nginx
  ports:
  - protocol: TCP
    port: 8080
    targetPort: 80
kubectl get svc
kubectl get endpoints my-service
Clone this wiki locally