Skip to content

Commit

Permalink
Merge pull request #4419 from dtzhou2/master
Browse files Browse the repository at this point in the history
Starting to refactor developer documentation
  • Loading branch information
tssurya committed Jun 8, 2024
2 parents a509b30 + 71336e6 commit bf06da7
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 31 deletions.
Empty file.
2 changes: 1 addition & 1 deletion docs/governance/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ In some cases, other changes may conflict with your PR. If this happens, you wil

## Development Environment Setup

You can easily setup a developer environment by following the instructions [here](https://github.com/ovn-org/ovn-kubernetes/blob/master/docs/kind.md).
You can easily setup a developer environment by following the instructions [here](../installation/launching-ovn-kubernetes-on-kind.md).

## Sign Your Commits

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ to be a highly scalable and performant Networking Platform.
For more details, please see the following:

- [OVN-Kubernetes Overview](getting-started/overview.md) for an overview of ovn-kubernetes.
- [Deploying OVN-Kubernetes cluster using KIND](installation/kind.md)
- [Deploying OVN-Kubernetes cluster using KIND](installation/launching-ovn-kubernetes-on-kind.md)
- [Deploying OVN-Kubernetes CNI using Helm](installation/helm.md)
- [Setup and Building OVN-Kubernetes](developer-guide/documentation.md) for instructions
on setting up your development environment and building ovn-kubernetes.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OVN kubernetes KIND Setup
# OVN-Kubernetes KIND Setup

KIND (Kubernetes in Docker) deployment of OVN kubernetes is a fast and easy means to quickly install and test kubernetes with OVN kubernetes CNI. The value proposition is really for developers who want to reproduce an issue or test a fix in an environment that can be brought up locally and within a few minutes.

Expand All @@ -16,39 +16,72 @@ KIND (Kubernetes in Docker) deployment of OVN kubernetes is a fast and easy mean
- [kubectl]( https://kubernetes.io/docs/tasks/tools/install-kubectl/ )
- Python and pip
- jq
- openssl
- openvswitch

**NOTE :** In certain operating systems such as CentOS 8.x, pip2 and pip3 binaries are installed instead of pip. In such situations create a softlink for "pip" that points to "pip2".

### Run the KIND deployment with docker

For OVN kubernetes KIND deployment, use the `kind.sh` script.

First Download and build the OVN-Kubernetes repo:

```
$ go env -w GO111MODULE=auto
$ go get github.com/ovn-org/ovn-kubernetes; cd $(go env GOPATH)/src/github.com/ovn-org/ovn-kubernetes
git clone github.com/ovn-org/ovn-kubernetes;
cd ovn-kubernetes
```

The `kind.sh` script builds OVN-Kubernetes into a container image. To verify
local changes before building in KIND, run the following:

```
$ pushd go-controller
$ make
$ popd
```

### Run the KIND deployment with docker

Build the image for fedora and launch the KIND Deployment

```
$ pushd dist/images
$ make fedora
$ popd
$ pushd contrib
$ export KUBECONFIG=${HOME}/ovn.conf
$ ./kind.sh
$ popd
```

### Run the KIND deployment with podman

To verify local changes, the steps are mostly the same as with docker, except the `fedora` make target:

```
$ pushd dist/images
```

Then Edit the makefile, changing

```
$ OCI_BIN=podman
```

Then build,

```
$ make fedora
$ popd
```

Launch the KIND Deployment.
To deploy KIND however, you need to start it as root and then copy root's kube config to use it as non-root:

```
$ pushd contrib
$ export KUBECONFIG=${HOME}/ovn.conf
$ ./kind.sh
$ sudo ./kind.sh -ep podman
$ sudo cp /root/ovn.conf ~/.kube/kind-config
$ sudo chown $(id -u):$(id -g) ~/.kube/kind-config
$ export KUBECONFIG=~/.kube/kind-config
$ popd
```

Expand Down Expand Up @@ -144,25 +177,6 @@ usage: kind.sh [[[-cf |--config-file <file>] [-kt|keep-taint] [-ha|--ha-enabled]

As seen above, if you do not specify any options the script will assume the default values.

### Run the KIND deployment with podman

To verify local changes, the steps are mostly the same as with docker, except the `fedora` make target:

```
$ OCI_BIN=podman make fedora
```

To deploy KIND however, you need to start it as root and then copy root's kube config to use it as non-root:

```
$ pushd contrib
$ sudo ./kind.sh -ep podman
$ sudo cp /root/ovn.conf ~/.kube/kind-config
$ sudo chown $(id -u):$(id -g) ~/.kube/kind-config
$ export KUBECONFIG=~/.kube/kind-config
$ popd
```

**Notes / troubleshooting:**

- Issue with /dev/dma_heap: if you get the error `kind "Error: open /dev/dma_heap: permission denied"`, there's a [known issue](https://bugzilla.redhat.com/show_bug.cgi?id=1966158) about it (directory mislabelled with selinux).
Expand Down
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ nav:
- Coding Guide: developer-guide/developer.md
- OVN-Kubernetes Container Images: developer-guide/image-build.md
- Documentation Guide: developer-guide/documentation.md
- Local Testing Guide: developer-guide/testing.md
- Launching OVN-Kubernetes: installation/launching-ovn-kubernetes-on-kind.md
- Local Testing Guide: developer-guide/local_testing_guide.md
- CI Testing Guide: ci/ci.md
- Debugging: developer-guide/debugging.md
- Releasing: developer-guide/release.md
Expand Down

0 comments on commit bf06da7

Please sign in to comment.