+ All Categories
Home > Documents > Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor...

Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor...

Date post: 30-May-2020
Category:
Upload: others
View: 6 times
Download: 0 times
Share this document with a friend
38
Building an on-premise, multitenant serverless platform Murugappan Chetty Principal Engineer, Optum Scale 18x March 6th, 2020
Transcript
Page 1: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Building an on-premise, multitenant serverless platform

Murugappan ChettyPrincipal Engineer, Optum

Scale 18x

March 6th, 2020

Page 2: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

About Me

Murugappan ChettyServerless, Kubernetes, ISTIO, Opensource contributor, Federated monitoring

itsmurugappan

itsmurugappan

Page 3: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Agenda• Intro• Platform Details• Platform Management• Use Cases• Challenges• Demo• Q & A

Confidential property of Optum. Do not distribute or reproduce without express permission from Optum.

Page 4: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Why Serverless ?

Write Code Run App=

Wellness coaching

Quick care finder

Optum bank

Page 5: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Head and Tail Winds

Major on-premise workload

Compelling use cases

Mature container ecosystem

Cost effectiveness

Comparison with public offerings

Page 6: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Platform Details

Page 7: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Serverless Platform PrinciplesØ Scale to 0, Request based compute

Ø Container/kubernetes based

Ø Support all programming languages (Java, Go, Python, Shell ..)

Ø Low barrier of entry

Ø Observability

Ø Live and Learn!

Page 8: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

üFocus on business logic; Write functions (GO, python, PHP, node.js, ruby, java , .net etc.,)

üDefine function config and deploy functions

üInvoke the function URL ex: Code to URL

üForget servers!

ü Provision serverless platform and provides the URL to deploy code

ü Fully managed compute –provisioning, patching, scaling, monitoring, logging are provided by Ops team

ü Abstraction of servers away from the developer ex: K8s, istio

Operators Developers

{</>}

Personas

Page 9: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Confidential property of Optum. Do not distribute or reproduce without express permission from Optum.

EVENTING• Knative Eventing• Cloud Events

OBSERVABILITY• Prometheus• Kiali• Kubernetes logs• Jaeger/Zipkin

SERVING• Knative serving• Function/Service lifecycle

MULTITENANCY• Kubernetes Namespaces• RBAC

BUILD• Build Packs• Openfaas CLI• Jib / Ko / Fabric8• Tekton

SECURITY• ISTIO Policy• ISTIO RBAC• TLS• Keycloak

USER AGILITY• Inhouse• API & Swagger

• Provision namespaces• Function management• Apply security policies

• Comprehensive guides• KN cli

RESILIENCY• Chaos Engineering• Selfhealing automation• Cross data center load balancing

Platform Capabilities

Page 10: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Platform Components

Page 11: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

KubernetesWhat does it take to deploy a service today ?

• Need to write 2 manifests - deployment & service

• No per-request load balancing

• No traffic splitting

• Auto scaling limitations

• No concurrency control

Page 12: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Knative• Opensource – 400+ contributors, 60+ companies (Google, VMWare, IBM, Redhat, SAP, Pivotal …)

• Serving, Eventing

• Multitenant

• Main Components – Activator, Autoscaler, Controller, Webhook and Queue proxy sidecar

• Istio/Gloo for networking

• Only activator in the request path for initial calls

Page 13: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Knative – Serving Resources

Configuration

Current desired configuration

Revision

Immutable object. Point in time for code and snapshots

Route

Maps traffic to revisions

Page 14: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

ISTIO

Confidential property of Optum. Do not distribute or reproduce without express permission from Optum.

ISTIOIngress gateway

with SDS

Keycloak Cert-Manager

Knative Service pods

https://<svcname.nsnanme.domain>

Get Token

Envoy ProxyAuthn & Authz

DNS

F5

K8s-secret

Page 15: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Serverless Platform

API’s

Tenant space Management

Function management

Authz/Authn

Function tester

1. Abstracts k8s, istio and knative api’s2. Opinionated3. Unified developer experience4. Self service - eliminates the need for kubectl

and other cli’s5. Enforces standards

1. Resource restriction2. Run as non root user3. Function Versioning

6. CICD and Automation

Service Deployment made easy

Page 16: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Prometheus

Istio - cp kubernetes Knative - cp Knative – user metrics

Thanos Object Storage

Grafana

1 1 2 3

Metrics

Page 17: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Logs - EFK

Scrape user-container logs

Page 18: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Platform Management

Page 19: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Operator: Cluster Health and Capacity Planning

Proactive measurementKnow the platform health deteriorating before it is really happening.

Reactive monitoringAccurate and actionable alerts in time.

Self-healing

Capacity PlanningIdentify key resources

measure the utilization and performance

Collect Platform capacity consumption rate

Map and predict using dashboards and alerts

As an Operator, I want to know the resource consumption of the cluster to make fact based decision about capacity planning.

Page 20: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Operator: Cluster Monitoring and Self healing

Proactive measurement

Periodic job to validatethe platform

Extendable Probe utility tool

Predictive analysis

Reactive monitoring

Prometheus alerts

Grafana dashboards

Self-healing

Auto reboot of nodes when not ready

Auto release filesystem space pressure

As an operator, I want to ensure the platform is highly available, reliable, and serviceable

Page 21: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Developers: Users of this platform

Function Usage Metrics

Statistics about how many time my functions are invoked.

CPU and Memory usage

Health Check Statistics

Failure count

Successful count

Customer Involvement

Key customer needs to be involved in the design and use of the process.

As a developer, I want to see my function metrics, and health check statistics.

Page 22: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

User Agility

Page 23: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

User Agility – Build & Deploy• Build Packs• Tekton pipelines• Ko/Jib/Fabric8• Openfaas CLI• Inhouse Serverless Platform API’s• Kn cli

Page 24: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

User Agility - Observe• Grafana User Dashboards• Logs – Kibana, Kail

Page 25: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Use Cases

Page 26: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Infrastructure Automation

Page 27: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

File Processing – ESB Vs Serverless

Page 28: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Self Healing

Page 29: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

IOT

Page 30: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

ML UseCase - Benchmark{ "transactions": 51,"availability": 100.00,"elapsed_time": 299.17,"successful_transactions": 51,"failed_transactions": 0,"longest_transaction": 134.38,"shortest_transaction": 77.02

}

{ "transactions": 383,"availability": 100.00,"elapsed_time": 412.81,

"response_time": 25.49,"successful_transactions": 383,"failed_transactions": 0,"longest_transaction": 114.94,"shortest_transaction": 4.41

}

Page 31: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Other Use CasesUse Cases

Infrastructure Team API’s – Server info, network config etc

ETL Jobs

Voicemail processing

Serving ML models

Page 32: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Challenges

Page 33: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Challenges

Challenges Solution

DB Connections - No connection pooling Dedicated microservice for handling DB connections. GraphQL engine for data persistence and retrieval

Default resource allocation for pods Enforce users to set resources.

Cold starts Mitigate cold starts

Long running functions longer timeouts, microservices

Java functions Graal VM’s

Page 34: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Using Java on Serverless Platform

Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image

Quarkus: Kubernetes Native Java framework tailored for GraalVM and HotSpot, crafted from best-of-breed Java libraries and standards.

Developed by RedHat with the goal to make Java a leading platform in Kubernetes & Serverless

Designed to have “Supersonic” start up times and low memory footprint

Quarkus uses a single reactive engine for both imperative & reactive code

Page 35: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Final Thoughts

Timeout is configurable (can go as long as u want)

HPA doesn’t scale to 0

Cluster Local option

Stateful workloads and PVC’s

Back up

Eventing

kubeflow

Page 36: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Confidential property of Optum. Do not distribute or reproduce without express permission from Optum.

Questions

& Answers

Page 37: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Thank you!

Page 38: Building an on-premise, multitenant serverless platform...Using Java on Serverless Platform Poor Start Up & High Memory Ahead-Of-Time (AOT) & Native Image Quarkus: Kubernetes Native

Recommended