SlideShare a Scribd company logo
Efficient DevOps Tooling
with Java and GraalVM
JCON2020#
www.jcon.one
Mario-Leander Reimer
Principal Software Architect, QAware GmbH
Our Partners 2020:
Mario-Leander Reimer
Principal Software Architect
@LeanderReimer
#cloudnativenerd #qaware
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020
How do you organise and enable
DevOps teams for
fast flow and high productivity?
3
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020
Too much cognitive load will become a bottleneck
for fast flow and high productivity.
• Instrinsic Cognitive Load - relates to fundamental aspects
and knowledge in the problem space (e.g. used languages,
APIs, frameworks)
• Extraneous Cognitive Load - relates to the environment
(e.g. deployment, configuration, console commands)
• Germane Cognitive Load - relates to specific aspects of the
business domain (aka. „value added“ thinking)
4
https://teamtopologies.com
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020
Eliminate
extraneous cognitive load
Minimize
intrinsic cognitive load
5
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON20206
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020
Use the right language for the job!?
7
Getty Images Liliboas
Ansible Shell ScriptsRuby Python
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON20208
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020
GraalVM to the Rescue!
9
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020
GraalVM in a Nutshell
• Polyglot Runtime: runs all JVM languages, R, JavaScript, NodeJS,
Ruby, Python, C/C++ via LLVM with full interop
• Ahead-of-time (AOT) Compilation: memory management, thread
scheduling via SubstrateVM
• GraalVM as a Platform: embed and extend GraalVM with Truffle,
implement your own language and tools
10
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020
Polyglot Mayhem
• The Graal Polyglot API allows you to embed and use different
languages with full bidirectional interop.
• This is not the same as with the Java Scripting API (JSR 223)!
11
private static void helloPython(PolyglotMessage message) {
try (Context context = Context.newBuilder().allowAllAccess(true).build()) {
context.getPolyglotBindings().putMember("message", message);
context.eval("python",
"import polyglotn" +
"message = polyglot.import_value('message')n" +
"message['invocations'] += 1n" +
"print(message['text'])");
}
}
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020
The Swiss Army Knife of Operations.
12
CLIs - The Swiss Army Knife of Operations
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020
The basics of 12-factor CLI apps
• Great help is essential. What version am I on?
• Prefer flags to positional arguments.
• Mind the streams. stdout is for output, stderr is for messaging.
• Handle things going wrong: error code, title, how to fix, URL, …
• Be fancy: use colours, have shell completion.
• Prompt if you can.
• Be speedy. CLIs need to start fast.
• Be clear about subcommands.
13
For complete list and info, read https://medium.com/@jdxcode/12-factor-cli-apps-dd3c227a0e46
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020
Build CLIs with Picocli and GraalVM
• Native DevOps tools, CLIs or sidecar containers can now also be
build using Java! Golang is still cool.
• Picoli is a small framework to easily build JVM command line apps.
• Support for ANSI colors, tab completion, sub commands and other
12-factor CLI app principles
• In-built support for GraalVM AOT compilation to native images via the
ReflectionConfigGenerator utility.
14
JCON2020#
www.jcon.one
Code & Demos
https://github.com/lreimer/hands-on-graalvm
https://github.com/lreimer/microj-cli
https://github.com/lreimer/microj-jakartaee8-payara5
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020
Container Orchestration Patterns
16
Sidecar Container
Extended Container Behaviour
• Log Extraction / Reformatting
(fluentd, file beat)
• Scheduling (cron, quartz)
Ambassador Container
Proxy Communication
• TLS Tunnel (ghostunnel, Istio)
• Circuit Breaking (linked, Istio)
• Request Monitoring (linked, Istio)
Adapter Container
Standardized Ops Interfaces
• Monitoring (Prometheus)
• Configuration (ConfigMaps, Secrets, …)
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON202017
Operator.
- Do stuff to my Kubernetes.
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020
What are operators?
• Operators are codified Ops procedures!
• Operators are the path towards Zero-Ops. They enable auto-updating,
self-monitoring and self-healing infrastructure and applications.
• The concept was coined in the Kubernetes world. It’s now been
adopted and used widespread in the cloud native world.
• Examples: OKD, Sealed Secrets, Kube Monkey, Weave Flux
18
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020
Kubernetes Operators in a Nutshell
19
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020
The Kill Pod Operator
20
• Super simple Chaos monkey style operator inspired by Kubemonkey
• Regularly kills pods of deployments that are killpod/enabled
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-killpod-enabled
labels:
killpod/enabled: "true"
killpod/application: nginx-killpod-enabled
killpod/delay: "30"
killpod/amount: "2"
spec:
...
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020
The Super Secret Operator
21
• Apply asymmetrical encrypted secrets, the operator will decrypt and manage ordinary
K8s secrets under the hood
• Inspired by Sealed Secrets from Bitnami https://github.com/bitnami-labs/sealed-secrets
apiVersion: operators.on.hands/v1alpha1
kind: SuperSecret
metadata:
name: supersecret-test
spec:
secretData:
password: eV7YoQXyZlY+y51RWXEqyu0U44EPEPwEz+fZvGo+7McOTA4wQYCdxXMANtab3aW8
...
ywqpkHYtSLvrPgFnbcuSvD2UzuUNeE2qkh6SAM1z9Lpfwi+IUZjaY34Z+RjEL5OZFPYkQ==
// JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020
The Microservice Operator
22
apiVersion: operators.on.hands/v1alpha1
kind: Microservice
metadata:
name: microservice-test
labels:
app: nginx
spec:
replicas: 2
image: nginx:1.17.6
ports:
- containerPort: 80
serviceType: LoadBalancer
• Abstracting the usual Deployment, Service and ConfigMap definitions
using a simple and unified Microservice CRD
JCON2020#
www.jcon.one
Code & Demos
https://github.com/lreimer/graal-operators
Thank You !
JCON2020#
www.jcon.one
Our Partners 2020:
Mario-Leander Reimer
Principal Software Architect, QAware GmbH
mario-leander.reimer@qaware.de
https://www.qaware.de
https://speakerdeck.com/lreimer/
https://github.com/lreimer/
www.javapro.io
Das kostenlose Profi-Magazin für Java Entwickler !
Powered by

More Related Content

What's hot (20)

PDF
Continuous (Non)-Functional Testing of Microservices on k8s
QAware GmbH
 
PDF
Go for Operations
QAware GmbH
 
PPTX
Rancher master class globalized edge workloads with k3s
Joseph Marhee
 
PDF
Declarative Import with Magento 2 Import Framework (M2IF)
Tim Wagner
 
PDF
JEE on DC/OS
Josef Adersberger
 
PDF
GraalVm and Quarkus
Sascha Rodekamp
 
PDF
Cloud Compliance with Open Policy Agent
QAware GmbH
 
PPTX
A basic overview of Containers
Divakar Sharma
 
PDF
Continuous (Non-)Functional Testing of Microservices on K8s
QAware GmbH
 
PDF
Quarkus tips, tricks, and techniques
Red Hat Developers
 
PDF
Improving security with Istio | DevNation Tech Talk
Red Hat Developers
 
PPTX
betterCode Workshop: Effizientes DevOps-Tooling mit Go
QAware GmbH
 
PDF
Justin Cormack - The 10 Container Security Tricks That Will Help You Sleep At...
Codemotion
 
PDF
CQRS - Eine Einführung - NOUG 2011
Dennis Traub
 
PDF
Commit to excellence - Java in containers
Red Hat Developers
 
PPTX
Replatforming Legacy Packaged Applications: Block-by-Block with Minecraft
VMware Tanzu
 
PDF
Ich brauche einen Abstraktions-Layer für meine Cloud
QAware GmbH
 
PPTX
Bandit and Gosec - Security Linters
EricBrown328
 
PPTX
Nodejs overview
Nicola Del Gobbo
 
PDF
Jacopo Nardiello - Monitoring Cloud-Native applications with Prometheus - Cod...
Codemotion
 
Continuous (Non)-Functional Testing of Microservices on k8s
QAware GmbH
 
Go for Operations
QAware GmbH
 
Rancher master class globalized edge workloads with k3s
Joseph Marhee
 
Declarative Import with Magento 2 Import Framework (M2IF)
Tim Wagner
 
JEE on DC/OS
Josef Adersberger
 
GraalVm and Quarkus
Sascha Rodekamp
 
Cloud Compliance with Open Policy Agent
QAware GmbH
 
A basic overview of Containers
Divakar Sharma
 
Continuous (Non-)Functional Testing of Microservices on K8s
QAware GmbH
 
Quarkus tips, tricks, and techniques
Red Hat Developers
 
Improving security with Istio | DevNation Tech Talk
Red Hat Developers
 
betterCode Workshop: Effizientes DevOps-Tooling mit Go
QAware GmbH
 
Justin Cormack - The 10 Container Security Tricks That Will Help You Sleep At...
Codemotion
 
CQRS - Eine Einführung - NOUG 2011
Dennis Traub
 
Commit to excellence - Java in containers
Red Hat Developers
 
Replatforming Legacy Packaged Applications: Block-by-Block with Minecraft
VMware Tanzu
 
Ich brauche einen Abstraktions-Layer für meine Cloud
QAware GmbH
 
Bandit and Gosec - Security Linters
EricBrown328
 
Nodejs overview
Nicola Del Gobbo
 
Jacopo Nardiello - Monitoring Cloud-Native applications with Prometheus - Cod...
Codemotion
 

Similar to Efficient DevOps Tooling with Java and GraalVM (20)

PDF
Drools, jBPM OptaPlanner presentation
Mark Proctor
 
PPTX
Knative with .NET Core and Quarkus with GraalVM
Mark Lechtermann
 
PDF
Free GitOps Workshop (with Intro to Kubernetes & GitOps)
Weaveworks
 
PDF
Free GitOps Workshop
Weaveworks
 
PDF
kubectl apply -f cloud-Infrastructure.yaml mit Crossplane et al.pdf
QAware GmbH
 
PDF
Cluster-as-code. The Many Ways towards Kubernetes
QAware GmbH
 
PPTX
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
PPTX
Bring the Action: Using GraalVM in Production
Alina Yurenko
 
PDF
Andrey Adamovich and Luciano Fiandesio - Groovy dev ops in the cloud
DevConFu
 
PDF
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
Alina Yurenko
 
PPTX
Going AOT: Everything you need to know about GraalVM for Java applications
Alina Yurenko
 
PDF
Intro to Kubernetes & GitOps Workshop
Weaveworks
 
PDF
Quarkus@Code Garden
Giuseppe Bonocore
 
PDF
Promise of DevOps
Juraj Hantak
 
PDF
Everything-as-code - A polyglot adventure
QAware GmbH
 
PDF
Everything-as-code. A polyglot adventure. #DevoxxPL
Mario-Leander Reimer
 
PPTX
Kubernetes Infra 2.0
Deepak Sood
 
PDF
Quarkus Denmark 2019
Max Andersen
 
PPTX
GOING AOT WITH GRAALVM FOR JAVA - JAVAZONE
Alina Yurenko
 
PDF
Free GitOps Workshop + Intro to Kubernetes & GitOps
Weaveworks
 
Drools, jBPM OptaPlanner presentation
Mark Proctor
 
Knative with .NET Core and Quarkus with GraalVM
Mark Lechtermann
 
Free GitOps Workshop (with Intro to Kubernetes & GitOps)
Weaveworks
 
Free GitOps Workshop
Weaveworks
 
kubectl apply -f cloud-Infrastructure.yaml mit Crossplane et al.pdf
QAware GmbH
 
Cluster-as-code. The Many Ways towards Kubernetes
QAware GmbH
 
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
Bring the Action: Using GraalVM in Production
Alina Yurenko
 
Andrey Adamovich and Luciano Fiandesio - Groovy dev ops in the cloud
DevConFu
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
Alina Yurenko
 
Going AOT: Everything you need to know about GraalVM for Java applications
Alina Yurenko
 
Intro to Kubernetes & GitOps Workshop
Weaveworks
 
Quarkus@Code Garden
Giuseppe Bonocore
 
Promise of DevOps
Juraj Hantak
 
Everything-as-code - A polyglot adventure
QAware GmbH
 
Everything-as-code. A polyglot adventure. #DevoxxPL
Mario-Leander Reimer
 
Kubernetes Infra 2.0
Deepak Sood
 
Quarkus Denmark 2019
Max Andersen
 
GOING AOT WITH GRAALVM FOR JAVA - JAVAZONE
Alina Yurenko
 
Free GitOps Workshop + Intro to Kubernetes & GitOps
Weaveworks
 
Ad

More from QAware GmbH (20)

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

Recently uploaded (20)

PPTX
A Complete Guide to Salesforce SMS Integrations Build Scalable Messaging With...
360 SMS APP
 
PPTX
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
PPTX
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PDF
Continouous failure - Why do we make our lives hard?
Papp Krisztián
 
PPTX
An Introduction to ZAP by Checkmarx - Official Version
Simon Bennetts
 
PPTX
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
PPTX
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
PDF
2025年 Linux 核心專題: 探討 sched_ext 及機器學習.pdf
Eric Chou
 
PPTX
Cubase Pro Crack 2025 – Free Download Full Version with Activation Key
HyperPc soft
 
PPTX
NeuroStrata: Harnessing Neuro-Symbolic Paradigms for Improved Testability and...
Ivan Ruchkin
 
PPTX
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
PPTX
WYSIWYG Web Builder Crack 2025 – Free Download Full Version with License Key
HyperPc soft
 
PDF
Streamline Contractor Lifecycle- TECH EHS Solution
TECH EHS Solution
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PDF
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
 
PPTX
Perfecting XM Cloud for Multisite Setup.pptx
Ahmed Okour
 
PDF
GridView,Recycler view, API, SQLITE& NetworkRequest.pdf
Nabin Dhakal
 
PPTX
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
A Complete Guide to Salesforce SMS Integrations Build Scalable Messaging With...
360 SMS APP
 
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
Continouous failure - Why do we make our lives hard?
Papp Krisztián
 
An Introduction to ZAP by Checkmarx - Official Version
Simon Bennetts
 
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
2025年 Linux 核心專題: 探討 sched_ext 及機器學習.pdf
Eric Chou
 
Cubase Pro Crack 2025 – Free Download Full Version with Activation Key
HyperPc soft
 
NeuroStrata: Harnessing Neuro-Symbolic Paradigms for Improved Testability and...
Ivan Ruchkin
 
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
WYSIWYG Web Builder Crack 2025 – Free Download Full Version with License Key
HyperPc soft
 
Streamline Contractor Lifecycle- TECH EHS Solution
TECH EHS Solution
 
Human Resources Information System (HRIS)
Amity University, Patna
 
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
 
Perfecting XM Cloud for Multisite Setup.pptx
Ahmed Okour
 
GridView,Recycler view, API, SQLITE& NetworkRequest.pdf
Nabin Dhakal
 
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 

Efficient DevOps Tooling with Java and GraalVM

  • 1. Efficient DevOps Tooling with Java and GraalVM JCON2020# www.jcon.one Mario-Leander Reimer Principal Software Architect, QAware GmbH Our Partners 2020:
  • 2. Mario-Leander Reimer Principal Software Architect @LeanderReimer #cloudnativenerd #qaware
  • 3. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020 How do you organise and enable DevOps teams for fast flow and high productivity? 3
  • 4. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020 Too much cognitive load will become a bottleneck for fast flow and high productivity. • Instrinsic Cognitive Load - relates to fundamental aspects and knowledge in the problem space (e.g. used languages, APIs, frameworks) • Extraneous Cognitive Load - relates to the environment (e.g. deployment, configuration, console commands) • Germane Cognitive Load - relates to specific aspects of the business domain (aka. „value added“ thinking) 4 https://teamtopologies.com
  • 5. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020 Eliminate extraneous cognitive load Minimize intrinsic cognitive load 5
  • 6. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON20206
  • 7. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020 Use the right language for the job!? 7 Getty Images Liliboas Ansible Shell ScriptsRuby Python
  • 8. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON20208
  • 9. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020 GraalVM to the Rescue! 9
  • 10. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020 GraalVM in a Nutshell • Polyglot Runtime: runs all JVM languages, R, JavaScript, NodeJS, Ruby, Python, C/C++ via LLVM with full interop • Ahead-of-time (AOT) Compilation: memory management, thread scheduling via SubstrateVM • GraalVM as a Platform: embed and extend GraalVM with Truffle, implement your own language and tools 10
  • 11. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020 Polyglot Mayhem • The Graal Polyglot API allows you to embed and use different languages with full bidirectional interop. • This is not the same as with the Java Scripting API (JSR 223)! 11 private static void helloPython(PolyglotMessage message) { try (Context context = Context.newBuilder().allowAllAccess(true).build()) { context.getPolyglotBindings().putMember("message", message); context.eval("python", "import polyglotn" + "message = polyglot.import_value('message')n" + "message['invocations'] += 1n" + "print(message['text'])"); } }
  • 12. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020 The Swiss Army Knife of Operations. 12 CLIs - The Swiss Army Knife of Operations
  • 13. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020 The basics of 12-factor CLI apps • Great help is essential. What version am I on? • Prefer flags to positional arguments. • Mind the streams. stdout is for output, stderr is for messaging. • Handle things going wrong: error code, title, how to fix, URL, … • Be fancy: use colours, have shell completion. • Prompt if you can. • Be speedy. CLIs need to start fast. • Be clear about subcommands. 13 For complete list and info, read https://medium.com/@jdxcode/12-factor-cli-apps-dd3c227a0e46
  • 14. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020 Build CLIs with Picocli and GraalVM • Native DevOps tools, CLIs or sidecar containers can now also be build using Java! Golang is still cool. • Picoli is a small framework to easily build JVM command line apps. • Support for ANSI colors, tab completion, sub commands and other 12-factor CLI app principles • In-built support for GraalVM AOT compilation to native images via the ReflectionConfigGenerator utility. 14
  • 16. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020 Container Orchestration Patterns 16 Sidecar Container Extended Container Behaviour • Log Extraction / Reformatting (fluentd, file beat) • Scheduling (cron, quartz) Ambassador Container Proxy Communication • TLS Tunnel (ghostunnel, Istio) • Circuit Breaking (linked, Istio) • Request Monitoring (linked, Istio) Adapter Container Standardized Ops Interfaces • Monitoring (Prometheus) • Configuration (ConfigMaps, Secrets, …)
  • 17. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON202017 Operator. - Do stuff to my Kubernetes.
  • 18. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020 What are operators? • Operators are codified Ops procedures! • Operators are the path towards Zero-Ops. They enable auto-updating, self-monitoring and self-healing infrastructure and applications. • The concept was coined in the Kubernetes world. It’s now been adopted and used widespread in the cloud native world. • Examples: OKD, Sealed Secrets, Kube Monkey, Weave Flux 18
  • 19. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020 Kubernetes Operators in a Nutshell 19
  • 20. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020 The Kill Pod Operator 20 • Super simple Chaos monkey style operator inspired by Kubemonkey • Regularly kills pods of deployments that are killpod/enabled apiVersion: apps/v1 kind: Deployment metadata: name: nginx-killpod-enabled labels: killpod/enabled: "true" killpod/application: nginx-killpod-enabled killpod/delay: "30" killpod/amount: "2" spec: ...
  • 21. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020 The Super Secret Operator 21 • Apply asymmetrical encrypted secrets, the operator will decrypt and manage ordinary K8s secrets under the hood • Inspired by Sealed Secrets from Bitnami https://github.com/bitnami-labs/sealed-secrets apiVersion: operators.on.hands/v1alpha1 kind: SuperSecret metadata: name: supersecret-test spec: secretData: password: eV7YoQXyZlY+y51RWXEqyu0U44EPEPwEz+fZvGo+7McOTA4wQYCdxXMANtab3aW8 ... ywqpkHYtSLvrPgFnbcuSvD2UzuUNeE2qkh6SAM1z9Lpfwi+IUZjaY34Z+RjEL5OZFPYkQ==
  • 22. // JCON 2020 // Efficient DevOps Tooling with Java and GraalVM // @LeanderReimer #cloudnativenerd #qaware #JCON2020 The Microservice Operator 22 apiVersion: operators.on.hands/v1alpha1 kind: Microservice metadata: name: microservice-test labels: app: nginx spec: replicas: 2 image: nginx:1.17.6 ports: - containerPort: 80 serviceType: LoadBalancer • Abstracting the usual Deployment, Service and ConfigMap definitions using a simple and unified Microservice CRD
  • 24. Thank You ! JCON2020# www.jcon.one Our Partners 2020: Mario-Leander Reimer Principal Software Architect, QAware GmbH [email protected] https://www.qaware.de https://speakerdeck.com/lreimer/ https://github.com/lreimer/
  • 25. www.javapro.io Das kostenlose Profi-Magazin für Java Entwickler ! Powered by