SlideShare uma empresa Scribd logo
1 de 45
Baixar para ler offline
Mario-Leander Reimer
mario-leander.reimer@qaware.de
@LeanderReimer
Cloud-native .NET Microservics
mit Kubernetes
Mainz, 28. September 2017
Mario-Leander Reimer
Chief Technologist, QAware GmbH
Contact Details
Phone: +49 89 23 23 15 121
Mail: mario-leander.reimer@qaware.de
Twitter: @LeanderReimer
Github: https://github.com/lreimer
2
Developer & Architect
20+ years of experience
#CloudNativeNerd
Open Source Enthusiast
QAware
Let‘s talk about Cloud Native Applications.
3QAware
DISRUPT
4
CLOUD NATIVE APPLICATIONS
INDUSTRIALIZE
OPEX SAVINGS
(automation & utilization)
ANTIFRAGILITYHYPERSCALE
TRAFFIC, DATA, FEATURES
DEVOPS &
CONTINUOUS DELIVERY
QAware
BUILT AND COMPOSED
AS MICROSERVICES
3KEYPRINCIPLES
5
CLOUD NATIVE APPLICATIONS
PACKAGED AND
DISTRIBUTED IN CONTAINERS
DYNAMICALLY
EXECUTED IN THE CLOUD
QAware
Robert A. Heinlein, 1966, The Moon Is a Harsh Mistress
„There ain’t no such thing
as a free lunch.“
7
The 5 Cloud Commandments:
1. Everything Fails All The Time.
2. Focus on MTTR not MTTF.
3. Know the Eight Fallacies of Distributed Computing.
4. Scale out, not up.
5. Treat resources as cattle not as pets.
picture alliance / United Archive
Design Principles for Cloud Native Applications.
8
Design for Distribution: Containers; microservices; API driven development.
Design for Performance: Responsive; concurrent; resource efficient.
Design for Automation: Automated Dev & Ops tasks.
Design for Resiliency: Fault-tolerant and self-healing.
Design for Elasticity: Scales dynamically and reacts to stimuli.
Design for Delivery: Short roundtrips and automated provisioning.
Design for Diagnosability: Cluster-wide logs, metrics and traces.
QAware
Different Levels of Cloud Native Application Maturity.
9
Scales dynamically based on stimuli.
Dynamic infrastructure migration without
service downtime.
Level 3: Cloud Native
Fault tolerant and resilient design.
Metrics and monitoring built-in.
Runs anywhere. Infrastructure agnostic.
Level 2: Cloud Resilient
Consists of loosely coupled systems.
Services can be found by name.
Adheres to the 12-factor app principles.
Level 1: Cloud Friendly
No file system requirements.
Runs on virtualized hardware.
Executed as self-contained image.
Level 0: Cloud Ready
https://www.opendatacenteralliance.org/docs/architecting_cloud_aware_applications.pdf
QAware
The Anatomy of the Cloud Native Stack.
10
How to decouple
from physical
hardware?
How to provide the
right resources for
container execution?
How to run (containerized)
applications on a cluster?
How to automate standard
operations procedures?
What infrastructure
to provide to cloud
native applications?
QAware
Specific Cloud Native Stack with .NET Core + Steeltoe
OSS and Kubernetes.
QAware 12
(1) Microservices
(2) Containerization
(3) Composition
(4) Orchestration
The 4 Phases of Cloud Native Application Development.
13QAware
Microservices
15
Cloud Native Application Development: Components All
Along the Software Lifecycle.
DESIGN BUILD RUN
§ Complexity unit
§ Data integrity unit
§ Coherent and cohesive
features unit
§ Decoupled unit
§ Planning unit
§ Team assignment unit
§ Knowledge unit
§ Development unit
§ Integration unit
§ Release unit
§ Deployment unit
§ Runtime unit
(crash, slow-down, access)
§ Scaling unit
1:1 n:1
QAware
16
Dev Components Ops Components?:1
System
Subsystems
Components
Services
Good starting point
Decomposition Trade-Offs
Microservices
Nanoservices
Macroservices
Monolith
+ More flexible to scale
+ Runtime isolation (crash, slow-down, …)
+ Independent releases, deployments, teams
+ Higher utilization possible
- Distribution debt: Latency
- Increasing infrastructure complexity
- Increasing troubleshooting complexity
- Increasing integration complexity
QAware
A simple microservices using .NET Core and Steeltoe.
17
https://github.com/lreimer/cloud-native-basta17
QAware
Steeltoe OSS enables developers to implement Cloud-
native .NET microservices with ease.
QAware 18
Steeltoe client libraries enable .NET Core and .NET Framework apps to leverage Netflix Eureka, Hystrix,
Spring Cloud Config Server, and Cloud Foundry services.
Services that enable .NET and ASP.NET developers to leverage Spring Cloud:
Configuration Server client
Service Discovery client
Hystrix Circuit Breaker
Management endpoints
Services that simplify using .NET and ASP.NET on Cloud Foundry:
Connectors (e.g. MySql, Redis, Postgres, RabbitMQ, OAuth, etc)
Configuration providers
Security providers (OAuth SSO, JWT, Redis Key Ring Storage, etc.)
Logging providers
Containerization
Hardware vs. OS Virtualization.
20
Real Hardware
Virtual Hardware
OS
OS Libraries
Application
Real Hardware
(Virtual Hardware)
OS
OS Libraries
Application
HSI*
SCI*
Hardware Virtualization OS Virtualization
Private Copy
Shared ResourcesVirtualMachine
Container
Isolated Hardware Isolated NW-interface, process space, file system
*) HSI = Hardware Software Interface
SCI = System Call Interface
§ Less volume of private copy
§ Near zero runtime overhead
§ Short start-up time
§ Stong isolation
QAware
Developer‘s Perspective of the Docker Workflow.
21
$ docker build -t cloud-native-basta17:1.0.1 .
$ docker run --name cloud-native-basta17 -d 
-p 5000:5000 cloud-native-basta17:1.0.1
$ docker stop cloud-native-basta17
$ docker start cloud-native-basta17
$ docker tag cloud-native-basta17:1.0.1 
lreimer/cloud-native-basta17:1.0.1
$ docker push lreimer/cloud-native-basta17
QAware
FROM microsoft/dotnet:1.1.4-runtime
MAINTAINER Mario-Leander Reimer <mario-leander.reimer@qaware.de>
# defined working directory and copy the published output
WORKDIR /cloud-native-basta17
COPY out .
# define the entry point for this container
# run the application and bind to network interfaces
EXPOSE 5000
ENTRYPOINT ["dotnet", "cloud-native-basta17.dll"]
CMD ["--server.urls", "http://0.0.0.0:5000"]
Example Dockerfile.
22QAware
Some Useful Tips on using Docker.
23
A Dockerfile is code! Treat it as 1st class citizen.
Know your base image. Size matters.
Chain RUN commands. Use intelligent layering.
Remove temporary files and directories.
Define ENV variables for important parameters.
Use one image for all your environments.
Version your images.
Use quality tools to check Dockerfiles and images.
QAware
Composition
Microservices need an Ecosystem to run in.
25
How to access
endpoints from
the outside?
How to expose
and find service
endpoints?
How to execute an
ops component?
How to call other
endpoints resilient
and responsive?
How to detect and
resolve operational
anomalies?
How to provide cluster-
wide configuration and
consensus?
QAware
26QAware
Conceptual View on Infrastructure Composition.
27QAware
version: '3'
services:
eureka: ...
config-server: ...
cloud-native-basta17:
build: .
image: lreimer/cloud-native-basta17
environment:
- EUREKA_HOST=eureka
depends_on:
- eureka
- config-server
ports:
- “5000:5000"
networks:
- backend
Example docker-compose.yml
28
$ docker-compose build
$ docker-compose up –d --build
$ docker-compose logs
$ docker-compose down
QAware
Orchestration
echo "- The default provider is GCE"
export KUBERNETES_PROVIDER=gce
export KUBE_GCE_ZONE=europe-west1-d
export NUM_NODES=4
echo "- Another possible provider is AWS"
export KUBERNETES_PROVIDER=aws
export KUBE_AWS_ZONE=eu-central-1a
export NODE_SIZE=t2.small
curl -sS https://get.k8s.io | bash
Easy K8s setup: Local, Bare Metal, Cloud or Managed.
30QAware
Conceptual View on Kubernetes Building Blocks.
31QAware
Services are an abstraction for a logical
collection of pods.
Pods are the smallest unit of compute in
Kubernetes
Deployments are an abstraction used to
declare and update pods, RCs, …
Replica Sets ensure that the desired
number of pod replicas are running
Labels are key/value pairs used to identify
Kubernetes resources
Config Maps store K/V pairs that can be
passed to containers as ENV variables or as
volume mounts.
Most important Kubernetes concepts.
32QAware
Single or Multi Container Pods?
33QAware
K8s Deployment Overview.
34QAware
K8s-only Deployment Variation.
35QAware
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: cloud-native-basta17
spec:
replicas: 4
template:
metadata:
labels:
app: cloud-native-basta17
spec:
containers:
- name: cloud-native-basta17
image: "lreimer/cloud-native-basta17"
ports:
- containerPort: 5000
env:
- name: EUREKA_HOST
value: eureka
Example K8s Deployment Definition.
36QAware
resources:
# Define resources to help K8S scheduler
# CPU is specified in units of cores
# Memory is specified in units of bytes
# required resources for a Pod to be started
requests:
memory: "128Mi"
cpu: "250m"
# the Pod will be restarted if limits are exceeded
limits:
memory: "192Mi"
cpu: "500m"
Define Resource Constraints carefully.
37QAware
# container will receive requests if probe succeeds
readinessProbe:
httpGet:
path: /admin/info
port: 5000
initialDelaySeconds: 30
timeoutSeconds: 5
# container will be killed if probe fails
livenessProbe:
httpGet:
path: /admin/health
port: 5000
initialDelaySeconds: 90
timeoutSeconds: 10
Liveness and Readiness Probes for Actuator endpoints.
38QAware
apiVersion: v1
kind: Service
metadata:
name: zwitscher-service
labels:
app: cloud-native-basta17
spec:
# use NodePort here to be able to access the port on each node
# use LoadBalancer for external load-balanced IP if supported
type: NodePort
ports:
- port: 5000
selector:
app: cloud-native-basta17
Example K8s Service Definition.
39QAware
Programmable MIDI Controller.
Visualizes Deployments and Pods.
Scales Deployments.
Supports K8s, OpenShift, DC/OS.
http://github.com/qaware/kubepad/
Let‘s have some fun with K8S!
40QAware
No magic! Just complex technology.
42
Building distributed systems is hard!
.NET Core and Steeltoe OSS hide most of the inherent complexity.
High abstraction: Boon and Bane of software development.
Developers and architects need additional skills and know-how.
Favour gradual transition over big bang cloud migration.
QAware
Sources and some articles to read @ home …
43
https://github.com/lreimer/cloud-native-basta17
Der Cloud Native Stack: Mesos, Kubernetes und Spring Cloud
https://goo.gl/U5cJAU
Spring Cloud und Netflix OSS: Cloud-native Anwendungen bauen
https://goo.gl/edNlUK
Cloud-native Anwendungen mit Kubernetes

https://goo.gl/dVkoyR
Eine Einführung in Apache Mesos: Das Betriebsystem der Cloud

https://goo.gl/7SnMZA
QAware
QAware 44
Mario-Leander Reimer
mario-leander.reimer@qaware.de
@LeanderReimer github.com/lreimer
linkedin.com/qaware slideshare.net/qaware
twitter.com/qaware xing.com/qaware

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Cloud Platforms "demystified": Docker, Kubernetes, Knative & Cloud Foundry
Cloud Platforms "demystified": Docker, Kubernetes, Knative & Cloud FoundryCloud Platforms "demystified": Docker, Kubernetes, Knative & Cloud Foundry
Cloud Platforms "demystified": Docker, Kubernetes, Knative & Cloud Foundry
 
All Things Open 2017: How to Treat a Network as a Container
All Things Open 2017: How to Treat a Network as a ContainerAll Things Open 2017: How to Treat a Network as a Container
All Things Open 2017: How to Treat a Network as a Container
 
Clean Infrastructure as Code
Clean Infrastructure as CodeClean Infrastructure as Code
Clean Infrastructure as Code
 
betterCode Workshop: Effizientes DevOps-Tooling mit Go
betterCode Workshop:  Effizientes DevOps-Tooling mit GobetterCode Workshop:  Effizientes DevOps-Tooling mit Go
betterCode Workshop: Effizientes DevOps-Tooling mit Go
 
WWCode Dallas - Kubernetes: Learning from Zero to Production
WWCode Dallas - Kubernetes: Learning from Zero to ProductionWWCode Dallas - Kubernetes: Learning from Zero to Production
WWCode Dallas - Kubernetes: Learning from Zero to Production
 
Kubernetes best practices
Kubernetes best practicesKubernetes best practices
Kubernetes best practices
 
JEE on DC/OS
JEE on DC/OSJEE on DC/OS
JEE on DC/OS
 
Continuous (Non)-Functional Testing of Microservices on k8s
Continuous (Non)-Functional Testing of Microservices on k8s Continuous (Non)-Functional Testing of Microservices on k8s
Continuous (Non)-Functional Testing of Microservices on k8s
 
Kubernetes: Learning from Zero to Production
Kubernetes: Learning from Zero to ProductionKubernetes: Learning from Zero to Production
Kubernetes: Learning from Zero to Production
 
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...
 
Deploying Cloud Native Red Team Infrastructure with Kubernetes, Istio and Envoy
Deploying Cloud Native Red Team Infrastructure with Kubernetes, Istio and Envoy Deploying Cloud Native Red Team Infrastructure with Kubernetes, Istio and Envoy
Deploying Cloud Native Red Team Infrastructure with Kubernetes, Istio and Envoy
 
4K–Kubernetes with Knative, Kafka and Kamel
4K–Kubernetes with Knative, Kafka and Kamel 4K–Kubernetes with Knative, Kafka and Kamel
4K–Kubernetes with Knative, Kafka and Kamel
 
Luca Relandini - Microservices and containers networking: Contiv, deep dive a...
Luca Relandini - Microservices and containers networking: Contiv, deep dive a...Luca Relandini - Microservices and containers networking: Contiv, deep dive a...
Luca Relandini - Microservices and containers networking: Contiv, deep dive a...
 
Introduction to Containers and Docker
Introduction to Containers and DockerIntroduction to Containers and Docker
Introduction to Containers and Docker
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Kubelet with no Kubernetes Masters | DevNation Tech Talk
Kubelet with no Kubernetes Masters | DevNation Tech TalkKubelet with no Kubernetes Masters | DevNation Tech Talk
Kubelet with no Kubernetes Masters | DevNation Tech Talk
 
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
 
Kubernetes 101 VMworld 2019 workshop slides
Kubernetes 101 VMworld 2019 workshop slidesKubernetes 101 VMworld 2019 workshop slides
Kubernetes 101 VMworld 2019 workshop slides
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
K8s from Zero to ~Hero~ Seasoned Beginner
K8s from Zero to ~Hero~ Seasoned BeginnerK8s from Zero to ~Hero~ Seasoned Beginner
K8s from Zero to ~Hero~ Seasoned Beginner
 

Semelhante a Cloud-native .NET Microservices mit 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)
QAware GmbH
 

Semelhante a Cloud-native .NET Microservices mit Kubernetes (20)

A hitchhiker‘s guide to the cloud native stack
A hitchhiker‘s guide to the cloud native stackA hitchhiker‘s guide to the cloud native stack
A hitchhiker‘s guide to the cloud native stack
 
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
Cloud-native .NET-Microservices mit Kubernetes @BASTAconCloud-native .NET-Microservices mit Kubernetes @BASTAcon
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
 
Weave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 RecapWeave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 Recap
 
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
 
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)
 
Use GitLab with Chaos Engineering to Harden your Applications + OpenEBS 1.3 ...
 Use GitLab with Chaos Engineering to Harden your Applications + OpenEBS 1.3 ... Use GitLab with Chaos Engineering to Harden your Applications + OpenEBS 1.3 ...
Use GitLab with Chaos Engineering to Harden your Applications + OpenEBS 1.3 ...
 
Docker and Cloud - Enables for DevOps - by ACA-IT
Docker and Cloud - Enables for DevOps - by ACA-ITDocker and Cloud - Enables for DevOps - by ACA-IT
Docker and Cloud - Enables for DevOps - by ACA-IT
 
'DOCKER' & CLOUD: ENABLERS For DEVOPS
'DOCKER' & CLOUD:  ENABLERS For DEVOPS'DOCKER' & CLOUD:  ENABLERS For DEVOPS
'DOCKER' & CLOUD: ENABLERS For DEVOPS
 
Containers as a Service with Docker
Containers as a Service with DockerContainers as a Service with Docker
Containers as a Service with Docker
 
Docker Container As A Service - March 2016
Docker Container As A Service - March 2016Docker Container As A Service - March 2016
Docker Container As A Service - March 2016
 
DevOps with Kubernetes and Helm - Jenkins World Edition
DevOps with Kubernetes and Helm - Jenkins World EditionDevOps with Kubernetes and Helm - Jenkins World Edition
DevOps with Kubernetes and Helm - Jenkins World Edition
 
Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018
 
Red Hat and kubernetes: awesome stuff coming your way
Red Hat and kubernetes:  awesome stuff coming your wayRed Hat and kubernetes:  awesome stuff coming your way
Red Hat and kubernetes: awesome stuff coming your way
 
Getting Started with MariaDB with Docker
Getting Started with MariaDB with DockerGetting Started with MariaDB with Docker
Getting Started with MariaDB with Docker
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
 
Docker, cornerstone of an hybrid cloud?
Docker, cornerstone of an hybrid cloud?Docker, cornerstone of an hybrid cloud?
Docker, cornerstone of an hybrid cloud?
 
Dessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudDessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloud
 
Come costruire una Platform As A Service con Docker, Kubernetes Go e Java
Come costruire una Platform As A Service con Docker, Kubernetes Go e JavaCome costruire una Platform As A Service con Docker, Kubernetes Go e Java
Come costruire una Platform As A Service con Docker, Kubernetes Go e Java
 
DevOps with Kubernetes and Helm - OSCON 2018
DevOps with Kubernetes and Helm - OSCON 2018DevOps with Kubernetes and Helm - OSCON 2018
DevOps with Kubernetes and Helm - OSCON 2018
 
Docker Orchestration: Welcome to the Jungle! Devoxx & Docker Meetup Tour Nov ...
Docker Orchestration: Welcome to the Jungle! Devoxx & Docker Meetup Tour Nov ...Docker Orchestration: Welcome to the Jungle! Devoxx & Docker Meetup Tour Nov ...
Docker Orchestration: Welcome to the Jungle! Devoxx & Docker Meetup Tour Nov ...
 

Mais de QAware GmbH

"Mixed" Scrum-Teams – Die richtige Mischung macht's!
"Mixed" Scrum-Teams – Die richtige Mischung macht's!"Mixed" Scrum-Teams – Die richtige Mischung macht's!
"Mixed" Scrum-Teams – Die richtige Mischung macht's!
QAware GmbH
 
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
 Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See... Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
QAware GmbH
 

Mais de QAware GmbH (20)

50 Shades of K8s Autoscaling #JavaLand24.pdf
50 Shades of K8s Autoscaling #JavaLand24.pdf50 Shades of K8s Autoscaling #JavaLand24.pdf
50 Shades of K8s Autoscaling #JavaLand24.pdf
 
Make Agile Great - PM-Erfahrungen aus zwei virtuellen internationalen SAFe-Pr...
Make Agile Great - PM-Erfahrungen aus zwei virtuellen internationalen SAFe-Pr...Make Agile Great - PM-Erfahrungen aus zwei virtuellen internationalen SAFe-Pr...
Make Agile Great - PM-Erfahrungen aus zwei virtuellen internationalen SAFe-Pr...
 
Fully-managed Cloud-native Databases: The path to indefinite scale @ CNN Mainz
Fully-managed Cloud-native Databases: The path to indefinite scale @ CNN MainzFully-managed Cloud-native Databases: The path to indefinite scale @ CNN Mainz
Fully-managed Cloud-native Databases: The path to indefinite scale @ CNN Mainz
 
Down the Ivory Tower towards Agile Architecture
Down the Ivory Tower towards Agile ArchitectureDown the Ivory Tower towards Agile Architecture
Down the Ivory Tower towards Agile Architecture
 
"Mixed" Scrum-Teams – Die richtige Mischung macht's!
"Mixed" Scrum-Teams – Die richtige Mischung macht's!"Mixed" Scrum-Teams – Die richtige Mischung macht's!
"Mixed" Scrum-Teams – Die richtige Mischung macht's!
 
Make Developers Fly: Principles for Platform Engineering
Make Developers Fly: Principles for Platform EngineeringMake Developers Fly: Principles for Platform Engineering
Make Developers Fly: Principles for Platform Engineering
 
Der Tod der Testpyramide? – Frontend-Testing mit Playwright
Der Tod der Testpyramide? – Frontend-Testing mit PlaywrightDer Tod der Testpyramide? – Frontend-Testing mit Playwright
Der Tod der Testpyramide? – Frontend-Testing mit Playwright
 
Was kommt nach den SPAs
Was kommt nach den SPAsWas kommt nach den SPAs
Was kommt nach den SPAs
 
Cloud Migration mit KI: der Turbo
Cloud Migration mit KI: der Turbo Cloud Migration mit KI: der Turbo
Cloud Migration mit KI: der Turbo
 
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
 Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See... Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
 
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
 
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.
 
Kubernetes with Cilium in AWS - Experience Report!
Kubernetes with Cilium in AWS - Experience Report!Kubernetes with Cilium in AWS - Experience Report!
Kubernetes with Cilium in AWS - Experience Report!
 
50 Shades of K8s Autoscaling
50 Shades of K8s Autoscaling50 Shades of K8s Autoscaling
50 Shades of K8s Autoscaling
 
Kontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAP
Kontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAPKontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAP
Kontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAP
 
Service Mesh Pain & Gain. Experiences from a client project.
Service Mesh Pain & Gain. Experiences from a client project.Service Mesh Pain & Gain. Experiences from a client project.
Service Mesh Pain & Gain. Experiences from a client project.
 
50 Shades of K8s Autoscaling
50 Shades of K8s Autoscaling50 Shades of K8s Autoscaling
50 Shades of K8s Autoscaling
 
Blue turns green! Approaches and technologies for sustainable K8s clusters.
Blue turns green! Approaches and technologies for sustainable K8s clusters.Blue turns green! Approaches and technologies for sustainable K8s clusters.
Blue turns green! Approaches and technologies for sustainable K8s clusters.
 
Per Anhalter zu Cloud Nativen API Gateways
Per Anhalter zu Cloud Nativen API GatewaysPer Anhalter zu Cloud Nativen API Gateways
Per Anhalter zu Cloud Nativen API Gateways
 
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
 

Ú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@
 

Último (20)

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...
 
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...
 
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...
 
+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...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

Cloud-native .NET Microservices mit Kubernetes

  • 1. Mario-Leander Reimer mario-leander.reimer@qaware.de @LeanderReimer Cloud-native .NET Microservics mit Kubernetes Mainz, 28. September 2017
  • 2. Mario-Leander Reimer Chief Technologist, QAware GmbH Contact Details Phone: +49 89 23 23 15 121 Mail: mario-leander.reimer@qaware.de Twitter: @LeanderReimer Github: https://github.com/lreimer 2 Developer & Architect 20+ years of experience #CloudNativeNerd Open Source Enthusiast QAware
  • 3. Let‘s talk about Cloud Native Applications. 3QAware
  • 4. DISRUPT 4 CLOUD NATIVE APPLICATIONS INDUSTRIALIZE OPEX SAVINGS (automation & utilization) ANTIFRAGILITYHYPERSCALE TRAFFIC, DATA, FEATURES DEVOPS & CONTINUOUS DELIVERY QAware
  • 5. BUILT AND COMPOSED AS MICROSERVICES 3KEYPRINCIPLES 5 CLOUD NATIVE APPLICATIONS PACKAGED AND DISTRIBUTED IN CONTAINERS DYNAMICALLY EXECUTED IN THE CLOUD QAware
  • 6. Robert A. Heinlein, 1966, The Moon Is a Harsh Mistress „There ain’t no such thing as a free lunch.“
  • 7. 7 The 5 Cloud Commandments: 1. Everything Fails All The Time. 2. Focus on MTTR not MTTF. 3. Know the Eight Fallacies of Distributed Computing. 4. Scale out, not up. 5. Treat resources as cattle not as pets. picture alliance / United Archive
  • 8. Design Principles for Cloud Native Applications. 8 Design for Distribution: Containers; microservices; API driven development. Design for Performance: Responsive; concurrent; resource efficient. Design for Automation: Automated Dev & Ops tasks. Design for Resiliency: Fault-tolerant and self-healing. Design for Elasticity: Scales dynamically and reacts to stimuli. Design for Delivery: Short roundtrips and automated provisioning. Design for Diagnosability: Cluster-wide logs, metrics and traces. QAware
  • 9. Different Levels of Cloud Native Application Maturity. 9 Scales dynamically based on stimuli. Dynamic infrastructure migration without service downtime. Level 3: Cloud Native Fault tolerant and resilient design. Metrics and monitoring built-in. Runs anywhere. Infrastructure agnostic. Level 2: Cloud Resilient Consists of loosely coupled systems. Services can be found by name. Adheres to the 12-factor app principles. Level 1: Cloud Friendly No file system requirements. Runs on virtualized hardware. Executed as self-contained image. Level 0: Cloud Ready https://www.opendatacenteralliance.org/docs/architecting_cloud_aware_applications.pdf QAware
  • 10. The Anatomy of the Cloud Native Stack. 10 How to decouple from physical hardware? How to provide the right resources for container execution? How to run (containerized) applications on a cluster? How to automate standard operations procedures? What infrastructure to provide to cloud native applications? QAware
  • 11.
  • 12. Specific Cloud Native Stack with .NET Core + Steeltoe OSS and Kubernetes. QAware 12
  • 13. (1) Microservices (2) Containerization (3) Composition (4) Orchestration The 4 Phases of Cloud Native Application Development. 13QAware
  • 15. 15 Cloud Native Application Development: Components All Along the Software Lifecycle. DESIGN BUILD RUN § Complexity unit § Data integrity unit § Coherent and cohesive features unit § Decoupled unit § Planning unit § Team assignment unit § Knowledge unit § Development unit § Integration unit § Release unit § Deployment unit § Runtime unit (crash, slow-down, access) § Scaling unit 1:1 n:1 QAware
  • 16. 16 Dev Components Ops Components?:1 System Subsystems Components Services Good starting point Decomposition Trade-Offs Microservices Nanoservices Macroservices Monolith + More flexible to scale + Runtime isolation (crash, slow-down, …) + Independent releases, deployments, teams + Higher utilization possible - Distribution debt: Latency - Increasing infrastructure complexity - Increasing troubleshooting complexity - Increasing integration complexity QAware
  • 17. A simple microservices using .NET Core and Steeltoe. 17 https://github.com/lreimer/cloud-native-basta17 QAware
  • 18. Steeltoe OSS enables developers to implement Cloud- native .NET microservices with ease. QAware 18 Steeltoe client libraries enable .NET Core and .NET Framework apps to leverage Netflix Eureka, Hystrix, Spring Cloud Config Server, and Cloud Foundry services. Services that enable .NET and ASP.NET developers to leverage Spring Cloud: Configuration Server client Service Discovery client Hystrix Circuit Breaker Management endpoints Services that simplify using .NET and ASP.NET on Cloud Foundry: Connectors (e.g. MySql, Redis, Postgres, RabbitMQ, OAuth, etc) Configuration providers Security providers (OAuth SSO, JWT, Redis Key Ring Storage, etc.) Logging providers
  • 20. Hardware vs. OS Virtualization. 20 Real Hardware Virtual Hardware OS OS Libraries Application Real Hardware (Virtual Hardware) OS OS Libraries Application HSI* SCI* Hardware Virtualization OS Virtualization Private Copy Shared ResourcesVirtualMachine Container Isolated Hardware Isolated NW-interface, process space, file system *) HSI = Hardware Software Interface SCI = System Call Interface § Less volume of private copy § Near zero runtime overhead § Short start-up time § Stong isolation QAware
  • 21. Developer‘s Perspective of the Docker Workflow. 21 $ docker build -t cloud-native-basta17:1.0.1 . $ docker run --name cloud-native-basta17 -d -p 5000:5000 cloud-native-basta17:1.0.1 $ docker stop cloud-native-basta17 $ docker start cloud-native-basta17 $ docker tag cloud-native-basta17:1.0.1 lreimer/cloud-native-basta17:1.0.1 $ docker push lreimer/cloud-native-basta17 QAware
  • 22. FROM microsoft/dotnet:1.1.4-runtime MAINTAINER Mario-Leander Reimer <mario-leander.reimer@qaware.de> # defined working directory and copy the published output WORKDIR /cloud-native-basta17 COPY out . # define the entry point for this container # run the application and bind to network interfaces EXPOSE 5000 ENTRYPOINT ["dotnet", "cloud-native-basta17.dll"] CMD ["--server.urls", "http://0.0.0.0:5000"] Example Dockerfile. 22QAware
  • 23. Some Useful Tips on using Docker. 23 A Dockerfile is code! Treat it as 1st class citizen. Know your base image. Size matters. Chain RUN commands. Use intelligent layering. Remove temporary files and directories. Define ENV variables for important parameters. Use one image for all your environments. Version your images. Use quality tools to check Dockerfiles and images. QAware
  • 25. Microservices need an Ecosystem to run in. 25 How to access endpoints from the outside? How to expose and find service endpoints? How to execute an ops component? How to call other endpoints resilient and responsive? How to detect and resolve operational anomalies? How to provide cluster- wide configuration and consensus? QAware
  • 27. Conceptual View on Infrastructure Composition. 27QAware
  • 28. version: '3' services: eureka: ... config-server: ... cloud-native-basta17: build: . image: lreimer/cloud-native-basta17 environment: - EUREKA_HOST=eureka depends_on: - eureka - config-server ports: - “5000:5000" networks: - backend Example docker-compose.yml 28 $ docker-compose build $ docker-compose up –d --build $ docker-compose logs $ docker-compose down QAware
  • 30. echo "- The default provider is GCE" export KUBERNETES_PROVIDER=gce export KUBE_GCE_ZONE=europe-west1-d export NUM_NODES=4 echo "- Another possible provider is AWS" export KUBERNETES_PROVIDER=aws export KUBE_AWS_ZONE=eu-central-1a export NODE_SIZE=t2.small curl -sS https://get.k8s.io | bash Easy K8s setup: Local, Bare Metal, Cloud or Managed. 30QAware
  • 31. Conceptual View on Kubernetes Building Blocks. 31QAware
  • 32. Services are an abstraction for a logical collection of pods. Pods are the smallest unit of compute in Kubernetes Deployments are an abstraction used to declare and update pods, RCs, … Replica Sets ensure that the desired number of pod replicas are running Labels are key/value pairs used to identify Kubernetes resources Config Maps store K/V pairs that can be passed to containers as ENV variables or as volume mounts. Most important Kubernetes concepts. 32QAware
  • 33. Single or Multi Container Pods? 33QAware
  • 36. apiVersion: extensions/v1beta1 kind: Deployment metadata: name: cloud-native-basta17 spec: replicas: 4 template: metadata: labels: app: cloud-native-basta17 spec: containers: - name: cloud-native-basta17 image: "lreimer/cloud-native-basta17" ports: - containerPort: 5000 env: - name: EUREKA_HOST value: eureka Example K8s Deployment Definition. 36QAware
  • 37. resources: # Define resources to help K8S scheduler # CPU is specified in units of cores # Memory is specified in units of bytes # required resources for a Pod to be started requests: memory: "128Mi" cpu: "250m" # the Pod will be restarted if limits are exceeded limits: memory: "192Mi" cpu: "500m" Define Resource Constraints carefully. 37QAware
  • 38. # container will receive requests if probe succeeds readinessProbe: httpGet: path: /admin/info port: 5000 initialDelaySeconds: 30 timeoutSeconds: 5 # container will be killed if probe fails livenessProbe: httpGet: path: /admin/health port: 5000 initialDelaySeconds: 90 timeoutSeconds: 10 Liveness and Readiness Probes for Actuator endpoints. 38QAware
  • 39. apiVersion: v1 kind: Service metadata: name: zwitscher-service labels: app: cloud-native-basta17 spec: # use NodePort here to be able to access the port on each node # use LoadBalancer for external load-balanced IP if supported type: NodePort ports: - port: 5000 selector: app: cloud-native-basta17 Example K8s Service Definition. 39QAware
  • 40. Programmable MIDI Controller. Visualizes Deployments and Pods. Scales Deployments. Supports K8s, OpenShift, DC/OS. http://github.com/qaware/kubepad/ Let‘s have some fun with K8S! 40QAware
  • 41.
  • 42. No magic! Just complex technology. 42 Building distributed systems is hard! .NET Core and Steeltoe OSS hide most of the inherent complexity. High abstraction: Boon and Bane of software development. Developers and architects need additional skills and know-how. Favour gradual transition over big bang cloud migration. QAware
  • 43. Sources and some articles to read @ home … 43 https://github.com/lreimer/cloud-native-basta17 Der Cloud Native Stack: Mesos, Kubernetes und Spring Cloud https://goo.gl/U5cJAU Spring Cloud und Netflix OSS: Cloud-native Anwendungen bauen https://goo.gl/edNlUK Cloud-native Anwendungen mit Kubernetes
 https://goo.gl/dVkoyR Eine Einführung in Apache Mesos: Das Betriebsystem der Cloud
 https://goo.gl/7SnMZA QAware