Slide 1

Slide 1 text

How to Become a Gophernetes Gianluca Arbezzano / @gianarb

Slide 2

Slide 2 text

K8s is Hard and there’s nothing wrong with that

Slide 3

Slide 3 text

What is a Gophernetes? What does it look like?

Slide 4

Slide 4 text

What is a Gophernetes? • Develop applications running in Kubernetes • Develop Kubernetes • Develop on the Kubernetes Foundation

Slide 5

Slide 5 text

What does it look like?

Slide 6

Slide 6 text

Where are they? • Kubernetes Slack • GitHub around the kubernetes or kubernetes-sigs organization

Slide 7

Slide 7 text

https://kubernetes.io/docs/concepts/architecture/cloud-controller/ 


Slide 8

Slide 8 text

https://kubernetes.io/blog/2018/07/18/11-ways-not-to-get-hacked/ 


Slide 9

Slide 9 text

https://github.com/kubernetes/website/blob/master/content/en/blog/_posts/2017-11-00-Containerd-Container-Runtime-Options-Kubernetes.md 
 


Slide 10

Slide 10 text

Extensibility is the key Kubernetes is a blob of APIs ● API Server ● CRI (Container Runtime Interface: docker, containerd) ● CNI (Container Networking Interface: calico, flannel) ● CSI (Container Storage Interface: aws-ebs, packet-csi) This is how it abstracts your workflow from your infrastructure API Server kubelet CSI CNI CRI

Slide 11

Slide 11 text

About Me
 Gianluca Arbezzano • Gophernetes at Packet.com • www.gianarb.it / @gianarb What I like: • I make dirty hacks that look awesome • I grow my vegetables • Travel for fun and work

Slide 12

Slide 12 text

Workflow? Workflow is the reason behind why we have Kubernetes. It is the end goal for any good Gophernetes. Being able to leverage kubernetes extendibility to implement the best workflow you can even image. Examples of workflows: ● Troubleshooting and debugging ● Observability (data pipeline for logs, metrics, traces) ● Delivery (canary release, blue green deployment, progressive delivery, your own one)

Slide 13

Slide 13 text

Workflow The Gophernetes is the limitation. It means that in theory with good code you can whatever you image

Slide 14

Slide 14 text

Extensibility is the key

Slide 15

Slide 15 text

• Event system • Share informers • Custom Resource Definitions • Kubecutl plugin • ClusterAPI (Packet implementation is under active development! Watch out!) How do you extend Kubernetes in practice?

Slide 16

Slide 16 text

Gophernetes toolchain • kubernetes/client-go • kubernetes/cli-runtime • kubernetes-sigs/kind

Slide 17

Slide 17 text

Kubectl Plugin $ cat > /usr/local/bin/kubectl-hello #!/bin/bash echo "this is a simple kubectl plugin. But gophernetes can do better, because this is bash..." ^C $ chmod +x /usr/local/bin/kubectl-hello $ kubectl hello this is a simple kubectl plugin. But gophernetes can do better, because this is bash...

Slide 18

Slide 18 text

Shared Informer https://gianarb.it/blog/kubernetes-shared-informer

Slide 19

Slide 19 text

The UX is crucial. Keep it as close as possible with the Kubernetes one...

Slide 20

Slide 20 text

Authentication

Slide 21

Slide 21 text

Flags Companies and teams invests a lot of time learning kubernetes and its cli.
 Tools developed to Gophernetes has to keep the same flavour. It should be the same as running a bike, does not matter which one you own, it always looks familiar.

Slide 22

Slide 22 text

Flags: github.com/kubernetes/cli-runtime This library is a shared dependency for clients to work with Kubernetes API infrastructure which allows to maintain kubectl compatible behavior. Its first consumer is k8s.io/kubectl.

Slide 23

Slide 23 text

Flags: kubectl-profefe uses it as well My expectations as a kubernetes user for examples are (at least): ● When I have to do filtering ○ Label Selection: -l app=dev -l runtime=1.14 (--selector) ○ Namespace selection: -n namespace (--namespace) ○ -a (--all-namespaces) ● When it comes to authentication ○ --kubeconfig ● Output ○ -o yaml | json (--output)

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

• kubernetes-sigs/krew-index • kubernetes-sigs/krew Krew makes plugins easy to install and discover $ kubectl krew install profefe
 $ kubectl krew install tree
 $ kubectl krew install ctx


Slide 26

Slide 26 text

The CLI runtime contains utils to print tables from cli, but I didn’t use it yet!

Slide 27

Slide 27 text

Production is a dangerous place.
 Usually hard to work with (reasonable)…


Slide 28

Slide 28 text

Kubernetes gives you for free a couple of things: • As we saw, a consistent API and a solid ecosystem to interact with it • Authentication (that you can plug with your identity management) • Authorization with RBAC • Audit logs Why?

Slide 29

Slide 29 text

• Kubernetes Assemble • https://get.oreilly.com/ind_extending-kubernetes.html • Programming Kubernetes: Developing Cloud-Native Applications • Krew kubectl plugin index • jtblin/kube2iam • https://gianarb.it THANKS LINKS

Slide 30

Slide 30 text

Thanks @gianarb / gianarb.it