text
stringlengths
0
1.8k
**Muvaffak Onuş:** So Terrajet - when we first started with Terrajet, we had hit a problem with APIs, so we were handling that many CRDs, actually.
**Gerhard Lazu:** Right.
**Muvaffak Onuş:** \[01:07:52.20\] When you install 700 CRDs, API showed our guests were responsible for 40 minutes or something, which affects all the workloads that it was supposed to schedule. So we have fixed that problem; there was a patch and we accelerated some of the processes in upstream. So now, we are able t...
In January, we will have a big splash of announcements. We'll announce AWS, Azure and GCP providers, Jet providers with their API group stabilized, conflicts are stabilized, and API fields are stabilized. And then we will start making some of the resources we want better one. Which has more guarantees around that.
Then we will have commercial WebHooks in Crossplane, which will affect how easily we can make a resource, let's say, that you're not happy with the implementation in Terraform provider; you can just switch to native implementation, with API calls directly to AWS.
**Gerhard Lazu:** Okay.
**Muvaffak Onuş:** So all this new stuff that will allow community to bootstrap new providers, and make upstream work with them. It's just so many CRDs, and built easily, that you won't have a problem like "Hey, is this resource supported?" Well, yes. Probably. Instead of, you know, let me take a look how hard it would...
**Gerhard Lazu:** I do have to say, having gone from nothing - like, I knew nothing about how to implement a Crossplane provider - to using Terrajet... That was really smooth. I think anyone that is determined to write a Crossplane provider that doesn't exist yet, and there is a Terraform provider which exists - ours, ...
**Muvaffak Onuş:** Yeah. I mean, in fact, we had a case where someone in the community - the provider Exoscale, you saw... That was actually written in six hours.
**Gerhard Lazu:** There we go. Amazing.
**Muvaffak Onuş:** And also, that was the hardest part, bootstrapping the provider. If you, for example, decide to add an instance resource to Jet Linode provider, it's 10 or 15 lines of code as you see like the single configuration.
**Gerhard Lazu:** Yeah, that's right. So all the commits are there, go and check them, see what we've done for provider Jet Linode. Again, it's very, very simple. So what I would like to do now is show you how easy it is to actually do this. And I say "show" because we record video, and we may not have time to publish ...
So this is what we're going to do next - we're going to install Crossplane, install the provider, and then provision the Linode Kubernetes Engine cluster using this provider. Then we target it, and then we try something crazy. You know that I'm all for crazy, trying crazy things and seeing what happens... So that's wha...
Okay, so I am in the 2021 directory currently, and I'm going to do -- I'm already targeting our production Kubernetes clusters. Oh yes, of course - Muvaffak, when I mentioned this to you first, like I develop in production, you laughed... But I'm serious. \[laughs\] That is the only thing that matters. If it's not in p...
So make, in this case, LKE Crossplane. And what that does - that installs Crossplane version 1.5.1, using Helm, straight into production. So installing Crossplane... Two minutes later, it's done. That's how simple it is.
The next step is make Crossplane Linode provider, and that's it. That's simple. That was really quick, because the provider is super-small. Like 18 kb, I've seen the image; which then pulls a bigger image. How does that work, can you tell us?
**Muvaffak Onuş:** \[01:11:58.12\] Yeah. So the better data image, it said it was CI image, but where has only the meta data YAML, that contains your CRDs, and also some information about your package. Once it's downloaded by the package manager, it installs the CRDs and then creates a deployment with the image that yo...
**Gerhard Lazu:** Okay. And which version did we install of the provider? Version 0.0.0-12. So there's no tag for this. This is like a dev-only version. We trust dev in production. The dream is real. Production became dev. Great.
Okay, so we installed it, we configured it, it's all there. So how can we check that the provider is there? If we maybe get all the pods in the namespace, Crossplane system? Because that's where everything gets installed. We see that we have Crossplane installed, we have the Crossplane RBAC manager - these are two pods...
If we go to Cluster, to list out clusters, we have no clusters. Great. Let's do "Make Crossplane LKE." All this does - I still have to run a command, okay... I know what I mentioned earlier, there will be no commands, but this is a different type of command. I'm not telling the Linode API "Hey, Linode, create me an LKE...
Okay, so this succeeded. What are we seeing now? We are seeing that 42 seconds ago a new LKE 2021, 12, 17 - by the way, it's the 17th of December when we are recording this... It just uses the current date when this new cluster has been created, or it's asked to be created.
So if we go to Linode, and if we go to our Kubernetes lists, we see a new cluster which is Kubernetes version 1.22. Nice. I'm wondering, could that be our new production cluster for 2022? If you could see me, I'm winking; yes, it will be. 1.22 Kubernetes will be the first version of our production 2022 Kubernetes clust...
Okay... So did it work? Well, let's try make a Crossplane, LKE kubeconfig... All these, by the way, are in our repo, you can check them out. Actually, do you wanna tell us what happened behind the scenes, like how were we able to do this?
**Muvaffak Onuş:** Yeah. So Crossplane has this notion of connection details secret, where it stores all the sensitive information you need to use that resource, if any. For example, we see that mostly in Kubernetes clusters database instances, where you have a password, or some other details, and not in others, for ex...
\[01:16:00.01\] So here, what we see is that Terrajet does this automatically, using Terraform's tfstate, and exports it in its secret. And then we have added a custom configuration that will get that secret - you see the attribute .kubeconfig; that is automatically put here, taken from state. But the problem is that L...
**Gerhard Lazu:** So while we can get the kubeconfig locally, and then we can use kubectl and use that kubeconfig to target that cluster, what we may want to do is let Crossplane provision other things inside this cluster, so that we wouldn't necessarily need to give this kubeconfig away. It stays within Crossplane, it...
Okay. So we have the kubeconfig locally, and I'm not there yet in that dream world, so I'm still putting in the kubeconfig, pulling it down locally, and now going with K9s, targeting the new cluster. And what we see is that it's just like any regular cluster, there it is. Just the default pods. Four minutes ago they we...
So let's delete the cluster... And yes, I confirm I want to delete it... And the cluster is gone. Luckily, I deleted the correct cluster; I haven't deleted our production cluster. But if I had deleted our production cluster - I mean, good luck setting everything up. There's like a lot of stuff to do, a lot of steps. An...
**Muvaffak Onuş:** Yeah. Jerod wouldn't do that.
**Gerhard Lazu:** No, Jerod wouldn't do that. \[laughter\] No, he wouldn't. I do that all the time... You know, like "Let's just take production down. Whatever. Let's see what happens. Just for the fun of it." So what will this do behind the scenes, with the new setup that we have? Muvaffak, can you tell us?
**Muvaffak Onuş:** Yes. So what's gonna happen is that the controller will reconcile and see that the cluster is not there, it's gone... Which is what happens when you first create a resource. The very first thing that a provider does is to check whether the resource is there, and create it if not. And for further cont...
**Gerhard Lazu:** \[01:20:21.25\] Right. And that takes 30 seconds, a minute...? How long does it take for it to figure out that "Hey, I'm missing a cluster"?
**Muvaffak Onuş:** Well, so because it doesn't get any events or anything in Kubernetes cluster, it will need to hit the long wait period, which is like one minute. So at most, in a minute it will recognize that change. Or you can make a change on the custom resource, which will trigger a Kubernetes event. So you go to...
**Gerhard Lazu:** I was trying to find this out to see where it's reconciling. It's finding it -- I think I just missed it, the event. Everything is synced now, everything's ready... The cluster is back; I mean, I just had to refresh the page.
**Muvaffak Onuş:** Nice.
**Gerhard Lazu:** What about the Linodes? Is it still there? It's offline. Interesting. I don't know why that's offline. So when I deleted the cluster, whatever happened behind the scenes... Maybe the default node pool got deleted as well. Oh, it's booting... So I think that the node was deleted as well. And this is li...
So deleting the cluster from the Linode UI, from the cloud.linode.com - it also deletes all the worker nodes. So when the cluster gets recreated, it has to obviously recreate all the nodes... And there it is. It's back.
Okay, so everything here is ready, it's synced... Because while the cluster has been created, the cluster object, the node pool that's associated with it hasn't been finished yet, and I think that's where composite resources come in. Can you tell us a bit about that?
**Muvaffak Onuş:** So in other cases where you have the node group represented as a different resource, you can actually have like two resources in a single composition.
**Gerhard Lazu:** Right.
**Muvaffak Onuş:** And additionally, just like you mentioned earlier, we can have more things installed there as well... Because the dependencies are resolved automatically, just like in Kubernetes. So for example, you would create your composite cluster resource, a cluster will be created and node groups will be boote...
So once your composite cluster CR reports ready, everything is ready, and just back in initial state. So it will just revert it back to the original state, including all the things in composition.
**Gerhard Lazu:** Okay, so now what happened is we are targeting the same control plane, and we could see how the pods were being recreated. So 90 seconds ago, 100 seconds ago, everything was created from scratch. We accidentally (air quotes again) deleted the cluster, Crossplane recreated the cluster, the node pools r...
**Muvaffak Onuş:** Yup.
**Gerhard Lazu:** \[01:23:52.22\] I think we did enough this Christmas. \[laughs\] Cool. Alright. So what happens next? Well, I think here's a couple of improvements that we can do... I already mentioned about installing all -- I think this was your idea... Can you tell us about your idea, Muvaffak? This was really, re...
**Muvaffak Onuş:** So maybe I can give a little summary about what a composition does.
**Gerhard Lazu:** Sure.
**Muvaffak Onuş:** A composition has two parts. One is XRD - similar to CRDs, but you define your own API. But with XRDs, you can define two different APIs. One is namespaced, and the other one is cluster-scoped, which does not have any namespaces. So what we usually see is that people create a composition with all the...
If you go to platform references we have on the Upbound org, you will see some of the examples, where we for example install Prometheus, or a few other tools that your platform team might want every cluster to have, like security agents.
In this case, as listed there in the PR, you've got the cert manager, you've got Grafana Agent, and a few other components that you want installed. And then the other composition is usually the application itself. In that composition you would define what Changelog specifically needs, so for example you would create a ...