How to install Operator SDK CLI on Linux / macOS

Ranch
You can support us by downloading this article in PDF format via the link below.

Download the guide as a PDF

turn off
Ranch

Ranch
Ranch

of Carrier framework Is an open source toolkit designed to manage Kubernetes native applications (operators) in an efficient, automated and scalable way. Operators can take advantage of Kubernetes’ scalability to provide the automated benefits of cloud services, such as provisioning, scaling, backup and restore, while running anywhere Kubernetes can run.

The Operator SDK has a CLI tool for developers and cluster administrators to use when creating, building and deploying new Operator projects. This guide will show you how to easily install the latest version of the Operator SDK CLI on your workstation so you are ready to start building your own Operators.

Install Operator SDK CLI on Linux / macOS

You should download the latest available version of the application first. We are using the curl command line to query the latest version directly from the Github API.

Download the distribution binaries on Linux:

curl -s https://api.github.com/repos/operator-framework/operator-sdk/releases/latest | grep browser_download_url | grep x86_64-linux-gnu | cut -d '"' -f 4 | wget -i -

Download the distribution binaries on macOS:

curl -s https://api.github.com/repos/operator-framework/operator-sdk/releases/latest | grep browser_download_url | grep x86_64-apple-darwin | cut -d '"' -f 4 | wget -i -

After downloading the file, use the provided ASC file to verify the downloaded release binary.

--- Linux --- 
$ gpg --verify operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu.asc

--- macOS ---
$ gpg --verify operator-sdk-*-x86_64-apple-darwin.asc

If the maintainer’s public key is not on your computer, the following error is displayed:

gpg: directory '/var/home/jkmutai/.gnupg' created
gpg: keybox '/var/home/jkmutai/.gnupg/pubring.kbx' created
gpg: assuming signed data in 'operator-sdk-v0.16.0-x86_64-apple-darwin'
gpg: Signature made Tue 17 Mar 2020 09:47:38 PM EAT
gpg:                using RSA key 7CC439CD21EE1031C3831C6590354A3F09FCE996
gpg: Can't check signature: No public key

Download the key using the following command, replacing it with ““, And the RSA key string provided in the previous output.

$ gpg --recv-key ""

For me, this would be:

$ gpg --recv-key 7CC439CD21EE1031C3831C6590354A3F09FCE996
gpg: /var/home/jkmutai/.gnupg/trustdb.gpg: trustdb created
gpg: key 90354A3F09FCE996: public key "Varsha Prasad Narsing (RedHat office purpose) <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1

You should now be able to verify the binary.

$ gpg --verify operator-sdk-*-x86_64-apple-darwin.asc
gpg: assuming signed data in 'operator-sdk-v0.16.0-x86_64-apple-darwin'
gpg: Signature made Tue 17 Mar 2020 09:47:38 PM EAT
gpg:                using RSA key 7CC439CD21EE1031C3831C6590354A3F09FCE996
gpg: Good signature from "Varsha Prasad Narsing (RedHat office purpose) <[email protected]>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 7CC4 39CD 21EE 1031 C383  1C65 9035 4A3F 09FC E996

Move binary files to / usr / local / bin table of Contents:

--- Linux ---
sudo mv operator-sdk-*-x86_64-linux-gnu /usr/local/bin/operator-sdk
rm -rf operator-sdk*

--- macOS ---
sudo mv operator-sdk-*-x86_64-apple-darwin /usr/local/bin/operator-sdk
rm -rf operator-sdk*

Verify that the CLI tools are installed correctly:

$ operator-sdk version
operator-sdk version: "v0.16.0-dirty", commit: "55f1446c5f472e7d8e308dcdf36d0d7fc44fc4fd", go version: "go1.13.8 linux/amd64"

View other CLI installation guides:

Easily manage multiple Kubernetes clusters with kubectl and kubectx

How to connect to a Bluetooth device from a Linux terminal

Connect to a VPN server using Cisco AnyConnect from a Linux terminal

Ranch
You can support us by downloading this article in PDF format via the link below.

Download the guide as a PDF

turn off
Ranch

Ranch
Ranch

Related Posts