Install the Operator SDK CLI

Install from Homebrew (macOS)

If you are using Homebrew, you can install the SDK CLI tool with the following command:

  1. $ brew install operator-sdk

Install from GitHub release

Download the release binary

  1. # Set the release version variable
  2. $ RELEASE_VERSION=v0.18.2
  3. # Linux
  4. $ curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
  5. # macOS
  6. $ curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin

Verify the downloaded release binary

  1. # Linux
  2. $ curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu.asc
  3. # macOS
  4. $ curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin.asc

To verify a release binary using the provided asc files, place the binary and corresponding asc file into the same directory and use the corresponding command:

  1. # Linux
  2. $ gpg --verify operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu.asc
  3. # macOS
  4. $ gpg --verify operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin.asc

If you do not have the maintainers public key on your machine, you will get an error message similar to this:

  1. $ gpg --verify operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin.asc
  2. $ gpg: assuming signed data in 'operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin'
  3. $ gpg: Signature made Fri Apr 5 20:03:22 2019 CEST
  4. $ gpg: using RSA key <KEY_ID>
  5. $ gpg: Can't check signature: No public key

To download the key, use the following command, replacing $KEY_ID with the RSA key string provided in the output of the previous command:

  1. $ gpg --recv-key "$KEY_ID"

You’ll need to specify a key server if one hasn’t been configured. For example:

  1. $ gpg --keyserver keyserver.ubuntu.com --recv-key "$KEY_ID"

Now you should be able to verify the binary.

Install the release binary in your PATH

  1. # Linux
  2. $ chmod +x operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu && sudo mkdir -p /usr/local/bin/ && sudo cp operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu /usr/local/bin/operator-sdk && rm operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
  3. # macOS
  4. $ chmod +x operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin && sudo mkdir -p /usr/local/bin/ && sudo cp operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin /usr/local/bin/operator-sdk && rm operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin

Compile and install from master

Prerequisites

  1. $ git clone https://github.com/operator-framework/operator-sdk
  2. $ cd operator-sdk
  3. $ git checkout master
  4. $ make tidy
  5. $ make install

Note: Ensure that your GOPROXY is set with its default value for Go versions 1.13+ which is https://proxy.golang.org,direct.

Last modified June 25, 2020: *: release v0.18.2 (#3289) (f059b5e1)