Slide 1

Slide 1 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. D E V D AY A U G U S T 2 5 , 2 0 2 3

Slide 2

Slide 2 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Simplifying your Kubernetes infrastructure with AWS CDK for Kubernetes (cdk8s) Abhishek Gupta Principal Developer Advocate Amazon Web Services 2

Slide 3

Slide 3 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. abhirockzz.github.io/about/ @abhi_tweeter linkedin/in/abhirockzz

Slide 4

Slide 4 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 4

Slide 5

Slide 5 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. What I actually do?

Slide 6

Slide 6 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 6 YAML everywhere

Slide 7

Slide 7 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. …. using Agenda – Avoiding YAML 😉

Slide 8

Slide 8 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. I hope you find this (book?) useful 🙂 8 Chapters GitHub repository

Slide 9

Slide 9 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 9 AWS CloudFormation AWS Cloud Development Kit (AWS CDK) Infrastructure AS Code (IaC) Infrastructure IS Code

Slide 10

Slide 10 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Cloud Development Kit (CDK) for Kubernetes (cdk8s) An open-source multi-language framework for modeling Kubernetes resources as reusable components Go from code to config Define Kubernetes applications and architectures using familiar programming languages Cut, copy & paste Turn best practices into code libraries and share easily Run everywhere cdk8s runs locally and generates YAML you can deploy to any cluster, anywhere Java

Slide 11

Slide 11 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Demo – hello “cdk8s”

Slide 12

Slide 12 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Manifests Assembly synth kubectl/GitOps CLI Kubernetes resources publish Publish packages Code repository Charts & constructs Source code code init Project cdk8s workflow

Slide 13

Slide 13 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 13 cdk8s components 1 1 2 2 3 3 cdk8s code Conceptual diagram

Slide 14

Slide 14 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Improve productivity with cdk8s+ and Custom Constructs

Slide 15

Slide 15 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. cdk8s+ (plus) 15 🤯 Nodejs example

Slide 16

Slide 16 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. cdk8s+ (plus) 16 🧐 Go example

Slide 17

Slide 17 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Custom constructs Reusable Composable Enforce best practices 17 constructs.dev

Slide 18

Slide 18 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Demo – cdk8s-plus and custom constructs

Slide 19

Slide 19 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Integrating with Kubernetes Custom Resource Definitions (CRDs)

Slide 20

Slide 20 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Kubernetes Custom Resource Definitions (CRDs)

Slide 21

Slide 21 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Controllers for Kubernetes (ACK) O P E N - S O U R C E P R O J E C T F O R M A N A G I N G A M A Z O N R E S O U R C E S F R O M K U B E R N E T E S A P I kubectl apply ACK supported AWS Services Custom resource Amazon RDS database Amazon EKS

Slide 22

Slide 22 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. How do I use CRDs with cdk8s? 1. cdk8s import 🚀 2. Packages ready to use 🤯 3. Write code 🧑💻 4. cdk8s synth 💥

Slide 23

Slide 23 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Demo – cdk8s + ACK on EKS

Slide 24

Slide 24 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Manage Redis on AWS from Kubernetes

Slide 25

Slide 25 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. cdk8s and AWS CDK 🤝

Slide 26

Slide 26 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Paradigm Shift AWS CloudFormation CDK App Source Code Stack A Template A Template B AWS CloudFormation Stack B Parameterized Template Stack 1 Stack 2 CloudFormation Parameters and intrinsic functions CDK Typed OO language: loops, conditions, inheritence, etc

Slide 27

Slide 27 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. https://imgflip.com/i/7wijoy

Slide 28

Slide 28 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deploying apps to EKS with AWS CDK – the ”hard” way 😓 1 2 3

Slide 29

Slide 29 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. addManifest(….) CDK reference doc, godoc

Slide 30

Slide 30 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. addCdk8sChart(…) to the rescue! CDK reference doc, godoc

Slide 31

Slide 31 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Walkthrough – AWS CDK + cdk8s on EKS

Slide 32

Slide 32 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Removing Less YAML Infrastructure-as-Code Infrastructure-IS-code Write code (not YAML) Optimize (cdk8s+), Reusability (constructs), Extend (CRD) Combine with AWS CDK, and more. cdk8s recap

Slide 33

Slide 33 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Resources… 33 https://cdk8s.io/docs/latest/reference/ https://github.com/cdk8s-team/cdk8s/tree/master/examples/go/

Slide 34

Slide 34 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you! © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweeter linkedin/in/abhirockzz

Slide 35

Slide 35 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Please complete the session survey © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.