CODEx Speakers Night 2019, November 2019, Hannover: Vortrag von Mario-Leander Reimer (@LeanderReimer, Cheftechnologe bei QAware)
== Dokument bitte herunterladen, falls unscharf! Please download slides if blurred! ==
Abstract: Der Einsatz Cloud nativer Technologien gehört in vielen deutschen Unternehmen mittlerweile zur Normalität. Großartig! Doch bei aller Liebe zur Technologie beobachte ich momentan bei vielen Teams und Kunden einen gewissen Grad an Ernüchterung und Zweifeln was den Einsatz moderner Tools, Techniken und Open Source Bausteinen angeht.
Mit steigender Verbreitung gibt es naturgemäß auch negative Erfahrungen und auch Fehlschläge. Das ist ganz normal! Klar, es gibt viel Raum für Verbesserungen. Um so wichtiger ist es, die aktuellen Trends und Neuerungen im Cloud-native Universum kontinuerlich im Auge zu behalten und diese mutig in das eigene Unternehmen und seine Projekte zu tragen.
Die kontinuierliche Verbesserung der Cloud-native Developer Experience ist einer dieser Bereiche. Schlanke Entwickler-Tools und Ansätze wie Skaffold, Werf, Squash oder TelePresence vereinfachen die Entwicklung und beschleunigen den Inner Development Loop enorm. Zahlreiche neue Serverless und FaaS Frameworks zielen darauf die Verbauungstiefe von Cloud-nativen Anwendungen deutlich zu reduzieren. Die Entwicklung und speziell der Betrieb werden zunehmend einfacher. "Don't do it yourself" heißt die Devise.
Auch das steigende Angebot an essentiellen Infrastruktur-Bausteinen wie Service Meshes, API Gateways und Messaging Systemen gilt es zu beobachten, um moderne Systeme der Zukunft zu bauen. Continuous Security und Continuous Compliance gewinnen im Enterprise Umfeld und speziell bei regulierten Unternehmen immer mehr an Bedeutung, auch hier lassen die passenden Tools und Technologien nicht lange auf sich warten.
Es bleibt also spannend, es gibt viel zu lernen und zu erforschen.
10. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware
2019
10
11. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware11
By Simon Wardley #EEA @swardly https://twitter.com/swardley/status/1143463178396979200?s=03
12. NOPE, IT'S ALL BAD.
SO THIS IS
CLOUD NATIVE?
YOU KNOW WHAT?
IT'S NOT HALF BAD.
13. NATÜRLICH IST NICHT
ALLES EITEL
SONNENSCHEIN IM
CLOUD NATIVE LAND.
CLOUD NATIVE
SOFTWARE ENTWICKLUNG
IST KOMPLEX!
14. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware
Improve your
inner development loop and the
Cloud Native DevEx
of your teams!
14
15. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware15
vs.
https://www.datawire.io/guide/development/development-environments-microservices/
16. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware16
vs.
https://www.datawire.io/guide/development/development-environments-microservices/
17. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware17
vs.
https://www.datawire.io/guide/development/development-environments-microservices/
18. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware18
vs.
https://www.datawire.io/guide/development/development-environments-microservices/
19. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware
Zahlreiche Tools helfen dabei den Inner Development
Loop einfacher und effizienter zu machen.
19
• The Rise of the IDE: Plugins, Plugins, Plugins. Beispiele: Cloud Code,
OpenShift Extension
• Squash enables easy remote debugging of running microservices in
Kubernetes und OpenShift from within your IDE.
• Draft, Skaffold, Tilt, oder Garden für Continuous Development.
Die verschiedenen Entwicklungs-Phase werden zusammenfasst in
einem CLI Command. Der Entwickler Workflow wird vereinfacht.
https://tilt.devhttps://draft.sh https://skaffold.dev
20. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware
Skaffold Workflow and Architecture
20
$ skaffold init
$ skaffold dev
21. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware
Telepresence ermöglicht die schnelle lokale Entwicklung von
Microservices gegen eine remote Kubernetes Umgebung.
21
Laptop
Source Code
Lokaler
Service
TelepresenceClientIDE
Remote Kubernetes Cluster
TelepresenceProxy
Service A
Service B
Database
Queue
https://www.telepresence.io
2-way
Network
Proxy
22. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware
Serverless
is the next logical evolution in
Cloud Native Software Development
22
23. Kein Server ist einfacher zu verwalten, als kein Server!
Werner Vogels, CTO, Amazon
24. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware
–https://landscape.cncf.io/
„Serverless computing refers to a new model of
cloud native computing, enabled by architectures
that do not require server management to build and
run applications. It leverages a finer-grained
deployment model where applications, bundled as
one or more functions, are uploaded to a platform
and then executed, scaled, and billed in response to
the exact demand needed at the moment.“
24
25. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware25
Functions
as preferred Serverless application
programming model.
26. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware
Hybrid Architecture Use Cases
• Kombination von Microservice
Architektur mit EDA
• Nutzung von Function Services für
Event-getriebene Use Cases
• Reduzierter Ressourcen-Verbrauch
per Scale-to-Zero
• Integration in bestehende Enterprise
PaaS Umgebung
26
Shared Enterprise PaaS
Microservices
Function Services FaaS Platform
X Y ZF1 F2 Fn
DevOps
S1 S2 Sn L M T
27. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware27
28. • Fission ist eine schnelle und komplette Platform
mit Unterstützung für viele Sprachen.
• Knative ist eine K8s-basierte Plattform um
Serverless Workloads zu bauen und zu betreiben.
• Kubeless ist einfach und leichtgewichtig.
• Nuclio ist super schnell, mit kleinem Footprint
und vielen Triggern.
• OpenFaaS ist sehr populär mit einer aktiven und
guten Community. Schnell. ARM Support.
• Kyma positioniert sich als komplette Enterprise
Serverless Platform mit vielen Features.
• https://github.com/lreimer/the-big-faas-lebowski
29. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware
Don’t do this! This is not a good idea!
29
A Structured Monolith
Component
A
Component
T
Component
?
Microservice
A
Microservice
T
Microservice
?REST
REST
REST
30. picture alliance / United Archive
8 Fallacies of Distributed Systems
1. The network is reliable
2. Latency is zero
3. Bandwidth is infinite
4. The network is secure
5. Topology doesn’t change
6. There is one administrator
7. Transport cost is zero
8. The networks is homogeneous
31. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware
1. The network is reliable
Problem: Netzwerk-Aufrufe werden fehlschlagen.
• Circuit Breaker und Retries sind eine Lösung, aber oft ein Pflaster.
• Service Meshes können helfen, bringen aber zusätzliche Komplexität und
Overhead. Istio, Linkerd, Maesh, et.al. -> Service Mesh Interface (SMI)
• Nutze Event-driven Architecture (EDA) für lose gekoppelte Systeme. Neue
Herausforderungen: Protokolle, Delivery Garantien, Message-Codierung
• Es muss nicht immer Kafka sein. Zahlreiche spannende CNCF Projekte z.B.
CloudEvents, OpenMessaging, NATS, Pulsar, …
31
https://landscape.cncf.io/category=streaming-messaging&format=card-mode&license=open-source
32. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware
2. Latency is zero
Problem: Netzwerk-Aufrufe haben eine Verzögerung. Das n+1 Problem.
• Schicke alle benötigten Daten mit möglichst wenigen (1) Requests.
• Es gibt Alternativen zu REST: GraphQL, effiziente Binärprotokolle, gRPC.
• Umsetzung von B4F und API-Gateway Patterns für Server-side Daten-Aggregation.
• Inversion of Control: Nutzung von Pub/Sub Mechanismen, Server-sent Events, Web
Sockets, Local Storage
• Die Daten müssen näher zum Client. Nutzung von Availability Zones, Content Delivery
Networks und intelligentes Caching.
32
https://landscape.cncf.io/category=remote-procedure-call&format=card-mode&license=open-source
33. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware
4. The network is secure
Problem: Das Netzwerk ist unsicher.
„Running workloads in the cloud is easy - doing it securely and in a compliant way is hard.“
• Security by Design -> Continuous Security -> Continuous Compliance.
• Layered-Security Ansatz: Absicherung auf Netzwerk, Infrastruktur, Plattform und
Anwendungsebene. Free eBook.
• 4C’s of Cloud Native Security
https://kubernetes.io/docs/concepts/security/overview/
• Zero Trust per Default: mTLS zwischen Services per Service Mesh und SPIFFE.
• Compliance per GitSec und Phylake -> Open Policy Agent (OPA), Aquasec, Istio, Falco
33
https://landscape.cncf.io/category=security-compliance&format=card-mode&license=open-source
34. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware
The 4C’s of Cloud Native Security
34
Cloud
Cluster
Container
Code
https://kubernetes.io/docs/concepts/security/overview/#the-4c-s-of-cloud-native-security
35. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware
Code
• Apply Defensive Programming Practices: Educate and Read
• Statische Code Analyse: Google Error Prone, Sonar, et.al.
• 3rd Party Dependency Security: Trusted Repositories (Nexus,
Artifactory), Build Tool Integration (OWASP Plugins)
• Dynamic Probing Attacks als Teil der CI/CD Pipeline: Headless
OWASP Zed Attack Proxy, Crashtest Security Suite
• Zero Trust Mindset: Access over TLS only, limited port ranges
35
36. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware
Container
• Disallow Privileged Users.
• Build minimal images. Consider Distroless.
• Use Trusted Registries and Trusted Images.
• Container Vulnerability Scanning und OS Dependency Security als Teil
der CI/CD Pipeline mit Tools wie Claire
• Image Signing and Enforcement: CNCF Projects (TUF and Notary) are
useful tools for signing container images and maintaining a system of
trust, IBM’s Portieris can be used for enforcement.
36
# Start by building the application.
FROM golang:1.12 as build
WORKDIR /go/src/app
ADD . /go/src/app
RUN go get -d -v ./...
RUN go build -o /go/bin/app
# Now copy it into our base image.
FROM gcr.io/distroless/base
COPY --from=build /go/bin/app /
CMD ["/app"]
37. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware
Cluster
• Sowohl die Komponenten des Clusters selbst auch die Applications-Komponenten müssen gesichert
werden. Empfehlung: Nutze einen Managed Cluster as a Service Dienst.
• Application secrets management (and encrypting them in etcd at rest)
https://kubernetes.io/docs/concepts/configuration/secret/
• Pod Security Policies:
https://kubernetes.io/docs/concepts/policy/pod-security-policy/
• Quality of Service (and Cluster resource management)
https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/
• Network Policies:
https://kubernetes.io/docs/concepts/services-networking/network-policies/
• TLS For Kubernetes Ingress:
https://kubernetes.io/docs/concepts/services-networking/ingress/#tls
37
38. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware
5. Topology doesn’t change
Problem: Netzwerk Topologien ändern sich ständig.
• Abstraktion der physischen Netzwerk-Struktur. Nutzung von DNS oder
Discovery Services wie Eureka oder Zookeeper.
• Cloud-native API Gateways sorgen für zusätzliche Location Transparency.
• Cattle, not pets. Treat Clusters Like Cattle. Immutable Infrastructure.
• Regelmäßige Chaos-Tests zur Überprüfung der Robustheit: Netflix Chaos
Monkey, kube-monkey, Chaos Toolkit, Gremlin, …
38
https://landscape.cncf.io/category=chaos-engineering&format=card-mode&license=open-source
39. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware
6. There is one administrator
Problem: Diese 1 Person die alles weiß gibt es nicht (mehr).
• Jeder im Team ist für den Release Prozess verantwortlich. Frühzeitiges involvieren aller
beteiligten Stakeholder.
• Klare Definition der DevOps-Topologie, Rollen, Verantwortlichkeiten, SLOs und SLAs.
• Manuelle Änderungen an der Infrastruktur sind tabu! GitOps heißt das Stichwort!
• Weave Flux: https://github.com/weaveworks/flux
• Automatisierte CI/CD Pipeline: Tekton Pipelines, Spinnaker, Argo CD, JenkinsX, …
• Seales Secrets: https://github.com/bitnami-labs/sealed-secrets
39
https://landscape.cncf.io/category=continuous-integration-delivery&format=card-mode&license=open-source
40. | CODEx Speakers Night | Enterprise Cloud-native ist das "Neue Normal" | @LeanderReimer #cloudnativenerd #qaware40
DevOps Anti-Types, e.g. DevOps Team Topologies, e.g.
https://web.devopstopologies.com
DevOps Team Silo
Dev Don’t Need Ops
Rebranded SysAdmin
Dev and Ops Collaboration Fully Shared Ops Responsibilities
SRE Team (Google Model) DevOps Advocacy Team
Ops as Infrastructure-as-a-Service DevOps as External Service