Kubernetes Source Code Compilation

Source: Internet
Author: User
Tags mkdir git clone k8s

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.