Slide 1

Slide 1 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Open Source India 2023 Write your Kubernetes Infrastructure as Go code with CDK for Kubernetes (cdk8s) Abhishek Gupta Principal Developer Advocate Amazon Web Services 1 @abhi_tweeter linkedin/in/abhirockzz

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. abhirockzz.github.io/about/ @abhi_tweeter linkedin/in/abhirockzz

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. I work on Kubernetes…. CNCF Landscape X

Slide 4

Slide 4 text

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

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. Manifests Assembly synth kubectl/GitOps CLI Kubernetes resources publish Publish packages Code repository Charts & constructs Source code code init Project cdk8s workflow

Slide 12

Slide 12 text

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

Slide 13

Slide 13 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 14

Slide 14 text

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

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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

Slide 17

Slide 17 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 ”hello world” cdk8s-plus custom constructs

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. Integrating with Kubernetes Custom Resource Definitions (CRDs)

Slide 19

Slide 19 text

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

Slide 20

Slide 20 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 21

Slide 21 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 22

Slide 22 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 URL shortener application

Slide 23

Slide 23 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. Recap

Slide 24

Slide 24 text

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

Slide 25

Slide 25 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 26

Slide 26 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.