K8S Basics

K8S Basics

Tags
Engineering
k8s
Created
Sep 26, 2022 11:28 PM
Edited
Nov 16, 2022
Description
Notes of k8s basics

Kubernetes Objects

  • Persistent entities
  • To represent the state of the cluster
Specifically, they can describe: - What containerized applications are running (and on which nodes) - The resources available to those applications - The policies around how those applications behave, such as restart policies, upgrades, and fault-tolerance

Cluster

When you deploy Kubernetes, you get a cluster.
notion image

Node

A Kubernetes cluster consists of a set of worker machines, called nodes, that run containerized applications. Every cluster has at least one worker node.
  • Sometimes they are called worker nodes
Kubernetes runs your workload by placing containers into Pods to run on Nodes.

Pod

The worker node(s) host the Pods that are the components of the application workload.
Pods are the smallest deployable units of computing that you can create and manage in Kubernetes.
  • Use deployment.yaml to deploy pod

Control plane

The control plane manages the worker nodes and the Pods in the cluster. In production environments, the control plane usually runs across multiple computers and a cluster usually runs multiple nodes, providing fault-tolerance and high availability.
  • Coordinate all clusters and resources inlcuding
    • Network routing
    • Scaling
    • Scheduling
    • etc

Controller

Controllers are control loops that watch the state of your cluster, then make or request changes where needed. Each controller tries to move the current cluster state closer to the desired state.
  • Very similar to IoT Shadow that looks for desired state and change the current state of the cluster

Context

context element in a kubeconfig file is used to group access parameters under a convenient name. Each context has three parameters: cluster, namespace, and user.
  • Think it as a combination of cluster, namespace, and user

Namespace

In Kubernetes, namespaces provides a mechanism for isolating groups of resources within a single cluster. Names of resources need to be unique within a namespace, but not across namespaces. Namespace-based scoping is applicable only for namespaced objects (e.g. Deployments, Services, etc) and not for cluster-wide objects (e.g. StorageClass, Nodes, PersistentVolumes, etc).

What is Etcd?How to configure highly available (HA) K8S clusters

Resource