升级git(版本太老,go编译的时候报错)
# 卸载git
yum remove -y git
# 编译安装新的git
wget https://github.com/git/git/archive/v2.17.0.tar.gz
tar -zxvf v2.17.0.tar.gz
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker -y
cd git-2.17.0
make prefix=/usr/local/git all
make prefix=/usr/local/git install
# 添加环境变量
vim /etc/profile
#在底部加上Git相关配置信息
PATH=$PATH:/usr/local/git/bin
export PATH
# 使其生效
source /etc/profile
# git版本
git --version
方法一:
go get -d k8s.io/sample-controller
cd $GOPATH/src/k8s.io/sample-controller
godep restore
# assumes you have a working kubeconfig, not required if operating in-cluster
go build -o sample-controller .
./sample-controller -kubeconfig=$HOME/.kube/config
# create a CustomResourceDefinition
kubectl create -f artifacts/examples/crd.yaml
# create a custom resource of type Foo
kubec