Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real)...

18
Pulumi Infrastructure as (real) Code - Managing your K8s resources with Pulumi Johannes M. Scheuermann Stuttgart, 05. November 2018

Transcript of Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real)...

Page 1: Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real) Code - Managing your K8s resources with Pulumi Johannes M. Scheuermann Stuttgart, 05.

Pulumi

Infrastructure as (real) Code -

Managing your K8s resources with Pulumi

Johannes M. Scheuermann Stuttgart, 05. November 2018

Page 2: Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real) Code - Managing your K8s resources with Pulumi Johannes M. Scheuermann Stuttgart, 05.

• Cloud Platform Engineer

• Kubernetes

• Golang

• …

@johscheuer

Johannes M. ScheuermannMacht Dinge mit der Cloud ?

2

Page 3: Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real) Code - Managing your K8s resources with Pulumi Johannes M. Scheuermann Stuttgart, 05.

How do you deploy your code to Kubernetes?

3

Page 4: Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real) Code - Managing your K8s resources with Pulumi Johannes M. Scheuermann Stuttgart, 05.

So many choices (this list is not complete!)4

Page 5: Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real) Code - Managing your K8s resources with Pulumi Johannes M. Scheuermann Stuttgart, 05.

Fire and forget!

5

Page 6: Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real) Code - Managing your K8s resources with Pulumi Johannes M. Scheuermann Stuttgart, 05.

Creating Kubernetes resources

K8s API

“kubectl create –f ...“

„ACK“

Page 7: Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real) Code - Managing your K8s resources with Pulumi Johannes M. Scheuermann Stuttgart, 05.

Getting Feedback from K8s

K8s API

“kubectl rollout status ...“

„Waiting for deployment "todo-app" rollout to finish:

3 of 5 updated replicas are available... “

Page 8: Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real) Code - Managing your K8s resources with Pulumi Johannes M. Scheuermann Stuttgart, 05.

“Debugging”

K8s API

“kubectl get po –field-selector=status.phase!=Running“

„List of Pods that are not running“

Page 9: Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real) Code - Managing your K8s resources with Pulumi Johannes M. Scheuermann Stuttgart, 05.

Pulumi

● CLI in Golang● JavaScript/TypeScript, Python, Golang● Supports Kubernetes 1.5+● Gives direct feedback● Also supports AWS, GCP, Azure, Openstack

Page 10: Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real) Code - Managing your K8s resources with Pulumi Johannes M. Scheuermann Stuttgart, 05.

Pulumi and Kubernetes

● Kubernetes provider in JavaScript/TypeScript● Allows to mix cloud-infrastructure with deployments● Allows to define dependencies● Allows to define custom functions● Allows to use conditionals● Use Helm Charts● Combine Docker image build + deployment● Cascading Deployments

Page 11: Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real) Code - Managing your K8s resources with Pulumi Johannes M. Scheuermann Stuttgart, 05.

Do I need to rewrite everything?

11

Page 12: Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real) Code - Managing your K8s resources with Pulumi Johannes M. Scheuermann Stuttgart, 05.

Pulumi basics

● Pulumi manages projects● A Stack is an instance of your project● Pulumi can manage multiple stacks● A Stack uses packages (e.g. AWS, GCP, ...)● Each stack can be configured

Page 13: Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real) Code - Managing your K8s resources with Pulumi Johannes M. Scheuermann Stuttgart, 05.

Demo time!

13

Page 14: Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real) Code - Managing your K8s resources with Pulumi Johannes M. Scheuermann Stuttgart, 05.

Conclusions

● Looks like a nice alternative to terraform● Still in the early days● Up to date Kubernetes client● Nice to use all features from your IDE● Take a look at kubespy● Try it out

Page 15: Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real) Code - Managing your K8s resources with Pulumi Johannes M. Scheuermann Stuttgart, 05.

Questions?

15

Page 16: Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real) Code - Managing your K8s resources with Pulumi Johannes M. Scheuermann Stuttgart, 05.

Vielen Dank

Johannes M. Scheuermann

Cloud Platform Engineer

inovex GmbH

Ludwig-Erhard-Allee 6

76131 Karlsruhe

[email protected]

Page 17: Pulumi Infrastructure as (real) Code - Managing your K8s ... · Pulumi Infrastructure as (real) Code - Managing your K8s resources with Pulumi Johannes M. Scheuermann Stuttgart, 05.

Reading list

● https://blog.pulumi.com● https://www.pulumi.com● https://blog.pulumi.com/program-kubernetes-with-11-

cloud-native-pulumi-pearls ● https://github.com/pulumi/kubespy