Development Setup¶
Environmental Preparation¶
Kube-OVN uses Golang 1.20 to develop and Go Modules to manage dependency, please check env GO111MODULE="on"
。
gosec is used to scan for code security related issues and requires to be installed in the development environment:
go install github.com/securego/gosec/v2/cmd/gosec@latest
To reduce the size of the final generated image, Kube-OVN uses some of the Docker buildx experimental features, please update Docker to the latest version and enable buildx:
docker buildx create --use
Build Image¶
Use the following command to download the code and generate the image required to run Kube-OVN:
git clone https://github.com/kubeovn/kube-ovn.git
cd kube-ovn
make release
To build an image to run in an ARM environment, run the following command:
make release-arm
Building the Base Image¶
If you need to change the operating system version, dependencies, OVS/OVN code, etc., you need to rebuild the base image.
The Dockerfile used for the base image is dist/images/Dockerfile.base
.
Build instructions:
# build x86 base image
make base-amd64
# build arm base image
make base-arm64
Run E2E¶
Kube-OVN uses KIND to build local Kubernetes cluster, j2cli to render templates, and Ginkgo to run test cases. Please refer to the relevant documentation for dependency installation.
Run E2E locally:
make kind-init
make kind-install
make e2e
To run the Underlay E2E test, run the following commands:
make kind-init
make kind-install-underlay
make e2e-underlay-single-nic
To run the ovn vpc nat gw eip, fip, snat, dnat E2E test, run the following commands:
make kind-init
make kind-install
make ovn-vpc-nat-gw-conformance-e2e
To run the iptables vpc nat gw eip, fip, snat, dnat E2E test, run the following commands:
make kind-init
make kind-install
make kind-install-vpc-nat-gw
make iptables-vpc-nat-gw-conformance-e2e
To run the loadbalancer service E2E test, run the following commands:
make kind-init
make kind-install
make kind-install-lb-svc
make kube-ovn-lb-svc-conformance-e2e
To clean, run the following commands:
make kind-clean