Document Details

RosyBougainvillea5877

Uploaded by RosyBougainvillea5877

SCS-NTU

Tags

kubernetes storage deployments cloud computing

Summary

This document is a lecture on Kubernetes, covering fundamental concepts, volumes, storage classes, deployments, and replica sets. It includes diagrams and examples.

Full Transcript

Official (Open) Kubernetes – Part 3 Official (Open) Volume local machine remote Volume data...

Official (Open) Kubernetes – Part 3 Official (Open) Volume local machine remote Volume data Storage on local machine my-app db Or remote, outside of the k8s cluster Service Service Official (Open) How volume works? Official (Open) Example of PV & PVC Note: 1. StorageClasses(SC) automates this process 2. You cannot map an external storage volume to multiple PVs. Official (Open) Example of StorageClasses Assume you have an external storage system with two tiers of storage SSD Fast storage Mechanical slow archive storage You expect apps on your K8s cluster to use both, so you create two Storage Classes and map them as follows. Applications can create volumes on-the-fly by creating PVC referencing either of the storage classes. Official (Open) A StorageClass YAML provisioner: parameters: Defines which plugin to use Defines the storage attributes based on AWS solid state drives (io1) in Ireland Region (eu-west-1a) Performance level of 10 IOPs per GB allowedTopologies: Encrypted volumes Defines where replicas should go Note: 1. StorageClass objects are immutable – cannot modify once deployed 2. metadata.name should be meaningful Official (Open) Working with StorageClasses Basic workflow for deploying and using a StorageClass: 1. Have a storage back-end (can be cloud or on premise) 2. Create your Kubernetes cluster 3. Install and configure the CSI storage plugin 4. Create one or more StorageClasses on K8s 5. Deploy Pods and PVCs that reference those StorageClasses Official (Open) Access mode Kubernetes supports three access modes for volumes ReadWriteOnce (RWO) ReadWriteMany (RWM) ReadOnlyMany (ROM) Access Modes ReadWriteOnce PV that can only be bound as R/W by a single PVC ReadWriteMany PV that can be bound as R/W by multiple PVCs. Usually only supported by file and object storage, e.g. NFS. ReadOnlyMany PV that can be bound as R/O by multiple PVCs Note: A PV can only be opened in one mode! Official (Open) Reclaim policy Defines how to deal with a PV when its PVC is released Two types of policy: Delete Most dangerous! Deletes the PV and associated storage resource when PVC is released Retain Keep the associated PV on cluster as well as any data stored Other PVCs are prevented from using it in future Requires manual clean-up Official (Open) Deployment ReplicaSets my-app db my-app db Abstraction of Pods Allow self-heal Allow scaling Service Service Service Service Allow easy updates and rollbacks Db can’t be replicated via Deployment! Official (Open) Deployment Official (Open) ReplicaSets Official (Open) Fundamental Concepts Desired state – what you want Observed state – what you have Reconciliation – match observed state to desired state Declarative model – telling K8s what you want Imperative model – telling k8s how to do For example: Assume an application with two microservices – front-end and back-end. To meet expected demand, you know you need 5 instances of the front-end Pod and 2 instances of the back-end Pod. Official (Open) Rolling updates with Deployments Rollback Zero downtime rollout Official (Open) Kubernetes Components summarized data persistence self-healing, rolling update, replicaSets

Use Quizgecko on...
Browser
Browser