Kubernetes
Services Commands
Expose and load balance your applications. Learn about Service types (ClusterIP, NodePort, LoadBalancer), service discovery, and how to connect applications within the cluster.
9 commands
Pro Tips
Use ClusterIP for internal services, NodePort for testing, and LoadBalancer for production external access.
Services provide DNS names: 'servicename.namespace.svc.cluster.local' for cross-namespace communication.
Use 'kubectl port-forward svc/myservice 8080:80' for quick local access without exposing the service.
Common Mistakes
LoadBalancer services may incur cloud provider costs. Use Ingress for HTTP/HTTPS traffic to reduce costs.
Ensure pod selectors match your deployment labels - mismatched labels mean no traffic reaches pods.