$ RELEASE_VERSION=v0.19.4
The Operator SDK provides a command-line interface (cli) tool that Operator developers can use to build, test, and deploy an Operator. You can install the Operator SDK cli on your workstation so that you are prepared to start authoring your own Operators.
OKD 4.6 supports Operator SDK v0.19.4, which can be installed from upstream sources.
Starting in OKD 4.7, the Operator SDK is fully supported and available from official Red Hat product sources. See OKD 4.7 release notes for more information. |
You can download and install a pre-built release binary of the Operator SDK cli from the project on GitHub.
Set the release version variable:
$ RELEASE_VERSION=v0.19.4
Download the release binary.
For Linux:
$ curl -OJL https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
For macOS:
$ curl -OJL https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin
Verify the downloaded release binary.
Download the provided .asc
file.
For Linux:
$ curl -OJL https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu.asc
For macOS:
$ curl -OJL https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin.asc
Place the binary and corresponding .asc
file into the same directory and run the following command to verify the binary:
For Linux:
$ gpg --verify operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu.asc
For macOS:
$ gpg --verify operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin.asc
If you do not have the public key of the maintainer on your workstation, you will get the following error:
$ gpg: assuming signed data in 'operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin'
$ gpg: Signature made Fri Apr 5 20:03:22 2019 CEST
$ gpg: using RSA key <key_id> (1)
$ gpg: Can't check signature: No public key
1 | RSA key string. |
To download the key, run the following command, replacing <key_id>
with the RSA key string provided in the output of the previous command:
$ gpg [--keyserver keys.gnupg.net] --recv-key "<key_id>" (1)
1 | If you do not have a key server configured, specify one with the --keyserver option. |
Install the release binary in your PATH
:
For Linux:
$ chmod +x operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
$ sudo cp operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu /usr/local/bin/operator-sdk
$ rm operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
For macOS:
$ chmod +x operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin
$ sudo cp operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin /usr/local/bin/operator-sdk
$ rm operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin
Verify that the cli tool was installed correctly:
$ operator-sdk version
You can install the SDK cli using Homebrew.
Install the SDK cli using the brew
command:
$ brew install operator-sdk
Verify that the cli tool was installed correctly:
$ operator-sdk version
You can obtain the Operator SDK source code to compile and install the SDK cli.
Clone the operator-sdk
repository:
$ git clone https://github.com/operator-framework/operator-sdk
Change to the directory for the cloned repository:
$ cd operator-sdk
Check out the v0.19.4 release:
$ git checkout tags/v0.19.4 -b v0.19.4
Update dependencies:
$ make tidy
Compile and install the SDK cli:
$ make install
This installs the cli binary operator-sdk
in the $GOPATH/bin/
directory.
Verify that the cli tool was installed correctly:
$ operator-sdk version