Share
Embed
mwnewsletter202007-serverless.pdf
16yuki0702
June 23, 2020
Transcript
21 slides
-
Service Microservice Function > 単一の目的 > ステートレス > 独立してスケーリング >
自動化 > 単一のアクション > エフェメラル > 自律的 > 疎結合 サーバーレスアーキテクチャへの進化 f( ) -
どんな環境でも 実行可能 イベント駆動アプリ ケーション ビジネスロジックに 集中 柔軟な スケーラビリティ 必要な時に必要なだけコンテナ化されたコードを実行 •
イベントベースでオートスケール • 使われていない時は0へスケール サーバーレスの価値 -
OpenShift Serverless • 0からNへオンデマンドにスケーリング • 複数のイベントソースを持つ強力な イベントモデル • どのコンテナワークロードも サーバーレスとしてデプロイ
• Knativeベースでベンダーロックイン無し • OperatorHubより利用可能 -
各レイヤーの役割と動作するコンポーネント Traffic routing Network resilience Security Kubernetes Istio Tekton Knative
Camel-k Declarative programming Event orchestration Activation & scale-to-zero Service binding アプリケーション レイヤー インフラレイヤー Continuous integration GitOps Continuous delivery Routing and Transformation Technology Adaptors Error Handling Development Patterns Provisioning Scheduling & deployment Scaling & service discovery Monitoring & recovery -
SERVING イベントドリブンでコンテナアプリ ケーションを実行するモデル。ゼロ にもスケールする。 イベントのConsumer/Producer共 通基盤として動作。 EVENTING Image https://unsplash.com/photos/qXakibuQiPU Knativeの機能
※OpenShift Serverlessでは EventingはまだTP -
• コードと設定 (Config) の分離 • 不変のリビジョン • オートスケーリング(未使用時には0にもなる) • トラフィックの分割
• 簡単かつ合理的なデプロイメントモデル ◦ 単一のポート ◦ 単一のコンテナ ◦ No PersistentVolumes • Knative eventingから呼び出し化 Knative Servingのコンセプト -
• Configurations アプリケーションイメージと その構成を定義、変更した分だけRevision として残る • Revisions コードと設定の不変なスナップ ショット •
Routes 特定リビジョンに対するingressを定 義、配分指定化 • Services RoutesとConfigurationのセット を管理するトップレベルエンティティ (k8sの Serviceとは別物) Service Route Configuration Revision Revision Revision manages Routes traffic to records history of 10% 90% Knative ServingのResources -
apiVersion: apps/v1 kind: Deployment metadata: name: lotto spec: replicas: 1
selector: matchLabels: app: lotto template: metadata: labels: app: lotto spec: containers: - image: cds19/lotto name: lotto ports: - containerPort: 8080 apiVersion: serving.knative.dev/v1alpha1 kind: Service metadata: name: lotto spec: replicas: 1 selector: matchLabels: app: lotto template: metadata: labels: app: lotto spec: containers: - image: cds19/lotto name: lotto ports: - containerPort: 8080 K8sの Service ま たは Ingress/Route が不要に! Knative Servingとk8sを比較 ※他にもHPAの設定等が減らせる為、 Vanila k8sと比較して記述量が大幅に減る -
マイクロサービス, ファンクション, アプリケーション + イベント = OpenShift Serverless 12 Microservices
Functions Apps Containers Infrastructure & Scheduling Containers Infrastructure & Scheduling Events Infrastructure -
サーバーレスコンテナ ユースケース1 : スケジューリングされたCron job 毎時 毎日 毎週 毎月 請求書発行
PDF変換 E-mail 領収書 データ取得 Crunchy data -
Monolith Cloud Native Microservices Serverless Event-Driven Architecture サーバーレスに適切なランタイム = Quarkus
- Kubernetes Native Java Istio Knative -
Container First REST + CRUD Quarkus + GraalVM 0.055 Seconds
Quarkus + OpenJDK 2.5 Seconds Traditional Cloud-Native Stack 9.5 Seconds 最初のレスポンスまでの時間も従来の Java Stackと比較して大幅改善 REST + CRUD Quarkus + GraalVM 35 MB Quarkus + OpenJDK 130 MB Traditional Cloud-Native Stack 218 MB “起動時間は 1分 から 400ミリ秒に” -
Other public clouds Red Hat Advanced Cluster Manager for Kubernetes
Edge Bare Metal Virtual Private Cloud Everything-as-a-Service ISV Containers and microservices AI/ML Analytics Serverless Red Hatで実現するハイブリッドクラウド環境 f( ) -
より深く学びたい方へ OpenShift Serverless Build and deploy serverless applications using an
event-driven infrastructure on Red Hat® OpenShift® Tutorial Get started with your serverless journey Knative Blog series Knative: Serving your Serverless Services https://www.openshift.com/learn/topics/serverless