Kubernetes Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 81: Line 81:
{{Internal|Kubernetes_Operations#Namespace_Operations|Namespace Operations}}
{{Internal|Kubernetes_Operations#Namespace_Operations|Namespace Operations}}


=Deployment=
{{Internal|Kubernetes Deployment|Deployment}}





Revision as of 02:38, 10 August 2019

External

Internal

Overview

Kubernetes is an Open Source orchestrator for a container environment.

Kubernetes is an container orchestration platform, offering the ability of orchestrate Docker containers across multiple hosts. Kubernetes provides the ability to specify how many hosts to deploy containers to, how many containers to deploy, how to scale them, where persistent storage resides, and how to deploy a group of containers as a unit. It manages containers in a clustered environment. In other words, it orchestrates containers at scale, defines application topologies, handles parts of the container networking and storage, manages container state and schedules containers across hosts.

Declarative vs. Imperative Approach

Various Kubernetes elements, such as, for example, Deployments and Replica Sets, are powered by control loops. Control loops are a design pattern for distributed software that allows declaratively defining desired state and have the software implement the desired state based on the current state

Cluster

Master

The master node includes:

  • the API server
  • etcd instance
  • the scheduler
  • controllers
OpenShift Master

Node

OpenShift Node

Pod

A pod is analogous to a VM. It consists in a group of containers sharing network and storage. It is implemented as a pause container. A pod can be defined in a YAML file.

OpenShift Pod Concepts

Pod Operations

Pod Operations

Service

Label

OpenShift Label

Selector

OpenShift Selector

kubelet

kubelet is the Kubernetes node agent.

kubectl

kubectl is the Kubernetes main command-line tool.

kubectl

Context

Curent Context

The current context can be obtained with kubectl config current-context.

Namespace

Kubernetes Concepts - Namespaces

A namespace provides scope for:

  • named resources to avoid naming collisions
  • delegating management authority to trusted users
  • the ability to limit community resource consumption
OpenShift Project

Namespace Operations

Namespace Operations

Deployment

Deployment







Storage

Persistent Volume

https://kubernetes.io/docs/concepts/storage/persistent-volumes/

Represented by a PersistentVolume object. It is associated with a project.

An administrator provision persistent volumes from sources such as:

  • NFS
  • GCE Persistent Disks
  • ESB Volumes
  • GlusterFS
  • OpenStack Cinder
  • Ceph RBD
  • iSCSI
  • Fiber Channel

Storage resources are requested by laying a claim to the resource (PersistentVolumeClaim). A persistent volume claim is a request for a resource with a specific attributes. When a request is made, a process matches it to an available volume and binds them together. The runtime finds the volume bound to the claim and mounts it into the pod.

Persistent volumes can be recycled after use. The reclamation policy is based on the "persistentVolumeReclaimPolicy" declared in the PersistentVolume object definition. The policy can be "Retain" or "Recycle".

OpenShift Persistent Volume

etcd

A distributed key/value datastore for state within the environment.

etcd

Scheduler

OpenShift Scheduler

Policies

Policies are rules that specify which users can and cannot specify actions on objects (pods, services, etc.).

OpenShift Policies

Service

https://docs.openshift.com/container-platform/3.5/architecture/core_concepts/pods_and_services.html#services
OpenShift Service
Relationship between a Service and an OpenShift Router

Service Definition File

Service Definition File

API

OpenShift API


Replica

A replica is a set of pods sharing the same definition.

Replication Controller

OpenShift Replication Controller

Replication Controller Definition File

Replication Controller Definition File