Kubernetes Components Flashcards
Why Kubernetes?
Helps manage containerised applications in various different environments
What problems do kubernetes solve?
Rise of micro-services, cost and usage. Containers offer the perfect host for small independent applications, like micro-services.
The rise of micro-services has resulted in thousands of containers that use to be managed across different environments and were scripted and self made tools is really complex.
What do orchestration tools offer?
High Availability - no downtime
Scalability - users have high response rate from application
Disaster Recovery - if data is lost or server explodes mechanism in place to not affect customers. And restore any data lost.
Worker Node?
simple server, physical or vm
pod?
basic component or smallest unit in k8
it is a abstraction over container
pod only runs one application inside of it
how do pods communicate with each other?
each pod has its own virtual ip address
Disadvantages of Pods?
They are ephemeral.
If the application crashes inside of the pod it will die.
If this happens it will get assigned a new pod with new IP address.
So this is annoying if you have ip addresses communicating with a database as you have to adjust the pod every time a pod restarts
What is the service component? (2 answers)
This is a permanent IP address. The lifecycles of the pod and services are not connected.
It is also a load balancer, it can catch a request and forward to required endpoint.
What are external services
Allows you to make application publicly accessible through a browser.
What are internal services
make your application privately accessible (like a database for example)
What is ingress?
allows you to have secure protocols and domain names for your pods.
How to change a database url in a pod?
You would use config map and you can then connect this to the pod.
Where would you put db credentials?
the secret component which stores sensitive data in base64 format.
How do you persist data in a db long term in k8?
Volumes.
This works by attaching a physical storage on a hard drive to your pod.
You could store this on a local machine that the pod is running or remotely (on prem or cloud storage)
How would you apply disaster recovery in k8?
You would define a blueprint for any many replica pods you would like to run. This service is the called blueprint.
You would have your node which contains two pods (application and database) these communicate through the service component using permanent ips. This also acts as a loadbalancer. You could then have direct replica of both of these pods