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.

kubernetes operator framework

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:

export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac)
export OS=$(uname | awk '{print tolower($0)}')
VER=$(curl --silent "https://api.github.com/repos/operator-framework/operator-sdk/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/$VER
curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH}
chmod +x operator-sdk_${OS}_${ARCH} && sudo mv operator-sdk_${OS}_${ARCH} /usr/local/bin/operator-sdk

Download the release binary on macOS:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install operator-sdk

Verify that the CLI tool was installed correctly:

$ operator-sdk version
operator-sdk version: "v1.31.0", commit: "e67da35ef4fff3e471a208904b2a142b27ae32b1", kubernetes version: "1.26.0", go version: "go1.19.11", GOOS: "linux", GOARCH: "amd64"

Check other CLI installation guides:

LEAVE A REPLY

Please enter your comment!
Please enter your name here