day09/40 Flashcards
4 types of Services
There are 4 types of Services:
ClusterIP(For Internal access)
NodePort(To access the application on a particular port)
LoadBalancer(To access the application on a domain name or IP address without using the port number)
External (To use an external DNS for routing)
4 mast fileds in yaml
apiVersion:
kind:
metadat:
spec:
ERROR: “mapping” in YAML
in YAML refers to a key-value pair (e.g., key: value).
ERROR: “not allowed in this context”
means that the placement of a key-value pair at that specific position within the YAML structure is invalid according to the Kubernetes schema for the resource being defined.
What is the problem with dynamic IP addresses for pods in Kubernetes?
The IP addresses of pods change when they are restarted, making it difficult for them to communicate with each other and with other services.
What is the solution to the problem of dynamic IP addresses for pods?
Kubernetes services create a static endpoint (DNS name or IP address) that enables access to pods behind the service.
What is the most common type of service in Kubernetes?
ClusterIP - a service available only within the Kubernetes cluster.
Which type of Kubernetes service exposes the service on a specific port on all nodes?
NodePort
What is the Target Port?
An internal port within the cluster used by services and other pods to access the service.
Which type of Kubernetes service creates an external Load Balancer and links it to the service?
LoadBalancer
Which type of Kubernetes service maps an external DNS name to a Kubernetes service?
ExternalName
What is the difference between a Kind cluster and a regular Kubernetes cluster?
A Kind cluster requires additional configurations to expose external services, unlike a regular Kubernetes cluster.
How can you shorten the kubectl command?
By setting an alias in the ~/.bash_profile file - for example: alias k=’kubectl’.
What are Endpoints in a Kubernetes service?
A list of the IP addresses of the pods that the service routes traffic to.