安裝gojsontoyaml、jsonnet、shellcheck
mkdir -p $GOPATH/src/github.com/brancz
cd $GOPATH/src/github.com/brancz
git clone https://github.com/brancz/gojsontoyaml.git
cd gojsontoyaml
go build
cp gojsontoyaml /usr/bin/
wget https://github.com/google/jsonnet/archive/v0.14.0.zip
unzip v0.14.0.zip
cd jsonnet-0.14.0
make
make install
wget https://github.com/koalaman/shellcheck/archive/v0.7.0.zip
unzip v0.7.0.zip
cd shellcheck-0.7.0/
docker build -t koalaman/shellcheck:stable .
最後編譯prometheus-operator,並打包鏡像
mkdir -p $GOPATH/src/github.com/coreos
cd $GOPATH/src/github.com/coreos
git clone https://github.com/coreos/prometheus-operator.git
cd prometheus-operator
git checkout v0.32.0
make
docker build -t coreos/prometheus-operator:v0.32.0 .
編譯coreos/prometheus-operator過程中報錯:
/bin/bash: po-crdgen: command not found
解決方法,執行:
cp $GOPATH/bin/po-crdgen /usr/bin/