Install Knative into an existing K8s Cluster

Опубликовано: 08 Ноябрь 2023
на канале: Stephen Blum
63
1

Setting up Knative in your existing Kubernetes cluster is pretty simple. You only need to run a few kubectl commands. Before starting up, make sure you have your CLI installed. For those using a Mac, it's quite easy. Run brew install and add a few items. Here's the list, I'll zoom in for your convenience. You'll see it's just several brew install commands. Once done, it becomes much easier managing your Kubernetes cluster. You likely already have kubectl installed. You'll also want to install the Knative CLI. It still uses kubectl but it does the grunt work for you. Before using Knative CLI directly, use kubectl to install Knative into your cluster. You need to target some specific YAML files that install Knative into your cluster. I ran into a problem here. Many versions of Kubernetes clusters are out there. With the latest one, you can install the newest Knative. But if you're already running Kubernetes, stick to an older version. If you install the new version, it fails continuously in a crash loop. It will let you install the new version anyway in an older Kubernetes cluster--with an environment variable. But who knows what could happen then? Just stick with the version that works in your cluster. This solution worked for me. Make sure you target the correct version for your cluster. After you've selected the right version, paste these series of commands and Knative serving will install into your Kubernetes cluster. To confirm installation, it's easy. Just make sure to run the Knative serving pods, and check all the pods in that namespace. Let's do that real quick. All right, I'm going to run this command. You can see it will do a brief check of currently running pods. As it shows, all the Knative things are installed. I bumped into some errors with the domain installation but don't worry. Despite the error message, it's a one-time thing, it ran its course already. All's well; everything's set up properly. With Knative installed in our cluster and all CLIs installed on our system, we're now able to maximize the functions of Knative.