Services Flashcards

1
Q

What types of services are there?

A

ClusterIp, NodePort, LoadBalancer, ExternalName

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe the ClusterIp service type?

A

The ClusterIp type exposes an ip adress for a particular service accessile only from within the kubernetes cluster.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe the NodePort service type?

A

The NodePort service type exposes one port on each node that is linked to a ClusterIp for that service, allowing external access to the service.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe the LoadBalancer service type?

A

The LoadBalancer service type uses a cloud provider’s load balancer to access a NodePort type service

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe the ExternalName service type?

A

Does not use selectors and instead adds a CNAME entry to DNS add-on for the service.

apiVersion: v1
kind: Service
metadata:
name: my-database
namespace: prod
spec:
type: ExternalName
externalName: my.database.example.com

With the above example a request to my-database.prod.svc.cluster.local is redirected to my.database.example.com

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is an EnpdointSlice?

A

An EndpointSlice is a resource that is created automatically by a Service that has a selector. The EndpointSlice will have endpoints to all the resources that have matching labels to that of the selector from the Service.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Create a service in a yaml file of type NodePort with port 3000 as target and port using tcp protocol and selector app: a-label

A

apiVersion: v1
kind: Service
metadata:
name: a-service
spec:
type: NodePort
ports:
- name: a-port
port: 3000
protocol: TCP
targetPort: 3000
selector:
app: a-label

How well did you know this?
1
Not at all
2
3
4
5
Perfectly