SlideShare a Scribd company logo
Lack of agility
• 새로운 서비스에 대한
개발 시간
• 운영시간이 Budget과 연결
• Innovation is happening
outside IT inside
business areas
Aging infrastructure
• 데이터 센터의 Hardware,
Operating systems, Business
applications 의 노후화에
따른 영향
• 운영 비용, 효율성 및 안정성
• 자본 지출, 요구 사항
• 보안감사 및 규정 준수
High Cost
• Longer release cycles,
monolithic and highly
coupled architecture
• Highly IT dependent
• Low application
performance and time-to-
market compromise
business agility
From traditional app to modern app
APP
Containerize
Applications
Re-architect
apps for scale
with
containers.
Containers
Container Platform
Existing
Application
On-Premises
Infrastructure Platform
PaaS
Application Platform
Modern
Microservices
Add new services
or start peeling off
services from
monolithic code.
Serverless
Modern
Infrastructure
rehost as VMs
or refresh to
modern
container
platform.
IaaS
Infrastructure Platform
“lift & shift”
Sock-Shop
• VM보다 가벼운 형식으로 애플리케이션을 pack, ship, run
• 컨테이너는 프로세스 격리를 기반으로 하는 애플리케이션 전달 메커니즘
• Linux Kernel 기술 사용 : cgroups, namespaces + overlay fs + tooling
• 컨테이너 이미지를 사용하면 응용 프로그램 코드, 런타임 및 모든 Dependency들을 Pre-
Defined Format으로 제한 가능
• Container 는 새로운 것이 아닙니다 - 리눅스 LXC, Solaris Zones, BSD Jails 처럼 기존에 있던
개념!!!
✓ Docker 는 기존의 있는 것을 사용하여 빌드하고 관리할 오픈소스 소프트웨어를 만들었음
Virtual Machines
Each VM has independent, full OS
Full isolation
Separate app frameworks
Support features such as live migration
Slow to boot
Containers
Shared Host OS
Near instant start-up
Processes in containers are isolated
Dependent app services and libraries are tied to
container (layers)
Every container has an isolated view and gets
it ’s own file system, it ’s own PID0 and eth0
network interface
Virtual Machine
Container
Containers vs. VM’s
The container advantage
Fast
iteration
Agile
delivery
Immutability Cost
savings
Elastic
bursting
Efficient
deployment
For ITFor developers
2013년 3월 PyCon Conference – Docker (Solomon Hykes)
컨테이너 기반의 오픈소스 가상화 플랫폼
Docker - Build, Ship, and Run Any App, Anywhere
$ docker search ubuntu
$ docker pull ubuntu:latest
$ docker images
$ docker run – i – t --name hello ubuntu /bin/bash
$ docker ps – a
$ docker stop ubuntu
$ docker # remove container
$ docker # remove image
$ docker build -t helloworld:0.1 .
$ docker run -d -p 80:80 nginx
$ curl ifconfig.co
$ curl <IP-Address>
$ docker build -t dazdaz/gallery3 .
Creating Containers - Dockerfile
Example of a Dockerfile
FROM nginx:alpine
LABEL author=“Inhye Park"
COPY ./dist /usr/share/nginx/html
EXPOSE 80 443
ENTRYPOINT ["nginx", "-g", "daemon off"]
Create the Dockerfile and run :
Creating Containers - Dockerfile
Docker Volumes
• When the container dies, the data is destroyed, containers are ephemeral
• Docker Volume 은 Data 를 Persistent하게 유지하기 위해 Docker Container에서 사용 됨
$ docker create volume myvol1
$ docker volume ls
$ docker volume inspect myvol1
$ docker run -d --name devtest --mount source=myvol1,target=/app nginx:latest
Docker Compose
• Compose 는 multi-container docker를 구동시키고 Define 하기 위한 Tool
• Compose 는 Docker compose 파일을 사용하여 애플리케이션 서비스를 구동시킬 수 있음
$ cd project-directory
$ docker-compose up -d
$ docker-compose ps
$ docker-compose logs wordpress
$ az vm open-port -g u1804-rg -n u1804 --port 8000 --priority 1001
$ curl ifconfig.co
$ docker-compose down --volumes
Container Management at Scale
Load
Balancing:
evenly
distribute traffic
Lifecycle and
Health:
keep containers
running despite
failure
Cluster
Management:
deploy and
manage cluster
resources
Scheduling:
where
containers run
Naming and
Discovery:
where are my
containers
Logging and
Monitoring:
track what’s
happening in
containers and
cluster
Image
repository:
centralized,
secure Docker
container
images
Storage
volumes:
persistent data
for containers
Scaling:
make sets of
containers
elastic in
number
Continuous
Delivery:
CI/CD pipeline
and workflow
At the end of the day we need something to
help us with all the orchestration..
An orchestrator!
https://trends.google.com/trends/explore?date=today%205-y&q=kubernetes,docker%20swarm,mesosphere,openstack,cloud%20foundry
What is Kubernetes(k8s)?
• Kubernetes is "an open-source software for automating deployment, scaling, and
management of containerized applications“.
• Kubernetes, in Greek κυβερνήτης, means the Helmsman, or pilot of the ship.
• Keeping with the maritime theme of Docker containers, Kubernetes is the pilot
of a ship of containers.
History
• Google open sourced Borg. Google still actively involved
• Kubernetes v1.0 was released on July 21, 2015 by Joe Beda, Brendan Burns
and Craig McLuckie
• Most discussed repo in Github last year. Over 1,700 authors;
releases every three month
• To learn more about the ideas behind Kubernetes: read the
Large-scale cluster management at Google with Borg paper
Kubernetes Features
• Self-Healing
자동으로 문제가 발생한 노드의 컨테이너를 대체(룰/정책에 따른 헬스 체크)
• Horizontal Scaling
CPU 와 메모리와 같은 리소스 사용에 따라 자동으로 어플리케이션을 확장
경우에 따라서, 사용자 정의 측정 값을 기준으로 한 동적인 확장 가능
• Service Discovery and Load Balancing
Container에 고유한 IP를 부여
여러 개의 Container를 묶어 단일 Service로 부여하는 경우 단일 DNS Name으로 접근하도록 로드
밸런스를 제공
• Automatic bin packing
가용성에 대한 희생 없이, 리소스 사용과 제약 사항을 기준으로 자동으로 컨테이너를 스케줄링
Kubernetes Features
• Automated rollouts and rollbacks
다운타임없이 애플리케이션의 새로운 버전 및 설정에 대한 롤아웃/롤백 가능
• Storage orchestration
소프트웨어 정의 저장장치를 기반으로 로컬, 외부 및 저장소 솔루션 등을 동일한 방법으로
컨테이너에 마운트 할 수 있음
• Secret and configuration management
애플리케이션의 secret과 configuration 정보를 이미지와 독립적으로 구분하여 별도의 이미지
재생산 없이 관리
• Batch execution
CI 워크로드와 같은 Batch 성 작업 지원
Crontab 형식으로 스케줄링도 가능
Kubernetes Users
from kubernetes.io
Kubernetes Architecture
kubectl
API server
controller-manager
(replication, namespace,
serviceaccounts,…)
scheduler
etcd
Internet
Master node
kubelet
Pod Pod
docker
Worker node
kubelet Kube-proxy
Pod Pod
docker
Worker node
Kube-proxy
Master Components
• Kube-api-server
• Front-end control plane. Exposes API
• controller-manager
• Runs controllers, e.g. replication controller,
node controller
• scheduler
• assigns pods to nodes
• etcd
• Highly available, distributed Cluster database.
• add-ons
• DNS, Heapster (enables monitoring and
performance analysis), Dashboard, Logging
Worker Node Components
• Kubelet
• Primary node agent
• Watches and runs assigned pods
• Executes health probes and reports status
• Kube-proxy
• Enables network services
• Container Runtime
• Docker, rkt(deprecated) ..
kubectl
• CLI to run commands against a
Kubernetes cluster
• Swiss Army Knife: run deployments, exec
into containers, view logs, etc.
• Pronounced “koob sea tee el” or
“koob cuddle”
• Available for Windows and Linux – of
course available in Azure Cloud Shell
Declarative vs Imperative
• Commands like kubectl run and kubectl expose are imperative
commands (do this thing now)
• Declarative way – Describe the state of resources in a file(JSON or YAML).
Kubectl apply –f webresource.yaml
Kubernetes Resources
pod
service
deployment
volumes
ingress daemon set, job
namespace secret, config-map
What is a pod?
• Kubernetes 에서 최소 논리 단위
• 하나의 애플리케이션을 표현하는 최소 논리 단위
• Worker 노드에서 실행하는 Container의 집합
• 하나의 Pod내에서는 1…N개의 Container를 가질 수 있음
• 주로 Tightly Coupled 되는 Container들을 하나의 Pod에 묶음
예: NginX + Tomcat
예: Tomcat + Memcached
• Pod에 있는 Container 는 물리적으로 같은 서버에 생성됨
• 하나의 Pod내에서는 PID Namespace , network 와 호스트를 공유함
Content
Manager
Consumers
File
Puller
Web
Server
Volume
Pod
Kubernetes manifest: Pod
apiVersion: v1
kind: Pod
metadata:
name: redis-django
labels:
app: web
spec:
containers:
- name: key-value-store
image: redis
ports:
- containerPort: 6379
- name: frontend
image: django
ports:
- containerPort: 8000
pod
name: redis-django
Container
key-value-store
Port 6379
Image: redis-
django
Container
frontend
Port 8000
Image: django
Interact with pods
$ kubectl get pod --all-namespaces
$ kubectl describe pod/my-pod
$ kubectl logs my-pod
# Run bash in container
$ kubectl exec -it my-pod bash
Kubernetes Services
• Defines a logical set of pods
• Identified/selected using Labels
• Essentially a virtual load balancer in front of pods
Client Kube-proxy
apiserver
Backend Pod 1
labels: app=My App
port: 9376
Backend Pod 2
labels: app=My App
port: 9376
Backend Pod 3
labels: app=My App
port: 9376
ServiceIP
(iptables)
Node
• Service Type LoadBalancer
• Basic Layer4 Load Balancing (TCP/UDP)
• Each service has assigned an IP on the
ALB
apiVersion: v1
kind: Service
metadata:
name: frontendservice
spec:
loadBalancerIP: X.X.X.X
type: LoadBalancer
ports:
- port: 80
selector:
app: frontend
Azure AKS VNet
AKS subnet
AKS cluster
FrontEndService
Pod1
label:Frontend
Pod2
label:Frontend
Pod3
label:Frontend
Public LB
Public IP
• Used for internal services that should
be accessed by other VNETs or On-
Premise only
apiVersion: v1
kind: Service
metadata:
name: internalservice
annotations:
service.beta.kubernetes.io/azure-load-balancer-internal:
"true"
spec:
type: LoadBalancer
loadBalancerIP: 10.240.0.25
ports:
- port: 80
selector:
app: internal
Azure AKS VNet
AKS subnet
AKS cluster
InternalService
Pod1
label:Internal
Pod2
label:Internal
Pod3
label:Internal
Internal LB
Internal IP
Other peered VNets
VNet B
VNet peering
On-premises
infrastructure
Enterprise
system
Azure Express Route
Other Service Types
• ClusterIP
• Exposes the service on a cluster-internal IP. Choosing this value makes the
service only reachable from within the cluster
• NodePort
• Exposes the service on each Node’s IP at a static port (the NodePort)
• Connect from outside the cluster by requesting <NodeIP>:<NodePort>
Kubernetes manifest: Service
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
selector:
app: MyApp
type: ClusterIP
ports:
- protocol: TCP
port: 80
targetPort: 9376
Backend Pod 1
labels: app=MyApp
port: 9376
Backend Pod 2
labels: app=MyApp
port: 9376
Backend Pod 3
labels: app=MyApp
port: 9376
ClusterIP
w.x.y.z:80
Note! Services using ClusterIP are only
reachable from within the cluster.
Docker kubernetes fundamental(pod_service)_190307

More Related Content

What's hot

Building a multi-tenant cloud service from legacy code with Docker containers
Building a multi-tenant cloud service from legacy code with Docker containersBuilding a multi-tenant cloud service from legacy code with Docker containers
Building a multi-tenant cloud service from legacy code with Docker containers
aslomibm
 
User authentication and authorizarion in Kubernetes
User authentication and authorizarion in KubernetesUser authentication and authorizarion in Kubernetes
User authentication and authorizarion in Kubernetes
Neependra Khare
 
Kubernetes and Istio
Kubernetes and IstioKubernetes and Istio
Kubernetes and Istio
Ketan Gote
 
Containerized Storage for Containers
Containerized Storage for ContainersContainerized Storage for Containers
Containerized Storage for Containers
Murat Karslioglu
 
What’s New in NGINX Ingress Controller for Kubernetes Release 1.5.0
What’s New in NGINX Ingress Controller for Kubernetes Release 1.5.0What’s New in NGINX Ingress Controller for Kubernetes Release 1.5.0
What’s New in NGINX Ingress Controller for Kubernetes Release 1.5.0
NGINX, Inc.
 
What’s New in NGINX Plus R15? - EMEA
What’s New in NGINX Plus R15? - EMEAWhat’s New in NGINX Plus R15? - EMEA
What’s New in NGINX Plus R15? - EMEA
NGINX, Inc.
 
Writing a Plugin for Apache CloudStack
Writing a Plugin for Apache CloudStackWriting a Plugin for Apache CloudStack
Writing a Plugin for Apache CloudStack
buildacloud
 
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
Orchestration tool roundup   kubernetes vs. docker vs. heat vs. terra form vs...Orchestration tool roundup   kubernetes vs. docker vs. heat vs. terra form vs...
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
Nati Shalom
 
Blockchain, 
Hyperledger fabric & Hyperledger cello
Blockchain, 
Hyperledger fabric & Hyperledger celloBlockchain, 
Hyperledger fabric & Hyperledger cello
Blockchain, 
Hyperledger fabric & Hyperledger cello
Sahdev Zala
 
Openstack 101
Openstack 101Openstack 101
Openstack 101
POSSCON
 
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-2
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-22012 CloudStack Design Camp in Taiwan--- CloudStack Overview-2
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-2
tcloudcomputing-tw
 
From Code to Customer with F5 and NGNX London Nov 19
From Code to Customer with F5 and NGNX London Nov 19From Code to Customer with F5 and NGNX London Nov 19
From Code to Customer with F5 and NGNX London Nov 19
NGINX, Inc.
 
Cloud for Kubernetes : Session3
Cloud for Kubernetes : Session3Cloud for Kubernetes : Session3
Cloud for Kubernetes : Session3
WhaTap Labs
 
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-1
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-12012 CloudStack Design Camp in Taiwan--- CloudStack Overview-1
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-1
tcloudcomputing-tw
 
Azure Signalr Service
Azure Signalr ServiceAzure Signalr Service
Azure Signalr Service
Andrea Tosato
 
Introduction to CloudStack: How to Deploy and Manage Infrastructure-as-a-Serv...
Introduction to CloudStack: How to Deploy and Manage Infrastructure-as-a-Serv...Introduction to CloudStack: How to Deploy and Manage Infrastructure-as-a-Serv...
Introduction to CloudStack: How to Deploy and Manage Infrastructure-as-a-Serv...
CloudStack - Open Source Cloud Computing Project
 
Tech Talk by Gal Sagie: Kuryr - Connecting containers networking to OpenStack...
Tech Talk by Gal Sagie: Kuryr - Connecting containers networking to OpenStack...Tech Talk by Gal Sagie: Kuryr - Connecting containers networking to OpenStack...
Tech Talk by Gal Sagie: Kuryr - Connecting containers networking to OpenStack...
nvirters
 
Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan
Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan
Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan
VMware Tanzu
 
[OpenStack Days 2016] Track4 - OpenNSL으로 브로드콜 기반 네트,워크 스위치 제어하기
[OpenStack Days 2016] Track4 - OpenNSL으로 브로드콜 기반 네트,워크 스위치 제어하기[OpenStack Days 2016] Track4 - OpenNSL으로 브로드콜 기반 네트,워크 스위치 제어하기
[OpenStack Days 2016] Track4 - OpenNSL으로 브로드콜 기반 네트,워크 스위치 제어하기
OpenStack Korea Community
 

What's hot (20)

Building a multi-tenant cloud service from legacy code with Docker containers
Building a multi-tenant cloud service from legacy code with Docker containersBuilding a multi-tenant cloud service from legacy code with Docker containers
Building a multi-tenant cloud service from legacy code with Docker containers
 
User authentication and authorizarion in Kubernetes
User authentication and authorizarion in KubernetesUser authentication and authorizarion in Kubernetes
User authentication and authorizarion in Kubernetes
 
Kubernetes and Istio
Kubernetes and IstioKubernetes and Istio
Kubernetes and Istio
 
Containerized Storage for Containers
Containerized Storage for ContainersContainerized Storage for Containers
Containerized Storage for Containers
 
What’s New in NGINX Ingress Controller for Kubernetes Release 1.5.0
What’s New in NGINX Ingress Controller for Kubernetes Release 1.5.0What’s New in NGINX Ingress Controller for Kubernetes Release 1.5.0
What’s New in NGINX Ingress Controller for Kubernetes Release 1.5.0
 
OpenStack Cinder
OpenStack CinderOpenStack Cinder
OpenStack Cinder
 
What’s New in NGINX Plus R15? - EMEA
What’s New in NGINX Plus R15? - EMEAWhat’s New in NGINX Plus R15? - EMEA
What’s New in NGINX Plus R15? - EMEA
 
Writing a Plugin for Apache CloudStack
Writing a Plugin for Apache CloudStackWriting a Plugin for Apache CloudStack
Writing a Plugin for Apache CloudStack
 
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
Orchestration tool roundup   kubernetes vs. docker vs. heat vs. terra form vs...Orchestration tool roundup   kubernetes vs. docker vs. heat vs. terra form vs...
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
 
Blockchain, 
Hyperledger fabric & Hyperledger cello
Blockchain, 
Hyperledger fabric & Hyperledger celloBlockchain, 
Hyperledger fabric & Hyperledger cello
Blockchain, 
Hyperledger fabric & Hyperledger cello
 
Openstack 101
Openstack 101Openstack 101
Openstack 101
 
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-2
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-22012 CloudStack Design Camp in Taiwan--- CloudStack Overview-2
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-2
 
From Code to Customer with F5 and NGNX London Nov 19
From Code to Customer with F5 and NGNX London Nov 19From Code to Customer with F5 and NGNX London Nov 19
From Code to Customer with F5 and NGNX London Nov 19
 
Cloud for Kubernetes : Session3
Cloud for Kubernetes : Session3Cloud for Kubernetes : Session3
Cloud for Kubernetes : Session3
 
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-1
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-12012 CloudStack Design Camp in Taiwan--- CloudStack Overview-1
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-1
 
Azure Signalr Service
Azure Signalr ServiceAzure Signalr Service
Azure Signalr Service
 
Introduction to CloudStack: How to Deploy and Manage Infrastructure-as-a-Serv...
Introduction to CloudStack: How to Deploy and Manage Infrastructure-as-a-Serv...Introduction to CloudStack: How to Deploy and Manage Infrastructure-as-a-Serv...
Introduction to CloudStack: How to Deploy and Manage Infrastructure-as-a-Serv...
 
Tech Talk by Gal Sagie: Kuryr - Connecting containers networking to OpenStack...
Tech Talk by Gal Sagie: Kuryr - Connecting containers networking to OpenStack...Tech Talk by Gal Sagie: Kuryr - Connecting containers networking to OpenStack...
Tech Talk by Gal Sagie: Kuryr - Connecting containers networking to OpenStack...
 
Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan
Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan
Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan
 
[OpenStack Days 2016] Track4 - OpenNSL으로 브로드콜 기반 네트,워크 스위치 제어하기
[OpenStack Days 2016] Track4 - OpenNSL으로 브로드콜 기반 네트,워크 스위치 제어하기[OpenStack Days 2016] Track4 - OpenNSL으로 브로드콜 기반 네트,워크 스위치 제어하기
[OpenStack Days 2016] Track4 - OpenNSL으로 브로드콜 기반 네트,워크 스위치 제어하기
 

Similar to Docker kubernetes fundamental(pod_service)_190307

Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 RaleighKube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Brad Topol
 
[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...
[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...
[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...
DevDay.org
 
An Introduction to Kubernetes and Continuous Delivery Fundamentals
An Introduction to Kubernetes and Continuous Delivery FundamentalsAn Introduction to Kubernetes and Continuous Delivery Fundamentals
An Introduction to Kubernetes and Continuous Delivery Fundamentals
All Things Open
 
Get you Java application ready for Kubernetes !
Get you Java application ready for Kubernetes !Get you Java application ready for Kubernetes !
Get you Java application ready for Kubernetes !
Anthony Dahanne
 
Adf with docker
Adf with dockerAdf with docker
Adf with docker
Eugene Fedorenko
 
DevJam 2019 - Introduction to Kubernetes
DevJam 2019 - Introduction to KubernetesDevJam 2019 - Introduction to Kubernetes
DevJam 2019 - Introduction to Kubernetes
Ronny Trommer
 
Kubernetes Intro @HaufeDev
Kubernetes Intro @HaufeDev Kubernetes Intro @HaufeDev
Kubernetes Intro @HaufeDev
Haufe-Lexware GmbH & Co KG
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
Martin Danielsson
 
Kubernetes workshop -_the_basics
Kubernetes workshop -_the_basicsKubernetes workshop -_the_basics
Kubernetes workshop -_the_basics
Sjuul Janssen
 
Microservices with containers in the cloud
Microservices with containers in the cloudMicroservices with containers in the cloud
Microservices with containers in the cloud
Eugene Fedorenko
 
The App Developer's Kubernetes Toolbox
The App Developer's Kubernetes ToolboxThe App Developer's Kubernetes Toolbox
The App Developer's Kubernetes Toolbox
Nebulaworks
 
Best Practices for Running Kafka on Docker Containers
Best Practices for Running Kafka on Docker ContainersBest Practices for Running Kafka on Docker Containers
Best Practices for Running Kafka on Docker Containers
BlueData, Inc.
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
VMUG IT
 
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
Building Cloud-Native Applications with Kubernetes, Helm and KubelessBuilding Cloud-Native Applications with Kubernetes, Helm and Kubeless
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
Bitnami
 
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibility
Docker, Inc.
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
Eric Gustafson
 
OpenShift Enterprise 3.1 vs kubernetes
OpenShift Enterprise 3.1 vs kubernetesOpenShift Enterprise 3.1 vs kubernetes
OpenShift Enterprise 3.1 vs kubernetes
Samuel Terburg
 
Pro2516 10 things about oracle and k8s.pptx-final
Pro2516   10 things about oracle and k8s.pptx-finalPro2516   10 things about oracle and k8s.pptx-final
Pro2516 10 things about oracle and k8s.pptx-final
Michel Schildmeijer
 
Containers, Serverless and Functions in a nutshell
Containers, Serverless and Functions in a nutshellContainers, Serverless and Functions in a nutshell
Containers, Serverless and Functions in a nutshell
Eugene Fedorenko
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
Araf Karsh Hamid
 

Similar to Docker kubernetes fundamental(pod_service)_190307 (20)

Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 RaleighKube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
 
[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...
[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...
[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...
 
An Introduction to Kubernetes and Continuous Delivery Fundamentals
An Introduction to Kubernetes and Continuous Delivery FundamentalsAn Introduction to Kubernetes and Continuous Delivery Fundamentals
An Introduction to Kubernetes and Continuous Delivery Fundamentals
 
Get you Java application ready for Kubernetes !
Get you Java application ready for Kubernetes !Get you Java application ready for Kubernetes !
Get you Java application ready for Kubernetes !
 
Adf with docker
Adf with dockerAdf with docker
Adf with docker
 
DevJam 2019 - Introduction to Kubernetes
DevJam 2019 - Introduction to KubernetesDevJam 2019 - Introduction to Kubernetes
DevJam 2019 - Introduction to Kubernetes
 
Kubernetes Intro @HaufeDev
Kubernetes Intro @HaufeDev Kubernetes Intro @HaufeDev
Kubernetes Intro @HaufeDev
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Kubernetes workshop -_the_basics
Kubernetes workshop -_the_basicsKubernetes workshop -_the_basics
Kubernetes workshop -_the_basics
 
Microservices with containers in the cloud
Microservices with containers in the cloudMicroservices with containers in the cloud
Microservices with containers in the cloud
 
The App Developer's Kubernetes Toolbox
The App Developer's Kubernetes ToolboxThe App Developer's Kubernetes Toolbox
The App Developer's Kubernetes Toolbox
 
Best Practices for Running Kafka on Docker Containers
Best Practices for Running Kafka on Docker ContainersBest Practices for Running Kafka on Docker Containers
Best Practices for Running Kafka on Docker Containers
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
 
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
Building Cloud-Native Applications with Kubernetes, Helm and KubelessBuilding Cloud-Native Applications with Kubernetes, Helm and Kubeless
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
 
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibility
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
OpenShift Enterprise 3.1 vs kubernetes
OpenShift Enterprise 3.1 vs kubernetesOpenShift Enterprise 3.1 vs kubernetes
OpenShift Enterprise 3.1 vs kubernetes
 
Pro2516 10 things about oracle and k8s.pptx-final
Pro2516   10 things about oracle and k8s.pptx-finalPro2516   10 things about oracle and k8s.pptx-final
Pro2516 10 things about oracle and k8s.pptx-final
 
Containers, Serverless and Functions in a nutshell
Containers, Serverless and Functions in a nutshellContainers, Serverless and Functions in a nutshell
Containers, Serverless and Functions in a nutshell
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 

Recently uploaded

Top Challenges Faced by High-Risk Merchants and How to Overcome Them.pptx
Top Challenges Faced by High-Risk Merchants and How to Overcome Them.pptxTop Challenges Faced by High-Risk Merchants and How to Overcome Them.pptx
Top Challenges Faced by High-Risk Merchants and How to Overcome Them.pptx
Merchantech - Payment Processing Services
 
Keyword Density Evolution: Elevating SEO Excellence, Leading as Top SEO Agenc...
Keyword Density Evolution: Elevating SEO Excellence, Leading as Top SEO Agenc...Keyword Density Evolution: Elevating SEO Excellence, Leading as Top SEO Agenc...
Keyword Density Evolution: Elevating SEO Excellence, Leading as Top SEO Agenc...
Barrownz.in
 
Bridging the Language Gap The Power of Simultaneous Interpretation in Rwanda
Bridging the Language Gap The Power of Simultaneous Interpretation in RwandaBridging the Language Gap The Power of Simultaneous Interpretation in Rwanda
Bridging the Language Gap The Power of Simultaneous Interpretation in Rwanda
Kasuku Translation Ltd
 
Copy Trading Forex Brokers 2024 ptx
Copy Trading Forex Brokers 2024      ptxCopy Trading Forex Brokers 2024      ptx
Copy Trading Forex Brokers 2024 ptx
Brokerreviewfx
 
Discover How Long Do Aluminum Gutters Last?
Discover How Long Do Aluminum Gutters Last?Discover How Long Do Aluminum Gutters Last?
Discover How Long Do Aluminum Gutters Last?
SteveRiddle8
 
The Best Premium IPTV Service Frane.docx
The Best Premium IPTV Service Frane.docxThe Best Premium IPTV Service Frane.docx
The Best Premium IPTV Service Frane.docx
Industry Foods UK
 
DOJO Training Center - Empowering Workforce Excellence
DOJO Training Center - Empowering Workforce ExcellenceDOJO Training Center - Empowering Workforce Excellence
DOJO Training Center - Empowering Workforce Excellence
Himanshu
 
Spanish Marriage Certificate Attestation in Dubai
Spanish Marriage Certificate Attestation in DubaiSpanish Marriage Certificate Attestation in Dubai
Spanish Marriage Certificate Attestation in Dubai
Attestation On Time
 
Satrya Jaya Mulia - Company Profile - 2024 - CS PROJECT.pptx
Satrya Jaya Mulia - Company Profile - 2024 - CS PROJECT.pptxSatrya Jaya Mulia - Company Profile - 2024 - CS PROJECT.pptx
Satrya Jaya Mulia - Company Profile - 2024 - CS PROJECT.pptx
RichoRamadhan2
 
Emmanuel Katto Uganda - A Philanthropist
Emmanuel Katto Uganda - A PhilanthropistEmmanuel Katto Uganda - A Philanthropist
Emmanuel Katto Uganda - A Philanthropist
Marina Costa
 
Comprehensive Water Damage Restoration Services
Comprehensive Water Damage Restoration ServicesComprehensive Water Damage Restoration Services
Comprehensive Water Damage Restoration Services
kleenupdisaster
 
Sustainable Solutions for Chemical Waste Disposal by Summerland Environmental...
Sustainable Solutions for Chemical Waste Disposal by Summerland Environmental...Sustainable Solutions for Chemical Waste Disposal by Summerland Environmental...
Sustainable Solutions for Chemical Waste Disposal by Summerland Environmental...
Summerland Environmental
 
Greeting powerpoint slide for kids( 4-6 years old)
Greeting powerpoint slide for kids( 4-6 years old)Greeting powerpoint slide for kids( 4-6 years old)
Greeting powerpoint slide for kids( 4-6 years old)
lenguyenthaotrang663
 
SEO For Interior Designers In Delhi.pdf
SEO For Interior  Designers In Delhi.pdfSEO For Interior  Designers In Delhi.pdf
SEO For Interior Designers In Delhi.pdf
SEOServicesinDelhi
 
Best steel industrial company LLC in UAE
Best steel industrial company LLC in UAEBest steel industrial company LLC in UAE
Best steel industrial company LLC in UAE
alafnanmetals
 
All Trophies at Trophy-World Malaysia | Custom Trophies & Plaques Supplier
All Trophies at Trophy-World Malaysia | Custom Trophies & Plaques SupplierAll Trophies at Trophy-World Malaysia | Custom Trophies & Plaques Supplier
All Trophies at Trophy-World Malaysia | Custom Trophies & Plaques Supplier
Trophy-World Malaysia Your #1 Rated Trophy Supplier
 
WORK PERMIT IN NORWAY | WORK VISA SERVICE
WORK  PERMIT  IN  NORWAY | WORK VISA SERVICEWORK  PERMIT  IN  NORWAY | WORK VISA SERVICE
WORK PERMIT IN NORWAY | WORK VISA SERVICE
RKIMT
 
Siddhivinayak temple timings Houston, TX
Siddhivinayak temple timings Houston, TXSiddhivinayak temple timings Houston, TX
Siddhivinayak temple timings Houston, TX
gaurisiddhivinayakte
 
eBrand Promotion Full Service Digital Agency Company Profile
eBrand Promotion Full Service Digital Agency Company ProfileeBrand Promotion Full Service Digital Agency Company Profile
eBrand Promotion Full Service Digital Agency Company Profile
ChimaOrjiOkpi
 
Office Business Furnishings | Office Equipment
Office Business Furnishings |  Office EquipmentOffice Business Furnishings |  Office Equipment
Office Business Furnishings | Office Equipment
OFWD
 

Recently uploaded (20)

Top Challenges Faced by High-Risk Merchants and How to Overcome Them.pptx
Top Challenges Faced by High-Risk Merchants and How to Overcome Them.pptxTop Challenges Faced by High-Risk Merchants and How to Overcome Them.pptx
Top Challenges Faced by High-Risk Merchants and How to Overcome Them.pptx
 
Keyword Density Evolution: Elevating SEO Excellence, Leading as Top SEO Agenc...
Keyword Density Evolution: Elevating SEO Excellence, Leading as Top SEO Agenc...Keyword Density Evolution: Elevating SEO Excellence, Leading as Top SEO Agenc...
Keyword Density Evolution: Elevating SEO Excellence, Leading as Top SEO Agenc...
 
Bridging the Language Gap The Power of Simultaneous Interpretation in Rwanda
Bridging the Language Gap The Power of Simultaneous Interpretation in RwandaBridging the Language Gap The Power of Simultaneous Interpretation in Rwanda
Bridging the Language Gap The Power of Simultaneous Interpretation in Rwanda
 
Copy Trading Forex Brokers 2024 ptx
Copy Trading Forex Brokers 2024      ptxCopy Trading Forex Brokers 2024      ptx
Copy Trading Forex Brokers 2024 ptx
 
Discover How Long Do Aluminum Gutters Last?
Discover How Long Do Aluminum Gutters Last?Discover How Long Do Aluminum Gutters Last?
Discover How Long Do Aluminum Gutters Last?
 
The Best Premium IPTV Service Frane.docx
The Best Premium IPTV Service Frane.docxThe Best Premium IPTV Service Frane.docx
The Best Premium IPTV Service Frane.docx
 
DOJO Training Center - Empowering Workforce Excellence
DOJO Training Center - Empowering Workforce ExcellenceDOJO Training Center - Empowering Workforce Excellence
DOJO Training Center - Empowering Workforce Excellence
 
Spanish Marriage Certificate Attestation in Dubai
Spanish Marriage Certificate Attestation in DubaiSpanish Marriage Certificate Attestation in Dubai
Spanish Marriage Certificate Attestation in Dubai
 
Satrya Jaya Mulia - Company Profile - 2024 - CS PROJECT.pptx
Satrya Jaya Mulia - Company Profile - 2024 - CS PROJECT.pptxSatrya Jaya Mulia - Company Profile - 2024 - CS PROJECT.pptx
Satrya Jaya Mulia - Company Profile - 2024 - CS PROJECT.pptx
 
Emmanuel Katto Uganda - A Philanthropist
Emmanuel Katto Uganda - A PhilanthropistEmmanuel Katto Uganda - A Philanthropist
Emmanuel Katto Uganda - A Philanthropist
 
Comprehensive Water Damage Restoration Services
Comprehensive Water Damage Restoration ServicesComprehensive Water Damage Restoration Services
Comprehensive Water Damage Restoration Services
 
Sustainable Solutions for Chemical Waste Disposal by Summerland Environmental...
Sustainable Solutions for Chemical Waste Disposal by Summerland Environmental...Sustainable Solutions for Chemical Waste Disposal by Summerland Environmental...
Sustainable Solutions for Chemical Waste Disposal by Summerland Environmental...
 
Greeting powerpoint slide for kids( 4-6 years old)
Greeting powerpoint slide for kids( 4-6 years old)Greeting powerpoint slide for kids( 4-6 years old)
Greeting powerpoint slide for kids( 4-6 years old)
 
SEO For Interior Designers In Delhi.pdf
SEO For Interior  Designers In Delhi.pdfSEO For Interior  Designers In Delhi.pdf
SEO For Interior Designers In Delhi.pdf
 
Best steel industrial company LLC in UAE
Best steel industrial company LLC in UAEBest steel industrial company LLC in UAE
Best steel industrial company LLC in UAE
 
All Trophies at Trophy-World Malaysia | Custom Trophies & Plaques Supplier
All Trophies at Trophy-World Malaysia | Custom Trophies & Plaques SupplierAll Trophies at Trophy-World Malaysia | Custom Trophies & Plaques Supplier
All Trophies at Trophy-World Malaysia | Custom Trophies & Plaques Supplier
 
WORK PERMIT IN NORWAY | WORK VISA SERVICE
WORK  PERMIT  IN  NORWAY | WORK VISA SERVICEWORK  PERMIT  IN  NORWAY | WORK VISA SERVICE
WORK PERMIT IN NORWAY | WORK VISA SERVICE
 
Siddhivinayak temple timings Houston, TX
Siddhivinayak temple timings Houston, TXSiddhivinayak temple timings Houston, TX
Siddhivinayak temple timings Houston, TX
 
eBrand Promotion Full Service Digital Agency Company Profile
eBrand Promotion Full Service Digital Agency Company ProfileeBrand Promotion Full Service Digital Agency Company Profile
eBrand Promotion Full Service Digital Agency Company Profile
 
Office Business Furnishings | Office Equipment
Office Business Furnishings |  Office EquipmentOffice Business Furnishings |  Office Equipment
Office Business Furnishings | Office Equipment
 

Docker kubernetes fundamental(pod_service)_190307

  • 1.
  • 2. Lack of agility • 새로운 서비스에 대한 개발 시간 • 운영시간이 Budget과 연결 • Innovation is happening outside IT inside business areas Aging infrastructure • 데이터 센터의 Hardware, Operating systems, Business applications 의 노후화에 따른 영향 • 운영 비용, 효율성 및 안정성 • 자본 지출, 요구 사항 • 보안감사 및 규정 준수 High Cost • Longer release cycles, monolithic and highly coupled architecture • Highly IT dependent • Low application performance and time-to- market compromise business agility
  • 3. From traditional app to modern app APP Containerize Applications Re-architect apps for scale with containers. Containers Container Platform Existing Application On-Premises Infrastructure Platform PaaS Application Platform Modern Microservices Add new services or start peeling off services from monolithic code. Serverless Modern Infrastructure rehost as VMs or refresh to modern container platform. IaaS Infrastructure Platform “lift & shift”
  • 4.
  • 6.
  • 7.
  • 8.
  • 9. • VM보다 가벼운 형식으로 애플리케이션을 pack, ship, run • 컨테이너는 프로세스 격리를 기반으로 하는 애플리케이션 전달 메커니즘 • Linux Kernel 기술 사용 : cgroups, namespaces + overlay fs + tooling • 컨테이너 이미지를 사용하면 응용 프로그램 코드, 런타임 및 모든 Dependency들을 Pre- Defined Format으로 제한 가능 • Container 는 새로운 것이 아닙니다 - 리눅스 LXC, Solaris Zones, BSD Jails 처럼 기존에 있던 개념!!! ✓ Docker 는 기존의 있는 것을 사용하여 빌드하고 관리할 오픈소스 소프트웨어를 만들었음
  • 10.
  • 11. Virtual Machines Each VM has independent, full OS Full isolation Separate app frameworks Support features such as live migration Slow to boot Containers Shared Host OS Near instant start-up Processes in containers are isolated Dependent app services and libraries are tied to container (layers) Every container has an isolated view and gets it ’s own file system, it ’s own PID0 and eth0 network interface Virtual Machine Container Containers vs. VM’s
  • 12. The container advantage Fast iteration Agile delivery Immutability Cost savings Elastic bursting Efficient deployment For ITFor developers
  • 13. 2013년 3월 PyCon Conference – Docker (Solomon Hykes) 컨테이너 기반의 오픈소스 가상화 플랫폼 Docker - Build, Ship, and Run Any App, Anywhere
  • 14.
  • 15.
  • 16.
  • 17.
  • 18. $ docker search ubuntu $ docker pull ubuntu:latest $ docker images $ docker run – i – t --name hello ubuntu /bin/bash $ docker ps – a $ docker stop ubuntu $ docker # remove container $ docker # remove image
  • 19. $ docker build -t helloworld:0.1 . $ docker run -d -p 80:80 nginx $ curl ifconfig.co $ curl <IP-Address> $ docker build -t dazdaz/gallery3 . Creating Containers - Dockerfile Example of a Dockerfile FROM nginx:alpine LABEL author=“Inhye Park" COPY ./dist /usr/share/nginx/html EXPOSE 80 443 ENTRYPOINT ["nginx", "-g", "daemon off"] Create the Dockerfile and run : Creating Containers - Dockerfile
  • 20. Docker Volumes • When the container dies, the data is destroyed, containers are ephemeral • Docker Volume 은 Data 를 Persistent하게 유지하기 위해 Docker Container에서 사용 됨 $ docker create volume myvol1 $ docker volume ls $ docker volume inspect myvol1 $ docker run -d --name devtest --mount source=myvol1,target=/app nginx:latest
  • 21. Docker Compose • Compose 는 multi-container docker를 구동시키고 Define 하기 위한 Tool • Compose 는 Docker compose 파일을 사용하여 애플리케이션 서비스를 구동시킬 수 있음 $ cd project-directory $ docker-compose up -d $ docker-compose ps $ docker-compose logs wordpress $ az vm open-port -g u1804-rg -n u1804 --port 8000 --priority 1001 $ curl ifconfig.co $ docker-compose down --volumes
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27. Container Management at Scale Load Balancing: evenly distribute traffic Lifecycle and Health: keep containers running despite failure Cluster Management: deploy and manage cluster resources Scheduling: where containers run Naming and Discovery: where are my containers Logging and Monitoring: track what’s happening in containers and cluster Image repository: centralized, secure Docker container images Storage volumes: persistent data for containers Scaling: make sets of containers elastic in number Continuous Delivery: CI/CD pipeline and workflow At the end of the day we need something to help us with all the orchestration.. An orchestrator!
  • 28.
  • 30.
  • 31. What is Kubernetes(k8s)? • Kubernetes is "an open-source software for automating deployment, scaling, and management of containerized applications“. • Kubernetes, in Greek κυβερνήτης, means the Helmsman, or pilot of the ship. • Keeping with the maritime theme of Docker containers, Kubernetes is the pilot of a ship of containers. History • Google open sourced Borg. Google still actively involved • Kubernetes v1.0 was released on July 21, 2015 by Joe Beda, Brendan Burns and Craig McLuckie • Most discussed repo in Github last year. Over 1,700 authors; releases every three month • To learn more about the ideas behind Kubernetes: read the Large-scale cluster management at Google with Borg paper
  • 32. Kubernetes Features • Self-Healing 자동으로 문제가 발생한 노드의 컨테이너를 대체(룰/정책에 따른 헬스 체크) • Horizontal Scaling CPU 와 메모리와 같은 리소스 사용에 따라 자동으로 어플리케이션을 확장 경우에 따라서, 사용자 정의 측정 값을 기준으로 한 동적인 확장 가능 • Service Discovery and Load Balancing Container에 고유한 IP를 부여 여러 개의 Container를 묶어 단일 Service로 부여하는 경우 단일 DNS Name으로 접근하도록 로드 밸런스를 제공 • Automatic bin packing 가용성에 대한 희생 없이, 리소스 사용과 제약 사항을 기준으로 자동으로 컨테이너를 스케줄링
  • 33. Kubernetes Features • Automated rollouts and rollbacks 다운타임없이 애플리케이션의 새로운 버전 및 설정에 대한 롤아웃/롤백 가능 • Storage orchestration 소프트웨어 정의 저장장치를 기반으로 로컬, 외부 및 저장소 솔루션 등을 동일한 방법으로 컨테이너에 마운트 할 수 있음 • Secret and configuration management 애플리케이션의 secret과 configuration 정보를 이미지와 독립적으로 구분하여 별도의 이미지 재생산 없이 관리 • Batch execution CI 워크로드와 같은 Batch 성 작업 지원 Crontab 형식으로 스케줄링도 가능
  • 35. Kubernetes Architecture kubectl API server controller-manager (replication, namespace, serviceaccounts,…) scheduler etcd Internet Master node kubelet Pod Pod docker Worker node kubelet Kube-proxy Pod Pod docker Worker node Kube-proxy
  • 36. Master Components • Kube-api-server • Front-end control plane. Exposes API • controller-manager • Runs controllers, e.g. replication controller, node controller • scheduler • assigns pods to nodes • etcd • Highly available, distributed Cluster database. • add-ons • DNS, Heapster (enables monitoring and performance analysis), Dashboard, Logging
  • 37. Worker Node Components • Kubelet • Primary node agent • Watches and runs assigned pods • Executes health probes and reports status • Kube-proxy • Enables network services • Container Runtime • Docker, rkt(deprecated) ..
  • 38. kubectl • CLI to run commands against a Kubernetes cluster • Swiss Army Knife: run deployments, exec into containers, view logs, etc. • Pronounced “koob sea tee el” or “koob cuddle” • Available for Windows and Linux – of course available in Azure Cloud Shell
  • 39. Declarative vs Imperative • Commands like kubectl run and kubectl expose are imperative commands (do this thing now) • Declarative way – Describe the state of resources in a file(JSON or YAML). Kubectl apply –f webresource.yaml
  • 40.
  • 42. What is a pod? • Kubernetes 에서 최소 논리 단위 • 하나의 애플리케이션을 표현하는 최소 논리 단위 • Worker 노드에서 실행하는 Container의 집합 • 하나의 Pod내에서는 1…N개의 Container를 가질 수 있음 • 주로 Tightly Coupled 되는 Container들을 하나의 Pod에 묶음 예: NginX + Tomcat 예: Tomcat + Memcached • Pod에 있는 Container 는 물리적으로 같은 서버에 생성됨 • 하나의 Pod내에서는 PID Namespace , network 와 호스트를 공유함 Content Manager Consumers File Puller Web Server Volume Pod
  • 43. Kubernetes manifest: Pod apiVersion: v1 kind: Pod metadata: name: redis-django labels: app: web spec: containers: - name: key-value-store image: redis ports: - containerPort: 6379 - name: frontend image: django ports: - containerPort: 8000 pod name: redis-django Container key-value-store Port 6379 Image: redis- django Container frontend Port 8000 Image: django
  • 44. Interact with pods $ kubectl get pod --all-namespaces $ kubectl describe pod/my-pod $ kubectl logs my-pod # Run bash in container $ kubectl exec -it my-pod bash
  • 45. Kubernetes Services • Defines a logical set of pods • Identified/selected using Labels • Essentially a virtual load balancer in front of pods Client Kube-proxy apiserver Backend Pod 1 labels: app=My App port: 9376 Backend Pod 2 labels: app=My App port: 9376 Backend Pod 3 labels: app=My App port: 9376 ServiceIP (iptables) Node
  • 46. • Service Type LoadBalancer • Basic Layer4 Load Balancing (TCP/UDP) • Each service has assigned an IP on the ALB apiVersion: v1 kind: Service metadata: name: frontendservice spec: loadBalancerIP: X.X.X.X type: LoadBalancer ports: - port: 80 selector: app: frontend Azure AKS VNet AKS subnet AKS cluster FrontEndService Pod1 label:Frontend Pod2 label:Frontend Pod3 label:Frontend Public LB Public IP
  • 47. • Used for internal services that should be accessed by other VNETs or On- Premise only apiVersion: v1 kind: Service metadata: name: internalservice annotations: service.beta.kubernetes.io/azure-load-balancer-internal: "true" spec: type: LoadBalancer loadBalancerIP: 10.240.0.25 ports: - port: 80 selector: app: internal Azure AKS VNet AKS subnet AKS cluster InternalService Pod1 label:Internal Pod2 label:Internal Pod3 label:Internal Internal LB Internal IP Other peered VNets VNet B VNet peering On-premises infrastructure Enterprise system Azure Express Route
  • 48. Other Service Types • ClusterIP • Exposes the service on a cluster-internal IP. Choosing this value makes the service only reachable from within the cluster • NodePort • Exposes the service on each Node’s IP at a static port (the NodePort) • Connect from outside the cluster by requesting <NodeIP>:<NodePort>
  • 49. Kubernetes manifest: Service apiVersion: v1 kind: Service metadata: name: my-service spec: selector: app: MyApp type: ClusterIP ports: - protocol: TCP port: 80 targetPort: 9376 Backend Pod 1 labels: app=MyApp port: 9376 Backend Pod 2 labels: app=MyApp port: 9376 Backend Pod 3 labels: app=MyApp port: 9376 ClusterIP w.x.y.z:80 Note! Services using ClusterIP are only reachable from within the cluster.