text
stringlengths
0
1.82k
• Importance of documentation in software development
• Shoutouts to Ben Johnson and BoltDB for excellent documentation
• The value of example code and projects in learning new concepts
• Wrap-up and show sponsor thank-yous
**Erik St. Martin:** Okay, we are back for another episode of GoTime. It is episode number 20. Today on the show we have myself, Erik St. Martin, we also have Brian Ketelsen here - say hello, Brian.
**Brian Ketelsen:** Hello!
**Erik St. Martin:** And Carlisia Thompson...
**Carlisia Thompson:** Hi, everybody!
**Erik St. Martin:** And our special guest today should not be unknown to anybody. He's really well-known in both the Go and Kubernetes community. Please welcome Kelsey Hightower.
**Kelsey Hightower:** Hey, I'm happy to be here.
**Erik St. Martin:** For those who may not be aware of who you are, would you like to give a little background on who you are and what you're working on?
**Kelsey Hightower:** Awesome! My background is I'm currently at Google, working on Google Cloud technologies, mainly around some open source projects that I've been a fan of for a very long time, mainly Golang and Kubernetes, which is kind of a distributed systems framework for doing Google-style deployments - that's ...
I consider myself a syst admin who can code.
**Erik St. Martin:** \[unintelligible 00:01:32.18\] the syst admin part; you're more a syst admin than a coder.
**Kelsey Hightower:** Well, for the last five years I've been doing primarily full-time development amongst other development roles, but I also started my career as a system administrator, so I always bring that level of thinking into it. If I'm writing code that I'm going to connect to a database, I'm going to impleme...
When I'm writing code these days, I'm always keeping that... Not just building the app, but who has to actually manage the app and what does that side look like? I'll never forget where I started in tech.
**Brian Ketelsen:** Doesn't that kind of fit into the serverless category? Everybody's talking about serverless computing, which drives me insane; I think we've covered that a couple times. Don't we have opsless now, where you're just throwing it over the wall to Kubernetes and nobody has to worry about it?
**Kelsey Hightower:** Yeah, so to me Kubernetes is what happens when ops people take their expertise and codify it into a system. To be honest, it's gonna take ops people or someone in an operational role to deploy Kubernetes and keep that running and upgrade it. We saw that from an announcement today about the whole P...
So you always have ops, but I think even in a system like Kubernetes where you're not necessarily interfacing with an operations person to get a deployment done - you kind of have an API for that - but there's still some operational thing that you can do to leverage even a system like Kubernetes. The way you log, the w...
**Erik St. Martin:** And learning to create abstractions - that's one of the beauties of Kubernetes... We've had the virtual machine world for a while, that kind of started getting people used to being abstracted from the physical hardware, and now we're starting to be able to abstract people more from kind of the clus...
\[00:03:47.08\\\] But like you said, you still have to focus on how you retry your logic and making sure that you're doing things in an item-potent manner, but you don't have to be so concerned with your failover strategies and scaling as much, because a lot of that is handled for you.
**Kelsey Hightower:** Yeah, I think Kubernetes can really appear to people kind of like the Go runtime. Most people don't even know the Go runtime is there; they have the statically linked binary, and a lot of people forget that the Go runtime just happens to be embedded in there and handles the garbage collection. It ...
Just like we do in the programming world, I think Kubernetes represents putting a runtime on top of infrastructure.
**Erik St. Martin:** That's actually a really interesting way to look at it.
**Brian Ketelsen:** I've heard several people on Twitter talking about Kubernetes almost being analogous to the Linux Kernel of the cloud. How do you feel about that concept?
**Kelsey Hightower:** Yeah, it's one I repeat quite a bunch. I think Mesosphere really made that term popular. I've read about it years ago in a white paper from Urs at Google about the data center as the computer, and if we're starting to subscribe to that notion - the data center as the computer - then it needs a ker...
On a UNIX system you launch an application and it will bind to a socket. In Kubernetes, a deployed application can create a load balancer with a public IP address, and clients can bind to that. We wanna scale out... On a machine you can create multiple processes; in things like Kubernetes we have APIs for that. On a UN...
I think Kubernetes does a great job of fulfilling the contract between hardware, in this case multiple computers, and software - your application running in the cluster.
**Brian Ketelsen:** So what do you think it is about Go that makes Kubernetes so special? Do you think there is a good relationship between the fact that Kubernetes is awesome software and it's written in Go?
**Kelsey Hightower:** Yeah, I think a lot of people... The programming language, or even the spoken language - my wife is a bit of a linguist herself and she does ESOL here in Portland; I think the language and the community that surrounds those languages influences the way you think and build things. In the Go world i...
The other benefit is most of the tools we rely on in Kubernetes - Etcd, Docker, some of the other plugins - it just so happens that they are also written in Go. So we have this strong ecosystem that makes Kubernetes special, mainly the community, and most of them have Go skills either from Docker, Etcd, and those skill...
**Erik St. Martin:** \[00:08:01.28\\\] I think Flannel is also written in Go, isn't it?
**Brian Ketelsen:** Yes.
**Kelsey Hightower:** Yeah, Flannel... Pretty much every tool in the stack - Weave, Prometheus, InfluxDB... You name it; almost everything that's being used, even Fluentd, I believe. So it's across the board, we seem to just land on tools with little effort just happen to have a chance that they're written in Go. Vault...
**Carlisia Thompson:** So are you using a plugin architecture for Kubernetes?
**Kelsey Hightower:** With Kubernetes we embrace the whole distributed system model. There are parts of Kubernetes that do have a plugin model. If you think about the agent that runs on the machines, there's somewhat of a plugin model there. We interface with different container runtimes - Rocket or Docker. On the API ...
We like to think of plugin models as two different things. Some things that are local to a particular component or service, you'll see more of an in-process, in co-base plugin model to extend the system, but we're moving more and more towards a model where all functionality extensions could be done with external binari...
**Carlisia Thompson:** Gotcha.
**Erik St. Martin:** Yeah, so when you look at Kubernetes from kind of like a generic perspective, there's resources that are managed, and then there's generally some sort of service or component that's responsible for watching, Etcd, for changes to that resource, and then reconciling the cluster - updating the pod or ...
So to Kelsey's point, you'd have a pod that's been submitted to the API and it's sitting there and it doesn't actually have a pod running. Well, the system notices that that's been added to Etcd, and then the scheduler basically finds the ideal node to put it on, and then it finds the resource that's in Etcd to that no...
Another concept is a replication controller. It kind of sits a layer above a pod and says how many of those you need to have running. There's basically just a loop that's running and watching for changes to the cluster, and basically queries a label to see how many of them are running, and then fires up another pod. So...
**Kelsey Hightower:** Yeah, I think if we draw connections to the Go community, it's just like some function returning your channel. The implementation details about what's coming through that pipe, that's implementation detail, and I think the observer - just like in Kubernetes, these objects can be observed. So if yo...
**Brian Ketelsen:** \[00:12:10.23\\\] Kubernetes was one of the first times that I saw a system where you described resources in a desired state, and saw that reconciliation process in the background. That's really interesting to me. Have you seen patterns like that prior to Kubernetes, where you say "This is what I wa...
**Kelsey Hightower:** I think we've seen this in a lot of somewhat declarative systems with a DSL in front, like Puppet, CFEngine, Chef - all of those tend to have an intermediate state where you as a user, and in those cases infrastructure as code, you would write in these DSLs, and they had a compiler that would comp...
In other systems, even though you have this desired state idea where you would write code in one language, it would be compiled to something else that will be consumed by the agent running on the machine - those are always in some kind of loop, of like "Every 30 minutes go check back for a new version of the user's des...
**Erik St. Martin:** Yeah, my brother actually just messaged me - a prime example of that would be Ansible, right? You're setting a desired state of what a file should look like, or what packages should be installed, and things like that, and it tries to reconcile state. But again, that's not real-time, it's not reacti...
**Kelsey Hightower:** And it's also not declarative in many ways, because usually with Ansible if you were to put a resource let's say to add a file to a system, the first run of Ansible with that declaration in your Ansible playbook and you run it, the file would be created on the other side. But if you were to remove...
I think the difference with Kubernetes is that we handle and we store all the state of the world for the entire cluster, so when something gets removed, we know exactly what to do to clean it up. We have the entire view of the cluster in a central place.
**Erik St. Martin:** And I've been finding it really interesting to work with some of these concepts and start thinking about building applications in those terms, and the concept of label and things like that, where you can make your containers and pods attracted to some nodes, and repelled by others. Now with 1.4 I g...
\[00:15:55.11\\\] As an example - this is actually kind of streaming cable... A soft label would be that any of these nodes are capable of running this particular video stream, but they're preferred on these nodes. Basically, you could have a hard requirement on a label for a given zone or collection of machines, and t...
It's really interesting to be able to do that by just applying labels to a machine, and you can do that with public vs private clouds and stuff like that, where you could try to run in your private, but move onto public.
**Kelsey Hightower:** Yeah, that's right. Kubernetes is definitely meant to put, like we said, that runtime on top of a set of machines. It doesn't matter if those machines are a Raspberry Pi cluster under your desk, or some cloud provider, or your own bare metal machine. Kubernetes really makes sure that we stick to t...