How To Install Operator SDK CLI on Linux / macOS

Posted on 162 views

The Operator Framework is an open source toolkit designed for management of Kubernetes native applications (Operators), in an effective, automated, and scalable way. Operators take advantage of Kubernetes’ extensibility to deliver the automation advantages of cloud services like provisioning, scaling, and backup and restore, while being able to run anywhere that Kubernetes can run.

The Operator SDK has a CLI tool to be used by Developers and Cluster Administrators in creating, building, and deploying new Operator projects. This guide will show you how you can easily install the latest release of Operator SDK CLI on your workstation so you are prepared to start building your own Operators.


Install Operator SDK CLI on Linux / macOS

You should start by downloading the latest available release of the application. We’re using the curl command line to query latest release directly from Github API.

Download the release binary on Linux:

curl -s | grep browser_download_url | grep x86_64-linux-gnu | cut -d '"' -f 4 | wget -i -

Download the release binary on macOS:

curl -s | grep browser_download_url | grep x86_64-apple-darwin | cut -d '"' -f 4 | wget -i -

Once the file is downloaded, verify the downloaded release binary with provided ASC file.

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

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

If you do not have the maintainer’s public key on your machine, an error like below will be shown:

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

Use the following command to download the key, replacing “” with the RSA key string provided in the previous output.

$ gpg --recv-key ""

For me this will 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) " imported
gpg: Total number processed: 1
gpg:               imported: 1

Now you should 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) " [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 the binary files to /usr/local/bin directory:

--- 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 tool was installed correctly:

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

Check other CLI installation guides:


Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.