This is the culture and education everyone step by step compile kubernetes. Ready to
Before compiling the kubernetes, you should install the build environment first, you need to install the go, install the tutorial please own Baidu. compiling
Create a folder
Create a Go project folder
mkdir kube
cd kube
mkdir src
cd src
mkdir k8s.io
cd K8s.io
Download Source Package
Under the K8s.io folder
git clone https://github.com/kubernetes/kubernetes.git
The version of direct clone compiles an error, so a version of the problem is selected
git checkout tags/v1.5.3-b 1.5.3
The dependencies of the project are placed in the/kubernetes/vendor, and you need to copy the dependencies to SRC, and note that you need to use the parameters-R
Cp-r kubernetes/vendor/. /.. /src/
Compile
When you are ready to compile the package, the following is the compilation.
Set Gopath
Set the Gopath to the Kube directory
Export Gopath=###/kube
Enter the compilation package
Enter the package that needs to be compiled, take scheduler as an example, and enter the cmd directory of the module.
CD ###/kube/src/k8s.io/kubernetes/plugin/cmd/kube-scheduler
compiling
Go Build
Wait for a while to compile well, remember to be sure to the stable version, the pro-test version is effective.