Introduction
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 Rcs Cloud Server.
Prerequisites
Before you begin:
Deploy a Linux Server on Rcs
Using SSH, access the server
Create a non-root user with sudo privileges
Switch to the new non-root user account
# su - sysadmin
Install Knative CLI
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.
Install Knative CLI using the Latest Release Binary File
Download the latest Knative CLI latest release file
$ wget https://github.com/knative/client/releases/download/knative-v1.11.0/kn-linux-amd64
The above command downloads version
v1.11.0
, visit the Knative Client releases page to verify the latest version to install on your serverMove the downloaded
kn-linux-amd64
binary file to the/usr/local/bin/
directory and rename it tokn
to enable it as a system wide command$ sudo mv kn-linux-amd64 /usr/local/bin/kn
Enable execution privileges on the
kn
binary file$ sudo chmod +x /usr/local/bin/kn
Switch to your user home directory
$ cd
Verify the installed Knative CLI version
$ kn version
Your output should look like the one below:
Version: v20231007-local-807181fb Build Date: 2023-10-07 18:06:36 Git Revision: 807181fb Supported APIs: * Serving - serving.knative.dev/v1 (knative-serving v0.38.1-0.20230921205527-0d73dfe0f295) * Eventing - sources.knative.dev/v1 (knative-eventing v0.38.1-0.20230921080814-ceecbb01e116) - eventing.knative.dev/v1 (knative-eventing v0.38.1-0.20230921080814-ceecbb01e116)
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 Knative CLI using Go
Install the Golang package on your server
Ubuntu/Debian Systems:
$ sudo apt install golang
CentOS/RockyLinux/AlmaLinux/RHEL Systems:
$ sudo dnf install golang
Verify the installed Go version
$ go version
Output:
go version go1.20.3 linux/amd64
Clone the Knative Client repository
$ git clone https://github.com/knative/client.git
Switch to the new
client
directory$ cd client
List files and verify that Knative files are available in the directory
$ ls
Output:
CHANGELOG.adoc CODE-OF-CONDUCT.md CONTRIBUTING.md DEVELOPMENT.md go.mod hack LICENSE OWNERS_ALIASES README.md third_party vendor cmd config conventions docs go.sum lib OWNERS pkg test tools
Build a new executable binary file
$ hack/build.sh -f
Output:
Was this answer helpful?