
Knative CLI (kn) is a terminal based tool that allows you to deploy and manage Knative services in a Kubernetes Cluster without creating YAML files. It offers a user friendly command line interface and uses existing Kubectl configurations to connect to a Kubernetes cluster. Follow the steps in this article to install Knative CLI on a Vultr Cloud Server.
Before you begin:
Deploy a Linux Server on Vultr
Using SSH, access the server
Create a non-root user with sudo privileges
Switch to the new non-root user account
To install the Knative CLI tool on your server, you can either use a release binary file or Go. To install the latest version, it's recommended to use the Golang method while the release binary file allows you to implement a specific version on your choice. Depending on your choice, install Knative CLI as described in the steps below.
Download the latest Knative CLI latest release file
The above command downloads version v1.11.0, visit the Knative Client releases page to verify the latest version to install on your server
Move the downloaded kn-linux-amd64 binary file to the /usr/local/bin/ directory and rename it to kn to enable it as a system wide command
Enable execution privileges on the kn binary file
Switch to your user home directory
Verify the installed Knative CLI version
Your output should look like the one below:
You have installed the Knative CLI tool using the official binary release file. Run kn --help to view the list of commands you can run using the tool
Install the Golang package on your server
Ubuntu/Debian Systems:
CentOS/RockyLinux/AlmaLinux/RHEL Systems:
Verify the installed Go version
Output:
Clone the Knative Client repository
Switch to the new client directory
List files and verify that Knative files are available in the directory
Output:
Build a new executable binary file
Output:
A new kn binary file is added to your directory. Move the file to your system path /usr/local/bin/ to activate it as a system-wide command
Switch to your user home directory
Verify the installed Knative CLI version
Your output should look like the one below:
To install the Knative CLI tool on a windows server instead of a Linux server, download the latest release file and install it on your system as described in the steps below.
Start a new web browser session, and visit the Knative Client releases page
Click the latest release. For example v1.11.0 to view the release files
Scroll to the Assets section and click to download the kn-windows-amd64.exe file
When the download process is complete, open a new File Explorer window and navigate to the Downloads folder
Find the kn-windows-amd64.exe file, right-click, and select Rename from the list
Rename the file to kn and press Enter to save the new filename
Navigate to the Windows start menu, expand the Windows System group and click Command Prompt to start a new command line session
In the Windows Command prompt window, enter the following command and press Enter to switch to the C:/ drive directory
Create a new folder Knative in the C:/ location
Move the downloaded Knative kn.exe release file from your Downloads directory to the new Knative directory
View files in the Knative directory
Output:
Verify that the kn.exe file is available in the directory
Add the Knative folder to your Windows system commands path
Close your Windows Command Prompt and open it again to start a new session
View the system paths and verify that the Knative directory is available on the list
Your output should look like the one below:
Run the kn command and verify the installed Knative CLI version
Output:
You have installed the Knative CLI tool on your Windows Server. You can use the tool in any directory within your Windows command prompt session. To view a list of available commands, add the --help option to the kn command
To verify that the Knative CLI tool is working correctly on your server, view the list of available commands and create a new service as described below.
Verify that your Kubectl configuration is connected to a Kubernetes Cluster
View the list of available Knative CLI commands
Output:
Create a new Knative Service using a Docker image. Replace hello-world with your desired image
Describe the service to view detailed information on its status
You have installed the Knative CLI tool on a Vultr Cloud Server. When deployed on your server, the tool uses your Kubectl configurations to connect to your cluster and create serverless applications. For mroe information about Knative CLI, visit the official documentation page.
To implement more Knative solutions, visit the following resources:
0 Comments
Be the first to comment and share your perspective with the community.