Selector labels
Labels used to match workloads. Defaults to app: <name> if empty.
Ports
Define Service ports and target ports. NodePort is optional when type is NodePort.
Generated YAML
Client-side. Nothing is sent to a server.
apiVersion: v1
kind: Service
metadata:
name: my-service
namespace: default
spec:
type: ClusterIP
selector:
app: my-service
ports:
-
name: http
protocol: TCP
port: 80
targetPort: 8080
