SlideShare uma empresa Scribd logo
1 de 14
Baixar para ler offline
From legacy to Kubernetes, securely & quickly


Using Docker Desktop to get your applications into Kubernetes right on your
desktop
Eric Smalling


Sr. Developer Advocate, Snyk


@ericsmalling
Eric Smalling
Sr. Developer Advocate, Snyk
@ericsmalling
Agenda
Kubernetes crash course


Moving a legacy app into Kubernetes


Security risks & defenses


Docker Desktop efficiency tricks
Kubernetes in 10 minutes
“… Kubernetes provides a way for us to run and
schedule containerized workloads on multiple hosts.”


Production Kubernetes, Chapter 1


Josh Rosso, Rich Lander, Alexander Brand, John Harris
Kubernetes in 10 Minutes


Core concepts & types
● Pod


○ Smallest deployable computing unit you can
create and manage


○ Manages one or more containers that will all
run on the same host


○ Containers in the same pod share a network
namespace


○ Every pod get’s a unique IP address


○ By default, every pod can communicate with
every other pod in a cluster w/out NAT


■ Restrictions can be placed on this
pod: webapp


10.9.1.100
container:


log-watcher
volume: logvol
container:


ecommerce-app
apiVersion: v1


kind: Pod


metadata:


name: webapp


spec:


containers:


- name: ecommerce-app


image: mycorp/ecom:1.0


ports:


- containerPort: 8080


volumeMounts:


- mountPath: /logs


name: logvol
Kubernetes in 10 Minutes


Core concepts & types
● Deployment


○ Manages pod lifecycle


■ Scaling


■ Release rollout/rollback
apiVersion: v1


kind: Deployment


metadata:


name: webapp-deployment


…


replicas: 2


…


containers:


image: mycorp/ecom:1.0


ports:


- containerPort: 8080


volumeMounts:


- mountPath: /logs


name: logvol


- name: log-watcher


image: mycorp/log-fwd:1.0


volumeMounts:




pod:webapp
1.0
pod:webapp
1.0
Kubernetes in 10 Minutes


Core concepts & types
● Deployment


○ Manages pod lifecycle


■ Scaling


■ Release rollout/rollback
apiVersion: v1


kind: Deployment


metadata:


name: webapp-deployment


…


replicas: 3


…


containers:


image: mycorp/ecom:1.0


ports:


- containerPort: 8080


volumeMounts:


- mountPath: /logs


name: logvol


- name: log-watcher


image: mycorp/log-fwd:1.0


volumeMounts:




pod:webapp
1.0
pod:webapp
1.0
pod:webapp
1.0
Kubernetes in 10 Minutes


Core concepts & types
● Deployment


○ Manages pod lifecycle


■ Scaling


■ Release rollout/rollback
apiVersion: v1


kind: Deployment


metadata:


name: webapp-deployment


…


replicas: 3


…


containers:


image: mycorp/ecom:1.1


ports:


- containerPort: 8080


volumeMounts:


- mountPath: /logs


name: logvol


- name: log-watcher


image: mycorp/log-fwd:1.0


volumeMounts:




pod:webapp
1.0
pod:webapp
1.1
pod:webapp
1.0
pod:webapp
1.1
pod:webapp
1.0
pod:webapp
1.1
Kubernetes in 10 Minutes


Core concepts & types
● Service


○ Provides logical grouping of pods


■ Selector based*


○ Exposes pods behind a single IP address and
DNS Name


■ Kubernetes service discovery = DNS


○ Provides load balancing across pods
apiVersion: v1


kind: Service


metadata:


name: ecom


spec:


selector:


app: webapp


tier: frontend


ports:


- protocol: TCP


port: 80


targetPort: 8080
pod:webapp pod:webapp pod:webapp
service:
ecom
app:


webapp
app:


webapp
app:


webapp
t
i
e
r
:
f
r
o
n
t
e
n
d
t
i
e
r
:
f
r
o
n
t
e
n
d
t
i
e
r
:
f
r
o
n
t
e
n
d
ecom.default.svc.cluster.local


ecom.default


ecom
Demo time: Moving a legacy app into Kubernetes
• Simple J2EE application


• Runs on Tomcat


• Containerized already


• Want to run on k8s but need a
faster, more iterative place to
experiment


• Docker Desktop k8s to the rescue!
Demo time: Moving a legacy app into Kubernetes
• Simple J2EE application


• Runs on Tomcat


• Containerized already


• Want to run on k8s but need a
faster, more iterative place to
experiment


• Docker Desktop k8s to the rescue!
pod:db
pod:app
pod:app
pod:app
svc:


app
svc:


db
LoadBalancer
Demo time: Moving a legacy app into Kubernetes
• Simple J2EE application


• Runs on Tomcat


• Containerized already


• Want to run on k8s but need a
faster, more iterative place to
experiment


• Docker Desktop k8s to the rescue!
pod:db
pod:app
svc:


app
svc:


db
LoadBalancer
hostPath
References
Docker Desktop Kubernetes: https://docs.docker.com/desktop/kubernetes/


Kubernetes Home: https://kubernetes.io/


Kustomize: https://kustomize.io/


Security Context Cheat Sheet: https://snyk.co/DC22-k8sSecContextTop10


CKAD: https://www.cncf.io/certification/ckad/
@ericsmalling
DockerCon 2022 - From legacy to Kubernetes, securely & quickly

Mais conteúdo relacionado

Semelhante a DockerCon 2022 - From legacy to Kubernetes, securely & quickly

Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
QAware GmbH
 

Semelhante a DockerCon 2022 - From legacy to Kubernetes, securely & quickly (20)

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
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals Training
 
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
 
Docker intro workshop: Dockerize your PHP app
Docker  intro workshop: Dockerize your PHP appDocker  intro workshop: Dockerize your PHP app
Docker intro workshop: Dockerize your PHP app
 
Kubernetes for Java Developers
Kubernetes for Java DevelopersKubernetes for Java Developers
Kubernetes for Java Developers
 
CI/CD Across Multiple Environments
CI/CD Across Multiple EnvironmentsCI/CD Across Multiple Environments
CI/CD Across Multiple Environments
 
IBM MQ in containers MQTC 2017
IBM MQ in containers MQTC 2017IBM MQ in containers MQTC 2017
IBM MQ in containers MQTC 2017
 
How to install and use Kubernetes
How to install and use KubernetesHow to install and use Kubernetes
How to install and use Kubernetes
 
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
 
Cluster management with Kubernetes
Cluster management with KubernetesCluster management with Kubernetes
Cluster management with Kubernetes
 
Docker on docker leveraging kubernetes in docker ee
Docker on docker leveraging kubernetes in docker eeDocker on docker leveraging kubernetes in docker ee
Docker on docker leveraging kubernetes in docker ee
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
DCEU 18: Docker Container Networking
DCEU 18: Docker Container NetworkingDCEU 18: Docker Container Networking
DCEU 18: Docker Container Networking
 
Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307Docker kubernetes fundamental(pod_service)_190307
Docker kubernetes fundamental(pod_service)_190307
 
Kubernetes workshop -_the_basics
Kubernetes workshop -_the_basicsKubernetes workshop -_the_basics
Kubernetes workshop -_the_basics
 
K8s best practices from the field!
K8s best practices from the field!K8s best practices from the field!
K8s best practices from the field!
 
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
 
kubernetes for beginners
kubernetes for beginnerskubernetes for beginners
kubernetes for beginners
 
Scaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesScaleable PHP Applications in Kubernetes
Scaleable PHP Applications in Kubernetes
 
The App Developer's Kubernetes Toolbox
The App Developer's Kubernetes ToolboxThe App Developer's Kubernetes Toolbox
The App Developer's Kubernetes Toolbox
 

Mais de Eric Smalling

Simply your Jenkins Projects with Docker Multi-Stage Builds
Simply your Jenkins Projects with Docker Multi-Stage BuildsSimply your Jenkins Projects with Docker Multi-Stage Builds
Simply your Jenkins Projects with Docker Multi-Stage Builds
Eric Smalling
 

Mais de Eric Smalling (20)

DockerCon 2023 - Live Demo_Hardening Against Kubernetes Hacks.pdf
DockerCon 2023 - Live Demo_Hardening Against Kubernetes Hacks.pdfDockerCon 2023 - Live Demo_Hardening Against Kubernetes Hacks.pdf
DockerCon 2023 - Live Demo_Hardening Against Kubernetes Hacks.pdf
 
KubeHuddle NA 2023 - Why should devs care about container security - Eric Sma...
KubeHuddle NA 2023 - Why should devs care about container security - Eric Sma...KubeHuddle NA 2023 - Why should devs care about container security - Eric Sma...
KubeHuddle NA 2023 - Why should devs care about container security - Eric Sma...
 
ATO 2022 - Why should devs care about container security.pdf
ATO 2022 - Why should devs care about container security.pdfATO 2022 - Why should devs care about container security.pdf
ATO 2022 - Why should devs care about container security.pdf
 
KubeCon NA 2022 - Hardening against Kubernetes Hacks.pdf
KubeCon NA 2022 - Hardening against Kubernetes Hacks.pdfKubeCon NA 2022 - Hardening against Kubernetes Hacks.pdf
KubeCon NA 2022 - Hardening against Kubernetes Hacks.pdf
 
DevOpsDays Chicago 2022 - Hands-on hacking containers and ways to prevent it
DevOpsDays Chicago 2022 - Hands-on hacking containers and ways to prevent itDevOpsDays Chicago 2022 - Hands-on hacking containers and ways to prevent it
DevOpsDays Chicago 2022 - Hands-on hacking containers and ways to prevent it
 
Look Ma' - Building Java and Go based container images without Dockerfiles
Look Ma' - Building Java and Go based container images without DockerfilesLook Ma' - Building Java and Go based container images without Dockerfiles
Look Ma' - Building Java and Go based container images without Dockerfiles
 
Container Stranger Danger - Why should devs care about container security
Container Stranger Danger - Why should devs care about container securityContainer Stranger Danger - Why should devs care about container security
Container Stranger Danger - Why should devs care about container security
 
SCaLE 19x - Eric Smalling - Hardening against Kubernetes Hacks
SCaLE 19x - Eric Smalling - Hardening against Kubernetes HacksSCaLE 19x - Eric Smalling - Hardening against Kubernetes Hacks
SCaLE 19x - Eric Smalling - Hardening against Kubernetes Hacks
 
Python Web Conference 2022 - Why should devs care about container security.pdf
Python Web Conference 2022 - Why should devs care about container security.pdfPython Web Conference 2022 - Why should devs care about container security.pdf
Python Web Conference 2022 - Why should devs care about container security.pdf
 
Why should developers care about container security?
Why should developers care about container security?Why should developers care about container security?
Why should developers care about container security?
 
AWS live hack: Docker + Snyk Container on AWS
AWS live hack: Docker + Snyk Container on AWSAWS live hack: Docker + Snyk Container on AWS
AWS live hack: Docker + Snyk Container on AWS
 
AWS live hack: Atlassian + Snyk OSS on AWS
AWS live hack: Atlassian + Snyk OSS on AWSAWS live hack: Atlassian + Snyk OSS on AWS
AWS live hack: Atlassian + Snyk OSS on AWS
 
Hacking into your containers, and how to stop it!
Hacking into your containers, and how to stop it!Hacking into your containers, and how to stop it!
Hacking into your containers, and how to stop it!
 
DevSecCon Lightning 2021- Container defaults are a hackers best friend
DevSecCon Lightning 2021- Container defaults are a hackers best friendDevSecCon Lightning 2021- Container defaults are a hackers best friend
DevSecCon Lightning 2021- Container defaults are a hackers best friend
 
LFX Nov 16, 2021 - Find vulnerabilities before security knocks on your door
LFX Nov 16, 2021 - Find vulnerabilities before security knocks on your doorLFX Nov 16, 2021 - Find vulnerabilities before security knocks on your door
LFX Nov 16, 2021 - Find vulnerabilities before security knocks on your door
 
So. many. vulnerabilities. Why are containers such a mess and what to do abou...
So. many. vulnerabilities. Why are containers such a mess and what to do abou...So. many. vulnerabilities. Why are containers such a mess and what to do abou...
So. many. vulnerabilities. Why are containers such a mess and what to do abou...
 
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
 
Best Practices for Developing & Deploying Java Applications with Docker
Best Practices for Developing & Deploying Java Applications with DockerBest Practices for Developing & Deploying Java Applications with Docker
Best Practices for Developing & Deploying Java Applications with Docker
 
Docker 101 Workshop slides (JavaOne 2017)
Docker 101 Workshop slides (JavaOne 2017)Docker 101 Workshop slides (JavaOne 2017)
Docker 101 Workshop slides (JavaOne 2017)
 
Simply your Jenkins Projects with Docker Multi-Stage Builds
Simply your Jenkins Projects with Docker Multi-Stage BuildsSimply your Jenkins Projects with Docker Multi-Stage Builds
Simply your Jenkins Projects with Docker Multi-Stage Builds
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

DockerCon 2022 - From legacy to Kubernetes, securely & quickly

  • 1. From legacy to Kubernetes, securely & quickly Using Docker Desktop to get your applications into Kubernetes right on your desktop Eric Smalling 
 Sr. Developer Advocate, Snyk @ericsmalling
  • 2. Eric Smalling Sr. Developer Advocate, Snyk @ericsmalling
  • 3. Agenda Kubernetes crash course Moving a legacy app into Kubernetes Security risks & defenses Docker Desktop efficiency tricks
  • 4. Kubernetes in 10 minutes “… Kubernetes provides a way for us to run and schedule containerized workloads on multiple hosts.” Production Kubernetes, Chapter 1 Josh Rosso, Rich Lander, Alexander Brand, John Harris
  • 5. Kubernetes in 10 Minutes Core concepts & types ● Pod ○ Smallest deployable computing unit you can create and manage ○ Manages one or more containers that will all run on the same host ○ Containers in the same pod share a network namespace ○ Every pod get’s a unique IP address ○ By default, every pod can communicate with every other pod in a cluster w/out NAT ■ Restrictions can be placed on this pod: webapp 10.9.1.100 container: 
 log-watcher volume: logvol container: ecommerce-app apiVersion: v1 kind: Pod metadata: name: webapp spec: containers: - name: ecommerce-app image: mycorp/ecom:1.0 ports: - containerPort: 8080 volumeMounts: - mountPath: /logs name: logvol
  • 6. Kubernetes in 10 Minutes Core concepts & types ● Deployment ○ Manages pod lifecycle ■ Scaling ■ Release rollout/rollback apiVersion: v1 kind: Deployment metadata: name: webapp-deployment … replicas: 2 … containers: image: mycorp/ecom:1.0 ports: - containerPort: 8080 volumeMounts: - mountPath: /logs name: logvol - name: log-watcher image: mycorp/log-fwd:1.0 volumeMounts: pod:webapp 1.0 pod:webapp 1.0
  • 7. Kubernetes in 10 Minutes Core concepts & types ● Deployment ○ Manages pod lifecycle ■ Scaling ■ Release rollout/rollback apiVersion: v1 kind: Deployment metadata: name: webapp-deployment … replicas: 3 … containers: image: mycorp/ecom:1.0 ports: - containerPort: 8080 volumeMounts: - mountPath: /logs name: logvol - name: log-watcher image: mycorp/log-fwd:1.0 volumeMounts: pod:webapp 1.0 pod:webapp 1.0 pod:webapp 1.0
  • 8. Kubernetes in 10 Minutes Core concepts & types ● Deployment ○ Manages pod lifecycle ■ Scaling ■ Release rollout/rollback apiVersion: v1 kind: Deployment metadata: name: webapp-deployment … replicas: 3 … containers: image: mycorp/ecom:1.1 ports: - containerPort: 8080 volumeMounts: - mountPath: /logs name: logvol - name: log-watcher image: mycorp/log-fwd:1.0 volumeMounts: pod:webapp 1.0 pod:webapp 1.1 pod:webapp 1.0 pod:webapp 1.1 pod:webapp 1.0 pod:webapp 1.1
  • 9. Kubernetes in 10 Minutes Core concepts & types ● Service ○ Provides logical grouping of pods ■ Selector based* ○ Exposes pods behind a single IP address and DNS Name ■ Kubernetes service discovery = DNS ○ Provides load balancing across pods apiVersion: v1 kind: Service metadata: name: ecom spec: selector: app: webapp tier: frontend ports: - protocol: TCP port: 80 targetPort: 8080 pod:webapp pod:webapp pod:webapp service: ecom app: webapp app: webapp app: webapp t i e r : f r o n t e n d t i e r : f r o n t e n d t i e r : f r o n t e n d ecom.default.svc.cluster.local ecom.default ecom
  • 10. Demo time: Moving a legacy app into Kubernetes • Simple J2EE application • Runs on Tomcat • Containerized already • Want to run on k8s but need a faster, more iterative place to experiment • Docker Desktop k8s to the rescue!
  • 11. Demo time: Moving a legacy app into Kubernetes • Simple J2EE application • Runs on Tomcat • Containerized already • Want to run on k8s but need a faster, more iterative place to experiment • Docker Desktop k8s to the rescue! pod:db pod:app pod:app pod:app svc: 
 app svc: 
 db LoadBalancer
  • 12. Demo time: Moving a legacy app into Kubernetes • Simple J2EE application • Runs on Tomcat • Containerized already • Want to run on k8s but need a faster, more iterative place to experiment • Docker Desktop k8s to the rescue! pod:db pod:app svc: 
 app svc: 
 db LoadBalancer hostPath
  • 13. References Docker Desktop Kubernetes: https://docs.docker.com/desktop/kubernetes/ Kubernetes Home: https://kubernetes.io/ Kustomize: https://kustomize.io/ Security Context Cheat Sheet: https://snyk.co/DC22-k8sSecContextTop10 CKAD: https://www.cncf.io/certification/ckad/ @ericsmalling