Section 1: Core Concepts
Section 1: Core Concepts
Cluster architecture
4
● There are two types of nodes that host applications in form of
containers, in a Kubernetes cluster architecture. Master node and
worker nodes.
○ Master : Manage, plan, schedule, monitor nodes.
◆ The master nodes is responsible for :
nodes as desired.
◆ It is used to send health signals of the objects on
Services
● Services are used to connect apps together with other apps / users.
There are 3 types of services in Kubernetes.
Namespaces
● Namespaces are used to logically divide a k8s cluster.
○ You can perform the following on namespaces.
◆ List : k get namespaces
◆ Create : k create namespaces
◆ Change current namespace(context) : k config set-context $
– serviceName
– serviceName.namespace
– serviceName.namespace.svc OR
– serviceName.namespace.svc.cluster.local
● Imperative commands
○ These are used to lay out steps to take when create, updating or
deleting an object in k8s. Examples include :-
○ Creating objects
◆ k run nginx --image=nginx
◆ k create deployment nginx --image=nginx --replicas 2
◆ k expose deployment nginx --port 8080
○ Updating objects
◆ k edit deployment nginx
◆ k set image deployment nginx --image=nginx:1.8
◆ k scale deployment nginx --replicas 4
○ PODS
◆ Creating NGINX pod : k run nginx --image=nginx
◆ Generating a template file : k run nginx --image=nginx --dry-
client=client -o yaml
◆ --dry-client=client : This option just tests if the pod
image=nginx
◆ Creating a deployment with 2 replicas : k create deployment
○ SERVICES
◆ Creating a ClusterIP service to expose pod mysql to port
3306 :-
– k expose pod mysql --port=3306 --name=mysql-service
--dry-client=client -o yaml
◆ OR
● Declarative commands