Operator SDK 的安装支持多种方式,包括:
- Homebrew(macOS)
- GitHub Release 下载
- 源码编码安装
下面,我们来依次进行说明。
Homebrew安装
homebrew 的安装非常简单:
brew install operator-sdk
Github Release下载
# 下载
# 设置平台版本
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)}')
# 下载
export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.14.0
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
源码编译(推荐)
git clone https://github.com/operator-framework/operator-sdk
cd operator-sdk
git checkout v0.16.0 # kubernetes-1.16.3
make install