SlideShare a Scribd company logo
Let's Talk Deploying Kubernetes in the
Enterprise
—
Jake Kitchener
IBM
Michael Elder
IBM
Dr. Brad Topol
IBM
Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
IBM’s statementsregarding itsplans, directions, andintent are subject to change or withdrawal without
notice andat IBM’s sole discretion.
Information regarding potential future productsisintended to outline our general product direction andit
should not be reliedon in making a purchasing decision.
The information mentionedregarding potential future productsisnot a commitment, promise, or legal
obligation to deliver any material, code or functionality. Information about potential future productsmaynot
be incorporatedinto any contract.
The development, release, and timing of anyfuture featuresor functionalitydescribedfor our products
remainsat our sole discretion.
Performance isbasedon measurementsandprojectionsusing standard IBM benchmarksin a controlled
environment. The actual throughput or performance that anyuser will experience will vary depending upon
manyfactors, including considerations such as the amount of multiprogramming in the user’sjobstream,
the I/O configuration, the storage configuration, andthe workloadprocessed. Therefore, no assurance can
be given that an individual user will achieve results similar to those statedhere.
2
Please note
Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
3Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Kubernetes Architecture
API
UI
CLI
Kubernetes
Master
Worker Node 1
Worker Node 2
Worker Node 3
Worker Node n
Registry
• Etcd
• API Server
• Controller Manager Server
• Scheduler ServerThink 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
4Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Kubernetes Architecture
API
UI
CLI
Kubernetes
Master
Worker Node 1
Worker Node 2
Worker Node 3
Worker Node n
Registry
• Etcd
• API Server
• Controller Manager
Server
• Scheduler Server
Nodes – hosts that run
Kubernetes applications
Master nodes:
• Controls and manages the cluster
• Kubectl (command line)
• REST API (communication with workers)
• Schedulingand replication logic
Worker nodes:
• Hosts the K8s services
• Kubelet (K8s agent that accepts
commands from the master)
• Kubeproxy (network proxy service
responsible for routingactivities for
inbound or ingress traffic)
• Docker host
5Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Kubernetes Pods
• Collection of application containers and volumes
running in the same execution environment
• Smallest deployable unit in a Kubernetes Cluster
• Applications in the same pod
• Share IP Address and port space
• Share the same hostname
• Can communicate usingnative IPC
• Can share mounted storage
• Applications in different pods
• Have different IP Addresses
• Have different hostnames
• Pods running on the same node might as well be on
different servers
• When designing pods ask, “Will these containers work
correctly if they land on different machines?”
Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Pod
Volumes
Containers
IP
6Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Features Provided by
Kubernetes Pods
• Creating, Listing, Deleting Pods
• Run commands in your pod’s
containers with exec
• Copy files to and from containers in
your pods
• Port forwarding from your local
machine to your pod
• Liveness Probes
• Readiness Probes
• Persistent Volume Storage
Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Create the yaml file specification of your pod
$ vi nginx_pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
Create the nginx pod using kubectl
$ kubectl create -f nginx_pod.yaml
7Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Kubernetes Deployments
• Kubernetes Deployments manage the release of
new versions
• Enable you to easily move from one version of
your code to the next version
• Rollouts easily done without downtime
• Health checks used to ensure new version
is operating correctly
• Runs server side
• Safe to kick off from a plane
• Most Deployments use ReplicaSets to provide
availability and rolling update capabilities
• Pods managed by ReplicaSets are
automatically rescheduled under failure
conditions
Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
$ vi nginxdeployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: “1”
name: nginx
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
Create the nginx deployment
$ kubectl create -f nginxdeployment.yaml
8Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Kubernetes ReplicaSets
• Kubernetes ReplicaSet is a cluster-wide pod
manager that ensures the proper number of pods
are runningat all times.
• Pods managed by ReplicaSets are automatically
rescheduled under failure conditions
• ReplicaSets are defined via a specification
• Contains name, number of pods, and pod
template
• ReplicaSets identify their replicas via a set of Pod
labels
Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Create the yaml file specification of your ReplicaSet
$ vi frontend.yaml
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: frontend
labels:
app: guestbook
tier: frontend
spec:
# this replicas value is default
# modify it according to your case
replicas: 3
selector:
matchLabels:
tier: frontend
matchExpressions:
- {key: tier, operator: In, values: [frontend]}
template:
metadata:
labels:
app: guestbook
tier: frontend
spec:
containers:
- name: php-redis
image: gcr.io/google_samples/gb-frontend:v3
ports:
- containerPort: 80
Create the nginx pod using kubectl
$ kubectl create -f frontend.yaml
Replica Set vN
Replica Set N-1
10Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Kubernetes Service Object
• Kubernetes Service is essentially a load balancer
for a group of replica pods
• Service is assigned a virtual IP called a cluster
IP
• This IP address will load balance across all of
the pods identified by the service’s selector
• Cluster IP Addresses are stable and
appropriate for givingit an IP Address
• Kubernetes provides a DNS service
exposed to Pods running in the cluster
• Readiness checks are built in
• Only ready pods are sent traffic
Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Create an nginx deployment with 3 replicas
$ kubectl run hazelcast --image=nginx
--replicas=3 --labels="app=hazelcast,env=prod,ver=2”
Create a service for an nginx deployment, which
serves on port 80 and connects to the containers
on port 8000.
$ kubectl expose deployment hazelcast –port=80 –target-
port=8000
11Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Scale a Kubernetes
Deployment
• Scaling a Kubernetes Deployment is very
straightforward
• Update the replicas value in your YAML
specification and use kubectl apply
• $ kubectl apply --f nginx
deployment.yaml
Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
$ vi nginxdeployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: “1”
name: nginx
labels:
app: nginx
spec:
replicas: 6
selector:
matchLabels:
app: nginx
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
Update the nginx deployment
$ kubectl apply -f nginxdeployment.yaml
12Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Kubernetes Deployment:
Update a
Container Image
• Scaling a Kubernetes Deployment is very straightforward
• Update the image value in your YAML specification
• Add an annotation describing the change in your YAML
specification
• Update the deployment using kubectl apply
• $ kubectl apply --f nginx deployment.yaml
• Useful deployment commands
• kubectl rollout status deployments nginx
• kubectl rollout pause deployments nginx
• kubectl rollout resume deployments nginx
• kubectl rollout history deployment nginx
Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
$ vi nginxdeployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
kubernetes.io/change-cause: “Update nginx to 1.9.10”
name: nginx
labels:
app: nginx
spec:
replicas: 6
selector:
matchLabels:
app: nginx
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.9.10
ports:
- containerPort: 80
Update the nginx deployment
$ kubectl apply -f nginxdeployment.yaml
13Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Kubernetes Continuous
Delivery Fundamentals
• Small Batch Changes
• All changes should be incremental and finite
• Source Control all the things
• History of all changes to identify regressions in code or configurations
• Developer access to production-like environments
• Shift-left operational practices
• Expose behaviors for health management, log collection, and change
management earlier in the development process
• Continuous integration of changes
• All changes built and deployed together on an ongoing basis
• Highly automated testing/validation with continuous feedback
Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
14Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Kubernetes Networking
• Cluster (aka Pod) Networking
• Services/kube-proxy/Load Balancers
Ingress
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: hello-ingress
spec:
rules:
- host: hello-app.com
http:
paths:
- path: /
backend:
serviceName: hello-svc
servicePort: 80
Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Network Security Policy
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-redis
namespace: teama
spec:
podSelector: {}
policyTypes:
- Egress
egress:
- to:
- ipBlock:
cidr: 10.10.126.48/28
ports:
- protocol: TCP
port: 6379
15Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Kubernetes Storage
• Node Scope
• emptyDir
• hostPath
• local
• Cluster Scope
• PersistentVolume
• PersistentVolumeClaim
• Volume Plugins
Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Persistent Volume Claims
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mypvc
labels:
billingType: "hourly"
region: us-south
zone: dal13
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 24Gi
storageClassName: ibmc-block-silver
16Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Kubernetes User Security
• Authentication
• OIDC Tokens
• ServiceAccount Tokens
• Authorization
• RBAC
• Role
• RoleBinding
• ClusterRole
• ClusterRoleBinding
• Namespaces
• Help to scope access control to a set of
resources in a Kubernetes cluster
Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: viewer
rules:
- apiGroups:
- apps
- extensions
resources:
- deployments
- replicasets
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cicd-viewer
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: viewer
subjects:
- kind: User
name: IAM#cicd@us.ibm.com
apiGroup: rbac.authorization.k8s.io
17Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Kubernetes Auto-Scaling
• Kubernetes schedulingbased on user provided
resources requests
• Critical for proper scheduling and performance
• Autoscaling tools allow for apps to manage their
own capacity and play by scheduling rules
• Horizontal Pod (demo)
• Vertical Pod
• Cluster Proportional
• Addon-resizer
Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
$ kubectl run hello-app --image=kitch/hello-app:1.0 --
requests='cpu=18m,memory=50Mi' --replicas 3
deployment.apps "hello-app" created
$ kubectl expose deploy hello-app --name hello-svc --
port=80 --target-port=8080
service "hello-svc" exposed
$ kubectl autoscale deploy hello-app --min=1 --max=10 -
-cpu-percent=80
deployment.apps "hello-app" autoscaled
$ kubectl run hello-load --image=alpine --command -- sh
-c 'apk update && apk add curl && while true; do curl
hello-svc; done'
deployment.apps "hello-load" created
Thank you
18Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
Jake Kitchener
SeniorTechnicalStaff Member
IBM Cloud Kubernetes Service
@kitch
—
jakek@us.ibm.com
MichaelElder
Distinguished Engineer
IBM Cloud Private
@mdelder
—
mdelder@us.ibm.com
Dr. Brad Topol
Distinguished Engineer
Open Technology & DeveloperAdvocacy
@bradtopol
—
btopol@us.ibm.com
19
®
Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation

More Related Content

PDF
How IBM is helping developers win the race to innovate with next-gen cloud se...
PDF
Learn how to Leverage Kubernetes to Support 12 Factor for Enterprise Apps
PPTX
IBM Multicloud Management on the OpenShift Container Platform
PDF
An architect’s guide to leveraging your incumbency
PPTX
#8311: Transform the Enterprise with IBM Cloud Private
PDF
Portable Apps across IBM Kubernetes Service and IBM Cloud Private (#Think2019...
PDF
Client Deployment of IBM Cloud Private (IBM #Think2019 #5964)
PDF
Continuous Delivery on IBM Bluemix: Manage Cloud Native Services with Cloud N...
How IBM is helping developers win the race to innovate with next-gen cloud se...
Learn how to Leverage Kubernetes to Support 12 Factor for Enterprise Apps
IBM Multicloud Management on the OpenShift Container Platform
An architect’s guide to leveraging your incumbency
#8311: Transform the Enterprise with IBM Cloud Private
Portable Apps across IBM Kubernetes Service and IBM Cloud Private (#Think2019...
Client Deployment of IBM Cloud Private (IBM #Think2019 #5964)
Continuous Delivery on IBM Bluemix: Manage Cloud Native Services with Cloud N...

What's hot (20)

PDF
How do you deliver your applications to the cloud?
PDF
DevOps within the Hybrid Cloud Deploying to the VMware Platform on the IBM Cloud
PPTX
Client Deployment of IBM Cloud Private (Think 2019 Session 5964A)
PDF
Introduction to IBM Cloud Private - April 2018
PDF
Tap into a Private Cloud as a Service to Accelerate Hybrid Success
PDF
IBM Private Cloud Platform - Setting Foundation for Hybrid (JUKE, 2015)
PDF
Creating Microservices Application with IBM Cloud Private (ICP) - introductio...
PDF
IBM Think 2020 Openshift on IBM Z and LinuxONE
PDF
Creating Production-Ready, Secure and Scalable Applications in IBM Cloud Priv...
PDF
Accelerate Digital Transformation with IBM Cloud Private
PDF
Hybrid Cloud: How to Get a Return from an Investment Made Three Decades Ago (...
PDF
Accelerate Digital Transformation with IBM Cloud Private
PDF
IBM Cloud
PDF
Microservices Development - ICP Workshop Batch II
PPTX
Mastering Application Integration Challenges in Hybrid Cloud Environments
PDF
L105704 ibm-cloud-private-z-cairo-v1902a
PDF
D-DAY 2015 Hybrid Cloud IBM
PDF
Elevate Your Continuous Delivery Strategy Above the Rolling Clouds - UrbanCod...
PDF
Creating Microservices Application with IBM Cloud Private (ICP) - Container a...
PDF
IBM Bluemix Dedicated – GitHub Enterprise
How do you deliver your applications to the cloud?
DevOps within the Hybrid Cloud Deploying to the VMware Platform on the IBM Cloud
Client Deployment of IBM Cloud Private (Think 2019 Session 5964A)
Introduction to IBM Cloud Private - April 2018
Tap into a Private Cloud as a Service to Accelerate Hybrid Success
IBM Private Cloud Platform - Setting Foundation for Hybrid (JUKE, 2015)
Creating Microservices Application with IBM Cloud Private (ICP) - introductio...
IBM Think 2020 Openshift on IBM Z and LinuxONE
Creating Production-Ready, Secure and Scalable Applications in IBM Cloud Priv...
Accelerate Digital Transformation with IBM Cloud Private
Hybrid Cloud: How to Get a Return from an Investment Made Three Decades Ago (...
Accelerate Digital Transformation with IBM Cloud Private
IBM Cloud
Microservices Development - ICP Workshop Batch II
Mastering Application Integration Challenges in Hybrid Cloud Environments
L105704 ibm-cloud-private-z-cairo-v1902a
D-DAY 2015 Hybrid Cloud IBM
Elevate Your Continuous Delivery Strategy Above the Rolling Clouds - UrbanCod...
Creating Microservices Application with IBM Cloud Private (ICP) - Container a...
IBM Bluemix Dedicated – GitHub Enterprise
Ad

Similar to Deploying Kubernetes in the Enterprise (IBM #Think2019 #7678 Tech Talk) (20)

PPTX
Kubernetes for the VI Admin
PDF
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
PDF
Containers vs serverless - Navigating application deployment options
PPTX
An Introduction to Kubernetes and Continuous Delivery Fundamentals
PPTX
Edge 2016 Session 1886 Building your own docker container cloud on ibm power...
PDF
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
PPTX
Pivotal Container Service Overview
PPTX
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
PDF
The Kubernetes WebLogic revival (part 2)
PPTX
20191201 kubernetes managed weblogic revival - part 2
PPTX
Kube journey 2017-04-19
PDF
Container security within Cisco Container Platform
PDF
Cloud-Native Application and Kubernetes
PPTX
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
PPTX
The Reality of DIY Kubernetes vs. PKS
PDF
20200113 - IBM Cloud Côte d'Azur - DeepDive Kubernetes
PDF
Continuous Delivery to Kubernetes with Jenkins and Helm
PPTX
Continuous Everything in a Multi-cloud and Multi-platform Environment
PDF
Deploying Flink on Kubernetes - David Anderson
PDF
Kubernetes basics and hands on exercise
Kubernetes for the VI Admin
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
Containers vs serverless - Navigating application deployment options
An Introduction to Kubernetes and Continuous Delivery Fundamentals
Edge 2016 Session 1886 Building your own docker container cloud on ibm power...
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
Pivotal Container Service Overview
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
The Kubernetes WebLogic revival (part 2)
20191201 kubernetes managed weblogic revival - part 2
Kube journey 2017-04-19
Container security within Cisco Container Platform
Cloud-Native Application and Kubernetes
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
The Reality of DIY Kubernetes vs. PKS
20200113 - IBM Cloud Côte d'Azur - DeepDive Kubernetes
Continuous Delivery to Kubernetes with Jenkins and Helm
Continuous Everything in a Multi-cloud and Multi-platform Environment
Deploying Flink on Kubernetes - David Anderson
Kubernetes basics and hands on exercise
Ad

More from Michael Elder (14)

PDF
Introducing github.com/open-cluster-management – How to deliver apps across c...
PDF
CTO Forum - Rethink Technology Agile Keynote
PDF
UrbanCode Deploy DevOps Best Practices
PDF
DevOps for IBM Commerce
PDF
How to Adopt Docker Within Your Enterprise Using IBM UrbanCode Deploy (Interc...
PDF
Elevate Your Continuous Delivery Strategy Above the Rolling Clouds (Interconn...
PDF
Turning up the HEAT with IBM MobileFirst for iOS Apps (Interconnect 2016)
PDF
Turning up the HEAT with IBM MobileFirst for iOS Apps
PDF
Elevating your Continuous Delivery Strategy Above the Rolling Clouds
PDF
How do you deliver your applications to the cloud?
PDF
Continuously Design your Continuous Deployment
PDF
Improving Software Delivery with Software Defined Environments (IBM Interconn...
PDF
Industry Perspective: DevOps - What it Means for the Average Business
PDF
DevOps in Practice: When does "Practice" Become "Doing"?
Introducing github.com/open-cluster-management – How to deliver apps across c...
CTO Forum - Rethink Technology Agile Keynote
UrbanCode Deploy DevOps Best Practices
DevOps for IBM Commerce
How to Adopt Docker Within Your Enterprise Using IBM UrbanCode Deploy (Interc...
Elevate Your Continuous Delivery Strategy Above the Rolling Clouds (Interconn...
Turning up the HEAT with IBM MobileFirst for iOS Apps (Interconnect 2016)
Turning up the HEAT with IBM MobileFirst for iOS Apps
Elevating your Continuous Delivery Strategy Above the Rolling Clouds
How do you deliver your applications to the cloud?
Continuously Design your Continuous Deployment
Improving Software Delivery with Software Defined Environments (IBM Interconn...
Industry Perspective: DevOps - What it Means for the Average Business
DevOps in Practice: When does "Practice" Become "Doing"?

Recently uploaded (20)

PDF
top salesforce developer skills in 2025.pdf
PDF
System and Network Administraation Chapter 3
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
medical staffing services at VALiNTRY
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Introduction to Artificial Intelligence
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
System and Network Administration Chapter 2
top salesforce developer skills in 2025.pdf
System and Network Administraation Chapter 3
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Which alternative to Crystal Reports is best for small or large businesses.pdf
Operating system designcfffgfgggggggvggggggggg
How to Choose the Right IT Partner for Your Business in Malaysia
How Creative Agencies Leverage Project Management Software.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Odoo POS Development Services by CandidRoot Solutions
medical staffing services at VALiNTRY
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
How to Migrate SBCGlobal Email to Yahoo Easily
PTS Company Brochure 2025 (1).pdf.......
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Introduction to Artificial Intelligence
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
System and Network Administration Chapter 2

Deploying Kubernetes in the Enterprise (IBM #Think2019 #7678 Tech Talk)

  • 1. Let's Talk Deploying Kubernetes in the Enterprise — Jake Kitchener IBM Michael Elder IBM Dr. Brad Topol IBM Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
  • 2. IBM’s statementsregarding itsplans, directions, andintent are subject to change or withdrawal without notice andat IBM’s sole discretion. Information regarding potential future productsisintended to outline our general product direction andit should not be reliedon in making a purchasing decision. The information mentionedregarding potential future productsisnot a commitment, promise, or legal obligation to deliver any material, code or functionality. Information about potential future productsmaynot be incorporatedinto any contract. The development, release, and timing of anyfuture featuresor functionalitydescribedfor our products remainsat our sole discretion. Performance isbasedon measurementsandprojectionsusing standard IBM benchmarksin a controlled environment. The actual throughput or performance that anyuser will experience will vary depending upon manyfactors, including considerations such as the amount of multiprogramming in the user’sjobstream, the I/O configuration, the storage configuration, andthe workloadprocessed. Therefore, no assurance can be given that an individual user will achieve results similar to those statedhere. 2 Please note Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
  • 3. 3Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Kubernetes Architecture API UI CLI Kubernetes Master Worker Node 1 Worker Node 2 Worker Node 3 Worker Node n Registry • Etcd • API Server • Controller Manager Server • Scheduler ServerThink 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
  • 4. 4Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Kubernetes Architecture API UI CLI Kubernetes Master Worker Node 1 Worker Node 2 Worker Node 3 Worker Node n Registry • Etcd • API Server • Controller Manager Server • Scheduler Server Nodes – hosts that run Kubernetes applications Master nodes: • Controls and manages the cluster • Kubectl (command line) • REST API (communication with workers) • Schedulingand replication logic Worker nodes: • Hosts the K8s services • Kubelet (K8s agent that accepts commands from the master) • Kubeproxy (network proxy service responsible for routingactivities for inbound or ingress traffic) • Docker host
  • 5. 5Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Kubernetes Pods • Collection of application containers and volumes running in the same execution environment • Smallest deployable unit in a Kubernetes Cluster • Applications in the same pod • Share IP Address and port space • Share the same hostname • Can communicate usingnative IPC • Can share mounted storage • Applications in different pods • Have different IP Addresses • Have different hostnames • Pods running on the same node might as well be on different servers • When designing pods ask, “Will these containers work correctly if they land on different machines?” Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Pod Volumes Containers IP
  • 6. 6Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Features Provided by Kubernetes Pods • Creating, Listing, Deleting Pods • Run commands in your pod’s containers with exec • Copy files to and from containers in your pods • Port forwarding from your local machine to your pod • Liveness Probes • Readiness Probes • Persistent Volume Storage Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Create the yaml file specification of your pod $ vi nginx_pod.yaml apiVersion: v1 kind: Pod metadata: name: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80 Create the nginx pod using kubectl $ kubectl create -f nginx_pod.yaml
  • 7. 7Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Kubernetes Deployments • Kubernetes Deployments manage the release of new versions • Enable you to easily move from one version of your code to the next version • Rollouts easily done without downtime • Health checks used to ensure new version is operating correctly • Runs server side • Safe to kick off from a plane • Most Deployments use ReplicaSets to provide availability and rolling update capabilities • Pods managed by ReplicaSets are automatically rescheduled under failure conditions Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation $ vi nginxdeployment.yaml apiVersion: extensions/v1beta1 kind: Deployment metadata: annotations: deployment.kubernetes.io/revision: “1” name: nginx labels: app: nginx spec: replicas: 3 selector: matchLabels: app: nginx strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 1 type: RollingUpdate template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80 Create the nginx deployment $ kubectl create -f nginxdeployment.yaml
  • 8. 8Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Kubernetes ReplicaSets • Kubernetes ReplicaSet is a cluster-wide pod manager that ensures the proper number of pods are runningat all times. • Pods managed by ReplicaSets are automatically rescheduled under failure conditions • ReplicaSets are defined via a specification • Contains name, number of pods, and pod template • ReplicaSets identify their replicas via a set of Pod labels Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Create the yaml file specification of your ReplicaSet $ vi frontend.yaml apiVersion: apps/v1 kind: ReplicaSet metadata: name: frontend labels: app: guestbook tier: frontend spec: # this replicas value is default # modify it according to your case replicas: 3 selector: matchLabels: tier: frontend matchExpressions: - {key: tier, operator: In, values: [frontend]} template: metadata: labels: app: guestbook tier: frontend spec: containers: - name: php-redis image: gcr.io/google_samples/gb-frontend:v3 ports: - containerPort: 80 Create the nginx pod using kubectl $ kubectl create -f frontend.yaml Replica Set vN Replica Set N-1
  • 9. 10Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Kubernetes Service Object • Kubernetes Service is essentially a load balancer for a group of replica pods • Service is assigned a virtual IP called a cluster IP • This IP address will load balance across all of the pods identified by the service’s selector • Cluster IP Addresses are stable and appropriate for givingit an IP Address • Kubernetes provides a DNS service exposed to Pods running in the cluster • Readiness checks are built in • Only ready pods are sent traffic Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Create an nginx deployment with 3 replicas $ kubectl run hazelcast --image=nginx --replicas=3 --labels="app=hazelcast,env=prod,ver=2” Create a service for an nginx deployment, which serves on port 80 and connects to the containers on port 8000. $ kubectl expose deployment hazelcast –port=80 –target- port=8000
  • 10. 11Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Scale a Kubernetes Deployment • Scaling a Kubernetes Deployment is very straightforward • Update the replicas value in your YAML specification and use kubectl apply • $ kubectl apply --f nginx deployment.yaml Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation $ vi nginxdeployment.yaml apiVersion: extensions/v1beta1 kind: Deployment metadata: annotations: deployment.kubernetes.io/revision: “1” name: nginx labels: app: nginx spec: replicas: 6 selector: matchLabels: app: nginx strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 1 type: RollingUpdate template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80 Update the nginx deployment $ kubectl apply -f nginxdeployment.yaml
  • 11. 12Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Kubernetes Deployment: Update a Container Image • Scaling a Kubernetes Deployment is very straightforward • Update the image value in your YAML specification • Add an annotation describing the change in your YAML specification • Update the deployment using kubectl apply • $ kubectl apply --f nginx deployment.yaml • Useful deployment commands • kubectl rollout status deployments nginx • kubectl rollout pause deployments nginx • kubectl rollout resume deployments nginx • kubectl rollout history deployment nginx Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation $ vi nginxdeployment.yaml apiVersion: extensions/v1beta1 kind: Deployment metadata: annotations: kubernetes.io/change-cause: “Update nginx to 1.9.10” name: nginx labels: app: nginx spec: replicas: 6 selector: matchLabels: app: nginx strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 1 type: RollingUpdate template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.9.10 ports: - containerPort: 80 Update the nginx deployment $ kubectl apply -f nginxdeployment.yaml
  • 12. 13Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Kubernetes Continuous Delivery Fundamentals • Small Batch Changes • All changes should be incremental and finite • Source Control all the things • History of all changes to identify regressions in code or configurations • Developer access to production-like environments • Shift-left operational practices • Expose behaviors for health management, log collection, and change management earlier in the development process • Continuous integration of changes • All changes built and deployed together on an ongoing basis • Highly automated testing/validation with continuous feedback Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation
  • 13. 14Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Kubernetes Networking • Cluster (aka Pod) Networking • Services/kube-proxy/Load Balancers Ingress apiVersion: extensions/v1beta1 kind: Ingress metadata: name: hello-ingress spec: rules: - host: hello-app.com http: paths: - path: / backend: serviceName: hello-svc servicePort: 80 Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Network Security Policy apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: allow-redis namespace: teama spec: podSelector: {} policyTypes: - Egress egress: - to: - ipBlock: cidr: 10.10.126.48/28 ports: - protocol: TCP port: 6379
  • 14. 15Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Kubernetes Storage • Node Scope • emptyDir • hostPath • local • Cluster Scope • PersistentVolume • PersistentVolumeClaim • Volume Plugins Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Persistent Volume Claims apiVersion: v1 kind: PersistentVolumeClaim metadata: name: mypvc labels: billingType: "hourly" region: us-south zone: dal13 spec: accessModes: - ReadWriteOnce resources: requests: storage: 24Gi storageClassName: ibmc-block-silver
  • 15. 16Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Kubernetes User Security • Authentication • OIDC Tokens • ServiceAccount Tokens • Authorization • RBAC • Role • RoleBinding • ClusterRole • ClusterRoleBinding • Namespaces • Help to scope access control to a set of resources in a Kubernetes cluster Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRole metadata: name: viewer rules: - apiGroups: - apps - extensions resources: - deployments - replicasets verbs: - get - list - watch --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: cicd-viewer roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: viewer subjects: - kind: User name: IAM#cicd@us.ibm.com apiGroup: rbac.authorization.k8s.io
  • 16. 17Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Kubernetes Auto-Scaling • Kubernetes schedulingbased on user provided resources requests • Critical for proper scheduling and performance • Autoscaling tools allow for apps to manage their own capacity and play by scheduling rules • Horizontal Pod (demo) • Vertical Pod • Cluster Proportional • Addon-resizer Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation $ kubectl run hello-app --image=kitch/hello-app:1.0 -- requests='cpu=18m,memory=50Mi' --replicas 3 deployment.apps "hello-app" created $ kubectl expose deploy hello-app --name hello-svc -- port=80 --target-port=8080 service "hello-svc" exposed $ kubectl autoscale deploy hello-app --min=1 --max=10 - -cpu-percent=80 deployment.apps "hello-app" autoscaled $ kubectl run hello-load --image=alpine --command -- sh -c 'apk update && apk add curl && while true; do curl hello-svc; done' deployment.apps "hello-load" created
  • 17. Thank you 18Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation Jake Kitchener SeniorTechnicalStaff Member IBM Cloud Kubernetes Service @kitch — jakek@us.ibm.com MichaelElder Distinguished Engineer IBM Cloud Private @mdelder — mdelder@us.ibm.com Dr. Brad Topol Distinguished Engineer Open Technology & DeveloperAdvocacy @bradtopol — btopol@us.ibm.com
  • 18. 19 ® Think 2019 / IKS and Istio / Feb 17, 2019 / © 2019 IBM Corporation