Skip to content

Developer Guide

Project management

We are using the GitHub issues and project dashboard to manage the list of TODOs for this project:

Issues labeled good first issue and help wanted are especially good for a first contribution.

We use priority labels to help indicate the timing importance of resolving an issue, or whether an issue needs more support from its creator or the community to be prioritized.

Prerequisites

Before you start developing with Network Policy API, we'd recommend having the following prerequisites installed:

  • Go: Main programing language for this project.
  • Python3: To build this documentation page.
  • Kind: To run Kubenetes on the local machine, and it also has a dependency on Docker or Podman.
  • Kubectl: Kubenetes command line tool.

Building, Deploying, and Submitting the code

Clone the repo:

mkdir -p $GOPATH/src/sigs.k8s.io
cd $GOPATH/src/sigs.k8s.io
git clone https://github.com/kubernetes-sigs/network-policy-api.git
cd network-policy-api

This project works with Go modules; you can chose to setup your environment outside $GOPATH as well.

Building and Deploying the code

The project uses make to drive the build. make will run code generators, and run static analysis against the code and generate Kubernetes CRDs. You can kick off an overall build from the top-level makefile:

make install

Verifying

Make sure you run the static analysis over the repo before submitting your changes. The Prow presubmit will not let your change merge if verification fails.

make verify

Submitting a Pull Request

Network Policy API follows a similar pull request process as Kubernetes. Merging a pull request requires the following steps to be completed before the pull request will be merged automatically.

Documentation

The site documentation is written in Markdown and compiled with mkdocs. Each PR will automatically include a Netlify deploy preview. When new code merges, it will automatically be deployed with Netlify to network-policy-api.sigs.k8s.io. If you want to manually preview docs changes locally, you can install the required mkdocs and plugins:

pip install mkdocs mkdocs-material mkdocs-awesome-pages-plugin mkdocs-macros-plugin mike

Note: You might want to install Python Vitural environment to avoid conflicts.

and then run:

 make docs

Once the build is complete, there would be a new folder called site generated, and you can deploy the website locally at port 8000 and run:

  make local-docs