Kubernetes - Services
Which of the following YAML snippets correctly defines a ClusterIP service?
AapiVersion: v1
kind: Pod
metadata:
name: my-service
spec:
containers:
- name: myapp
image: nginx
BapiVersion: v1
kind: Service
metadata:
name: my-service
spec:
type: NodePort
selector:
app: myapp
ports:
- protocol: TCP
port: 80
targetPort: 8080
CapiVersion: v1
kind: Service
metadata:
name: my-service
spec:
type: ClusterIP
selector:
app: myapp
ports:
- protocol: TCP
port: 80
targetPort: 8080
DapiVersion: v1
kind: Service
metadata:
name: my-service
spec:
type: LoadBalancer
selector:
app: myapp
ports:
- protocol: UDP
port: 80
targetPort: 8080
