Building from source
If you don’t have a GOPATH:
cd ${GOPATH}/src/k8s.io/kops/
git checkout release
make
- The
release
branch is where releases are taken from. This is the stable code branch.
Cross compiling for things like are now done automatically via make nodeup
. make push-aws-run-amd64 TARGET=admin@$TARGET
will automatically choose the linux amd64 build from your .build
directory.
For example, will produce a kOps binary that can be interactively debugged.
For example, run dlv --listen=:2345 --headless=true --api-version=2 exec ${GOPATH}/bin/kops -- <kops command>
, and then configure your IDE to connect its debugger to port 2345 on localhost.
- Make sure
$GOPATH
is set, and your workspace is configured. - kOps will not compile with symlinks in
$GOPATH
. See issue go issue for more information - building kops requires go 1.15
- kOps will only compile if the source is checked out in
$GOPATH/src/k8s.io/kops
. If you try to use$GOPATH/src/github.com/kubernetes/kops
you will run into issues with package imports not working as expected.