A k8s cluster contains masters(incharge or control nodes) and nodes/minions(actual workers).
an application is containerised and defined in an object called deployment using a yaml file.Which is provided to k8s cluster.the master of k8s cluster reads this yaml file.
in master:
----
kube-apiserver:
front-end to the control plane.
exposes rest api
consumes json via manifest file(state of app).
cluster store:
if api is brain of the cluster then this is memory.
persistent storage.
cluster state and config
uses etcd(open source distributed k-value store,consitent and watchable)
kube-controller-manager:
controller of controllers
-node controller
-endpoints controller
-namespace controller
watches for changes
helps maintain desired state.
kube-scheduler:
watches apiserver for new pods.
Assigns work to nodes.
-affinity/anti-affinity
-constraints
-resources
apiservice is the main and most frequnt one we are dealing with master.So, when we refer to master it might mean apiservice of it.Because no other components exposes endpoints in the master, this is the front end to us to provide any commands(using kubectl commandline in json format) to master.
in node
------
kubelet,container runtime and kube-proxy : components of node.
kubelet:
main kubernetes agent.
registers node with cluster.
watches apiserver(for assignments).
instantiates pods.
reports back to master(if any issues just reports to master, won't restart or fix the pod itself).
exposes endpoint on :10255
some endpoints
/spec(info on node running) /healthz(health check endpoint) /pods(shows running pods(one or more containers packaged together and deployed as a single unit))
container engine:
does container management for the containers inside the pods.
-pulling images
-starting/stopping containers.
the engine is pluggable, it is usually docker and can be rkt also.
kube-proxy:
network brains of the node.
kubernetes networking
-pod ip addresses.(All containers in a pod share a single ip).
-load balances across all pods in a service.
---------------------------
k8s uses declarative model on the concept of desired state.
we declare a state in yaml and kubernetes manages its cluster to keep the curretn and desired state same.
let' say we set 3 nodes with each one of ngnix pods.our desired state is 3 nginx pods.
if any node fails, kubernetes sets the any of the remaining nodes to have one more nginx pod to have the desired state.
------------------------------------
a pod is a basic unit in k8s cluster whcih runs one or more containers.
smallest unit of deployment.
it is a ring fenced environemnt
-network stack
-kernel namespaces
all containers in pod share the pod environment.containers inside a pod interact with localhost interface.
A node may contain multiple pods inside it.
we can deploy a pod using a pod manifest yaml file to apiserver.
replication controller(yaml we will mention no. of replicas,kind : ReplicationController) will deploy multiple pods with same config.
in production rc's are handled separately as replicasets in background.
pods,replication controllers,deployments,services ---> at high level,rest objects in the k8s API
pods(atomic unit of scheduling)
replication controllers(scale pods,desired state,etc)
deployments(RC+rolling updates,rollbacks)
services(stable networking)
services:
---------
pods are mutable and recreated everytime if the task is done or pod is failed.
So, there may be ip conflict as there will be new ip generated everytime.
So we create a service object in k8s to handle this using yaml manifest for service and give it to apiserver.So the interaction will be done with this service object and new pods are connected here.it is stable abstraction point for multiple pods.These pods are attached to service using label selectors for both service and pods with same labels.
Services
-only send to helthy pods
-can be configured for session affinity
-can point to things outside the cluster
-random load balancing
-uses TCP by default
an application is containerised and defined in an object called deployment using a yaml file.Which is provided to k8s cluster.the master of k8s cluster reads this yaml file.
in master:
----
kube-apiserver:
front-end to the control plane.
exposes rest api
consumes json via manifest file(state of app).
cluster store:
if api is brain of the cluster then this is memory.
persistent storage.
cluster state and config
uses etcd(open source distributed k-value store,consitent and watchable)
kube-controller-manager:
controller of controllers
-node controller
-endpoints controller
-namespace controller
watches for changes
helps maintain desired state.
kube-scheduler:
watches apiserver for new pods.
Assigns work to nodes.
-affinity/anti-affinity
-constraints
-resources
apiservice is the main and most frequnt one we are dealing with master.So, when we refer to master it might mean apiservice of it.Because no other components exposes endpoints in the master, this is the front end to us to provide any commands(using kubectl commandline in json format) to master.
in node
------
kubelet,container runtime and kube-proxy : components of node.
kubelet:
main kubernetes agent.
registers node with cluster.
watches apiserver(for assignments).
instantiates pods.
reports back to master(if any issues just reports to master, won't restart or fix the pod itself).
exposes endpoint on :10255
some endpoints
/spec(info on node running) /healthz(health check endpoint) /pods(shows running pods(one or more containers packaged together and deployed as a single unit))
container engine:
does container management for the containers inside the pods.
-pulling images
-starting/stopping containers.
the engine is pluggable, it is usually docker and can be rkt also.
kube-proxy:
network brains of the node.
kubernetes networking
-pod ip addresses.(All containers in a pod share a single ip).
-load balances across all pods in a service.
---------------------------
k8s uses declarative model on the concept of desired state.
we declare a state in yaml and kubernetes manages its cluster to keep the curretn and desired state same.
let' say we set 3 nodes with each one of ngnix pods.our desired state is 3 nginx pods.
if any node fails, kubernetes sets the any of the remaining nodes to have one more nginx pod to have the desired state.
------------------------------------
a pod is a basic unit in k8s cluster whcih runs one or more containers.
smallest unit of deployment.
it is a ring fenced environemnt
-network stack
-kernel namespaces
all containers in pod share the pod environment.containers inside a pod interact with localhost interface.
A node may contain multiple pods inside it.
we can deploy a pod using a pod manifest yaml file to apiserver.
replication controller(yaml we will mention no. of replicas,kind : ReplicationController) will deploy multiple pods with same config.
in production rc's are handled separately as replicasets in background.
pods,replication controllers,deployments,services ---> at high level,rest objects in the k8s API
pods(atomic unit of scheduling)
replication controllers(scale pods,desired state,etc)
deployments(RC+rolling updates,rollbacks)
services(stable networking)
services:
---------
pods are mutable and recreated everytime if the task is done or pod is failed.
So, there may be ip conflict as there will be new ip generated everytime.
So we create a service object in k8s to handle this using yaml manifest for service and give it to apiserver.So the interaction will be done with this service object and new pods are connected here.it is stable abstraction point for multiple pods.These pods are attached to service using label selectors for both service and pods with same labels.
Services
-only send to helthy pods
-can be configured for session affinity
-can point to things outside the cluster
-random load balancing
-uses TCP by default
No comments:
Post a Comment