Jirayut Nimsaeng
GDE Cloud Bangkok
Founder & CEO
Opsta (Thailand) Co.,Ltd.
Introduction to
Kubernetes with Demo
Jirayut Nimsaeng
Speaker
● Founder & CEO,
Opsta (Thailand) Co.,Ltd.
● GDE Cloud Bangkok
● DevSecOps Transformation
Consultant
● First Certified Kubernetes
Administrator (CKA) in Thailand
● Cloud and Service Model
● Virtual Machine, Container and Docker
● What is Kubernetes?
● Kubernetes Architecture
● Google Kubernetes Engine (GKE) and Benefits
● Kubernetes Basic Concept
Agenda
Modern Infrastructure
Cloud
Cloud as a Service Model
Future
Virtual Machine, Container, Docker
VMs are an infrastructure
level construct to turn one
machine into many servers
Containers are an app level
construct
VM and Container Together
Build, Ship, Run
Developers IT Operations
BUILD
Development Environments
SHIP
Secure Content & Collaboration
RUN
Deploy, Manage, Scale
Registry
Control plane
Multi-container
appsEngines running on
servers in cloud or
datacenter
Images stored
in repos
Clients pull and
push images
Docker on one server
Node
Container
Multiple servers?
Node
Container
Node Node
???
● Kubernetes, in Greek, means the Helmsman, or pilot of the ship
● It is pilot of a ship of containers
● Kubernetes is a software written in Go for automating deployment,
scaling, and management of containerized applications
● Focus on manage applications, not machines
● Open source, open API container orchestrator
● Supports multiple cloud and bare-metal environments
● Inspired and informed by 15 years of Google’s experiences and internal
systems
What is Kubernetes?
● Automatic bin packing
● Self-healing
● Horizontal manual/auto-scaling
● Service discovery & load balancing
● Automated rollouts and rollbacks
● Secret and configuration management
● Storage orchestration
● Batch execution
Kubernetes Key Features
Kubernetes Architecture
https://thenewstack.io/kubernetes-an-overview/
Kubernetes Platform
https://landscape.cncf.io
Google Kubernetes Engine (GKE) provides a managed
environment for deploying, managing, and scaling your
containerized applications using Google
infrastructure. The GKE environment consists of
multiple machines (specifically, Compute Engine
instances) grouped together to form a cluster.
Google Kubernetes Engine (GKE)
● Single click / command to create high availability cluster
● Easy scaling
● Automatic scaling
● Easy upgrade
● Security Features
● Global load balancing
● Dashboard
● Logging and Monitoring
Benefits of GKE
● Manifest File
● Pod
● Deployment
● Service
● Ingress
● Namespace
● Rolling Update
Kubernetes Basic Concept
apiVersion: v1
kind: Pod
metadata:
name: busybox
namespace: default
spec:
containers:
- name: busybox
image: busybox
command:
- sleep
- "3600"
Kubernetes Manifest File
This is what called
Infrastructure as Code
(IaC)
Pod
● Logical Application
○ One or more containers
and volumes
○ Shared namespaces
○ One IP per pod
Pod
nginx
application
NFSiSCSIGCE
10.10.1.100
Deployment
Drive current state towards desired state
app: hello
replicas: 1
Node1
Pod
hello
Node2 Node3 Node4
Deployment
Drive current state towards desired state
app: hello
replicas: 3
Node1
Pod
hello
Node2 Node3 Node4
Deployment
Drive current state towards desired state
app: hello
replicas: 3
Node1
Pod
hello
Node2
Pod
hello
Node3
Pod
hello
Node4
Deployment
Drive current state towards desired state
app: hello
replicas: 3
Node1
Pod
hello
Node2
Pod
hello
Node3 Node4
Deployment
Drive current state towards desired state
app: hello
replicas: 3
Node1
Pod
hello
Node2
Pod
hello
Node3 Node4
Pod
hello
Deployment
Drive current state towards desired state
app: hello
replicas: 3
Node1
Pod
hello
Node2
Pod
hello
Node3 Node4
Deployment
Drive current state towards desired state
app: hello
replicas: 3
Node1
Pod
hello
Node2
Pod
hello
Node3 Node4
Pod
hello
Service
Pod
hello
Service
Pod
hello
Pod
hello
Service Type
Devices
Cloud Load
Balancer with
Public IP
Node 3Node 2Node 1
Service A Type=LoadBalancer
App A
Pod 1
App A
Pod 2
App A
Pod 3
DB
Pod 1
Port 31752 Port 31752 Port 31752
Port 80, 443
Service DB Type=ClusterIP
Ingress
Devices
Cloud Load
Balancer with
Public IP
Node 3Node 2
Service B Type=ClusterIP
Node 1
Service Ingress Type=LoadBalancer
Ingress Controller
Service A Type=ClusterIP
App A
Pod 1
App B
Pod 1
App A
Pod 2
App A
Pod 3
App B
Pod 2
App B
Pod 3
Ingress Resource
● foo.com - Service A
● bar.com - Service B
Port 31752 Port 31752 Port 31752
Port 80, 443
Namespace
Namespace B
Deployment
Namespace A
Deployment
Pod
hello
Service
Pod
hello
Pod
hello
Pod
hello
Service
Pod
hello
Pod
hello
Rolling Update
Node1 Node3Node2
ghost
Pod
app v1
Service
ghost
Pod
app v1
Pod
app v1
Rolling Update
Node1 Node3Node2
ghost
Pod
app v1
Service
ghost
Pod
app v1
Pod
app v1
Pod
app v2
Rolling Update
Node1 Node3Node2
ghost
Pod
app v1
Service
ghost
Pod
app v1
Pod
app v1
Pod
app v2
Rolling Update
Node1 Node3Node2
ghost
Pod
app v1
Service
ghost
Pod
app v1
Pod
app v1
Pod
app v2
Rolling Update
Node1 Node3Node2
Service
ghost
Pod
app v1
Pod
app v1
Pod
app v2
Rolling Update
Node1 Node3Node2
Service
ghost
Pod
app v1
Pod
app v1
Pod
app v2
Pod
app v2
Rolling Update
Node1 Node3Node2
Service
Pod
app v1
Pod
app v2
Pod
app v2
Rolling Update
Node1 Node3Node2
Service
Pod
app v1
Pod
app v2
Pod
app v2
Pod
app v2
Rolling Update
Node1 Node3Node2
Service
Pod
app v2
Pod
app v2
Pod
app v2
● ConfigMap
● Secret
● Job
● CronJob
● StatefulSet
● Persistent Volume
There’s a lot to learn
● HealthCheck
● LimitResource
● NetworkPolicy
● AutoScaling
● Helm
● Operator
Opsta DevSecOps Platform
Developer
Infrastructure
& IaC
Support
Tools
VCS
Artifacts
CI CD
Dev
Test
Prod Monitoring
Load Testing
Security
Jirayut Nimsaeng
GDE Cloud Bangkok
Founder & CEO
Opsta (Thailand) Co.,Ltd.
jirayut@opsta.co.th
fb.me/winggundamth
Q & A
Backup Slides
● Application consists of:
○ Deployment
○ Service
○ Ingress
○ Configmap
○ Secret
○ Etc.
● More effort for operate and difficult control environment values
● Hard to manage release (Rollback, Rollout, History)
● Hard to reuse configuration template cause specification environment
Problem with Manifest File
Helm is the package manager for Kubernetes
Helm
● Helm Charts helps you define, install, and upgrade
● Charts are easy to create, version, share, and publish
● Public Helm Charts are at https://hub.kubeapps.com
Helm Charts

Introduction to Kubernetes with demo