uma perspetiva de futuro no cloud native hat forum lisboa/pdf/05.pdf · building a cloud native app...
TRANSCRIPT
Uma perspetiva de futuro no desenvolvimento de aplicativos Cloud Native
Carlos Vicens AlonsoAppDev Specialist Solution ArchitectRed Hat
Carlos Vicens AlonsoAppDev Specialist Solution ArchitectRed Hat
RED HAT FORUM 2019
Introductions
Alberto torresSolution ArchitectMadrid, Spain
Carlos VicensSpecialist Solution ArchitectMadrid, Spain
RED HAT FORUM 2019
01. What’s a Cloud Native App?02. Challenges to build Cloud Native Apps
03. What tools can I use to build Cloud Native Apps effectively?04. Building a Cloud Native App today and tomorrow
05. Demo
Índice
RED HAT FORUM 2019
01. What’s a Cloud Native App?How different are from the other apps?
RED HAT FORUM 2019
Cloud Native App
Cloud-native applications are a collection of small,independent, and loosely coupled services.
They are designed to deliver well recognized businessvalue, like the ability to rapidly incorporate userfeedback for continuous improvement.
In short, cloud-native app development is a way tospeed up how you build new applications, optimizeexisting ones, and connect them all together. Its goal isto deliver apps users want at the pace a business needs.
CONFIDENTIAL 2019 RED HAT TECH EXCHANGE
Wait, wait, wait, wait!
First things first
What does Cloud Native mean?
RED HAT FORUM 2019
Cloud Native
❏Born and raised in the Cloud?❏ Prepared for the Cloud?❏Runs on a Cloud?❏ It’s made of Cloud?
RED HAT FORUM 2019
CONFIDENTIAL 2019 RED HAT TECH EXCHANGE
NO, Seriously… you can do better
RED HAT FORUM 2019
Cloud Native
The first time I heard this term…
it meant ready to run on a public cloud takingadvantage of it.
And there were some challenges there thatmade running apps in the cloud ‘different’
CONFIDENTIAL 2019 RED HAT TECH EXCHANGE
You mean, Cheap linux boxes running VMs that could (would) break eventually?
RED HAT FORUM 2019
Cloud Native
Yessss…
I’d say that in order to be cloud native you haveto take that into account… you’re app needs tobe ready for your VM to disappear!
So...
RED HAT FORUM 2019
● Don’t store data (unless temp) in your VM…● Make them light● Be ready for different latencies across the globe…● Have a golden image you can use over and over to
deploy copies?● ...
Cloud Native
CONFIDENTIAL 2019 RED HAT TECH EXCHANGE
VMs… it sounds a bit rusty… doesn’t it?
RED HAT FORUM 2019
Well… yes… maybe there’s a better way to cope with these challenges...
CONFIDENTIAL 2019 RED HAT TECH EXCHANGE
Containers maybe?Kubernetes perhaps?
RED HAT FORUM 2019
Cloud Native Apps as per CNCF
Cloud native technologies empower organizations to build and run scalable applications in modern, dynamic environments such as public, private, and hybrid clouds. Containers, service meshes, microservices, immutable infrastructure, and declarative APIs exemplify this approach.
CONFIDENTIAL 2019 RED HAT TECH EXCHANGE
In simple (even rude) terms a cloud native app should be scalable, consistent, resilient and
capable of running in public, private or hybrid CLOUDS... (sMALL as a microservice?)
RED HAT FORUM 2019
Clour Native Apps need to scale in a cloud environment, potentially from zero to thousands of instances…
In general the key metric in cloud environments is memory-time, for instance 400,000 GB-SECONDS
Cloud Native Apps
So your apps should use as less memory as possible the shortest possible time
RED HAT FORUM 2019
02. Challenges to build cloud native appsOr how easy is looks until you really have your
hands dirty...
RED HAT FORUM 2019
03. Red Hat Tooling to help with these challenges
RED HAT FORUM 2019
RED HAT FORUM 201923
A stack to write Java apps
Cloud Native, Microservices, Serverless
RED HAT FORUM 2019
WHAT MAKES QUARKUS DIFFERENT?
CompileProvision(curate)
Wiring & Assemble(augment) AOT Native
Compilation
Hotspot Runnable & Image
Native Executable & Image
app.jar frameworks
Runnable java app
Native-app(GraalVM)
RED HAT FORUM 2019
REST + CRUD
Quarkus + GraalVM 0.055 Seconds
Quarkus + OpenJDK 2.5 Seconds
Traditional Cloud-Native Stack 9.5 Seconds
REST + CRUD
Quarkus + GraalVM
35 MBQuarkus + OpenJDK
130 MBTraditional Cloud-Native Stack
218 MB
SUPERSONIC SUBATOMIC JAVA
RED HAT FORUM 2019
A cohesive platform for optimized developer joy:
● Based on standards, but not limited
● Unified configuration
● Zero config, live reload in the blink of an eye
● Streamlined code for the 80% common usages,
flexible for the 20%
● No hassle native executable generation
Quarkus is designed for Developer Joy
RED HAT FORUM 201927
Best of Breed Frameworks & Standards
Eclipse Vert.x Hibernate RESTEasy Apache Camel Eclipse MicroProfile Netty
Kubernetes OpenShift Jaeger Prometheus Apache Kafka Infinispan
RED HAT FORUM 2019
Key Features
●
●
●
●
●
●
●
Learn more
https://openshift.com/learn/topics/serverless
https://redhat-developer-demos.github.io/knative-tutorial
Developer Console in 4.2
●
●
OpenShift Serverless - Lifecycle
CHE/VSCODE/IDE TEKTON KNATIVE SERVING
User Application(Service)
REVISION 1
REVISION 2
REVISION 3
"Hello!"
CODE v1
CODE v2
"Hello World!"
CODE v3
"Hello World, ${user}!"
BUILD RUN RUNCODE BUILD
10%
10%
80%PIPELINE
PIPELINE
PIPELINE
RED HAT FORUM 2019
RED HAT FORUM 2019
OpenShift PipelinesCloud Native CI/CD
Based on the Tekton project
(which was spun out of the
Knative Pipelines project)
started by Google, Red Hat
and others. Provides a next-
gen Kubernetes CI/CD
pipeline that works for
containers (including
serverless).
Tech Preview4.3
RED HAT FORUM 2019
RED HAT FORUM 2019
Goal: Help developers find the tools to get the most out of our
platforms.
Red Hat CodeReady Workspaces (supported Eclipse Che)
Red Hat CodeReady Containers (local laptop install of OpenShift 4)
Red Hat CodeReady Studio (ex-DevStudio)
Red Hat CodeReady Builder (tools for building on RHEL)
Red Hat CodeReady Toolchain (a hybrid cloud devops toolchain)
The Red Hat CodeReady
PortfolioA Sub-Brand for Developers
GA (3.x and 4.x)
Beta
GA
GA
Pre-Alpha
RED HAT FORUM 2019
Dev Console For OpenShift
GAOpenShift 4.2
Kubernetes Extension Improvements
●
●
○
○
○
OpenShift Improvements
●
●
●
GA3.x and 4.x
CONFIDENTIAL 2019 RED HAT TECH EXCHANGE
CodeReady Containers: OpenShift on your Laptop
Desktop virtualization
Red Hat Enterprise Linux OpenShift
Use It To: Simplify direct-to-OpenShift development on laptops.
$ crc setupPrepare your machine for running OpenShift
$ crc start -b crc-hyperkit-4.2.0.crcbundleStart with the Hyperkit 4.2 bundle
$ crc statusGet the status of the cluster
CodeReady ContainersGA in OpenShift 4.2
CONFIDENTIAL 2019 RED HAT TECH EXCHANGE
odo - OpenShift’s Dev-Focused CLI
Developer focused clients
$ odo create wildfly backendComponent ‘backend’ was created.
$ odo pushPushing changes to component: backend
$ odo create php frontendComponent ‘frontend’ was created.To push source code to the component run ‘odo push’
$ odo pushPushing changes to component: frontend
$ odo url createfrontend - http://frontend-myapp.192.168.99.100.nip.io
$ odo watchWaiting for something to change in /dev/frontend
Developer-focused CLI for rapid development iterations on OpenShift
Simplifies building of microservices applications on OpenShift.
Use It To: Enable the ‘git push’ flow developers love, but with OpenShift Kubernetes.
GAOpenShift 4.2
RED HAT FORUM 2019
Just click a link and start coding, running, or debugging.
Red Hat CodeReady Workspaces
Based on Eclipse Che 7
● Kubernetes-based developer workspaces: Fully
containerized developer workspaces allowing to bring
your K8S application runtime easily in your dev
environment.
● New Editor: New default web-based editor provides a
VSCode like experience in the browser.
● Devfile: Configure a devfile for your project and get
reproducible and portable developer environments.
● VSCode plug-ins compatibility
● Swappable Editor
● OpenShift VSCode Plug-in
● Easier to Monitor and Administrate: Prometheus and
Grafana dashboards.
Shipped independently from 4.2, targeted for Oct 29
RED HAT FORUM 2019
Hosted Eclipse Che on OpenShift
● Learn to build cloud-native
applications on OpenShift.
● Use Eclipse Che or CodeReady
Workspaces for on-premises
environments.
Try it now at che.openshift.io
Develop, Debug, Test from your browser
A suite of dev tools and services, and support DevOps for development and deployment of cloud-native applications on OpenShift
Create, build, test, deploy cloud-native applications
Based on OpenShift
App Dev Experience
Red Hat CodeReady Toolchain
Focus on delivering business value, around a trusted source
Open Integration
Leverage existing investment in tools and processes
Dev Tools & Services
In Development
RED HAT FORUM 2019
VS Code and Red Hat?
● Our first extension (for Java language support) was published in Sept, 2016 as an experiment.
● 3 years later, it’s been downloaded over 20 million times by over 3.5 Million developers!
● Added extensions for Java, XML, Yaml, etc., or when working with OpenShift, EAP, Fuse or other Red Hat technologies.
● Upcoming: Extensions for Quarkus and Tekton
RED HAT FORUM 2019
Now you can create a new project right from a user interface in VS Code. This can be done through a new wizard that generates Maven-based Quarkus projects with the latest version of Quarkus.
The new VS Code extension is dependent on a couple of Java extensions for VS Code, so it is recommended that you have the Java Extension Pack installed.
Quarkus Extension for VS Code
RED HAT FORUM 2019
CodeReady Analytics
Analyzes application stack for open source vulnerabilities, licenses, popularity & maintainability.
Analyze, Report, Update directly from IDE
Simplifies adoption of secure and high quality open source components.
RED HAT FORUM 2019
05. DemoHere comes the fun part!
RED HAT FORUM 2019
Adding PostgreSQL
to the mix
Demo 1
JVM mode: ./mvnw -DskipTests clean packageNative (BIN): ./mvnw -DskipTests clean package -PnativeNative (IMG): … -Dnative-image.docker-build=true
Start creating a
Quarkus scaffold
mvn io.quarkus:quarkus-maven-plugin create
+Logging,
+DI, ...
a) java -jar ./target/atomic-...jarb) ./target/atomic-...runnercurl http://localhost:8080/fruit
mvn compile quarkus:dev
Hot reloading
Fast iteration
oc new-app … postgresql-persistent
mvn quarkus:add-extension -Dextension="quarkus-resteasy-jsonb, …orm-panache"
oc -n ${PROJECT_NAME} port-forward svc/my-database 5432mvn compile quarkus:devcurl http://localhost:8080/fruit
mvn compile quarkus:dev -Dquarkus.profile=cheLive redirection to 8080 fro the Internet!
mvn quarkus:add-extension \-Dextension="health, openapi"
RED HAT FORUM 2019
Demo 2
oc apply -f https://raw.githu…/openshift-deploy-app-task.yaml oc apply -f https://raw.githu…/s2i-quarkus-task.yaml
Building the image
using S2I on OCP
oc new-app quay.io/…-native-s2i~https://github.com/…-fruit-service \--name=atomic-fruit…
oc expose svc/atomic-...
curl http://$(oc get route atomic-fruit-service-native | awk 'NR > 1 { print $2 }')/fruit
oc apply -f https://raw.githu…/atomic-fruit-service-build-pipeline.yamloc apply -f https://raw.githu…/atomic-fruit-service-deploy-pipeline.yaml
oc apply -f https://raw.githu…/atomic-fruit-service-resources.yaml
tkn pipeline start atomic-fruit-service-build-pipeline \
-r app-git=atomic-fruit-service-git \-r app-image=atomic-fruit-service-image \-p APP_NAME=atomic-fruit-service \-p NAMESPACE=${PROJECT_NAME} \-s pipeline
oc apply -f https://raw.githu…//atomic-fruit-knative-service.yaml
RED HAT FORUM 2019
FRASE DESTACADA
MUCHAS GRACIAS