|
1 | 1 | # Contributing Guidelines
|
2 | 2 |
|
3 |
| -Read the following guide if you're interested in contributing to Ingress. |
| 3 | +Thank you for showing interest in contributing to |
| 4 | +Kong Ingress Controller. |
4 | 5 |
|
5 |
| -## Contributor License Agreements |
| 6 | +Following guide will help you navigate |
| 7 | +the repository and get your PRs |
| 8 | +merged in faster. |
6 | 9 |
|
7 |
| -We'd love to accept your patches! Before we can take them, we have to jump a couple of legal hurdles. |
| 10 | +## Finding work |
8 | 11 |
|
9 |
| -Please fill out either the individual or corporate Contributor License Agreement (CLA). |
| 12 | +If you're new to the project and want to help, but don't know where to start, |
| 13 | +look for "Help wanted" or "Good first issue" labels in our |
| 14 | +[issue tracker](https://github.com/Kong/kubernetes-ingress-controller/issues). |
| 15 | +Alternatively, read our documentation and fix or |
| 16 | +improve any issues that you see. We really value documentation contributions |
| 17 | +since that makes life easier for a lot of people. |
10 | 18 |
|
11 |
| - * If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA](http://code.google.com/legal/individual-cla-v1.0.html). |
12 |
| - * If you work for a company that wants to allow you to contribute your work, then you'll need to sign a [corporate CLA](http://code.google.com/legal/corporate-cla-v1.0.html). |
| 19 | +All of the following tasks are noble and worthy contributions that you can |
| 20 | +make without coding: |
13 | 21 |
|
14 |
| -Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we'll be able to accept your pull requests. |
| 22 | +- Reporting a bug |
| 23 | +- Helping other members of the community on the |
| 24 | + [support channels](https://github.com/Kong/kubernetes-ingress-controller#seeking-help) |
| 25 | +- Fixing a typo in the code |
| 26 | +- Fixing a typo in the documentation |
| 27 | +- Providing your feedback on the proposed features and designs |
| 28 | +- Reviewing Pull Requests |
15 | 29 |
|
16 |
| -***NOTE***: Only original source code from you and other people that have signed the CLA can be accepted into the main repository. |
| 30 | +If you wish to contribute code (features or bug fixes), see the [Submitting a |
| 31 | +patch](#submitting-a-patch) section. |
17 | 32 |
|
18 |
| -## Finding Things That Need Help |
| 33 | +## Development environement |
19 | 34 |
|
20 |
| -If you're new to the project and want to help, but don't know where to start, we have a semi-curated list of issues that should not need deep knowledge of the system. [Have a look and see if anything sounds interesting](https://github.com/kubernetes/ingress-nginx/issues?utf8=%E2%9C%93&q=is%3Aopen%20is%3Aissue%20label%3A%22help+wanted%22). Alternatively, read some of the docs on other controllers and try to write your own, file and fix any/all issues that come up, including gaps in documentation! |
| 35 | +## Environment |
21 | 36 |
|
22 |
| -## Contributing a Patch |
| 37 | +- Golang version >= 1.10 installed |
| 38 | +- Access to a k8s cluster, you can use Minikube or GKE |
| 39 | +- Install dep for dependency management |
| 40 | +- make |
| 41 | +- Docker (for building) |
23 | 42 |
|
24 |
| -1. If you haven't already done so, sign a Contributor License Agreement (see details above). |
25 |
| -1. Read the [Ingress development guide](docs/development.md). |
26 |
| -1. Fork the desired repo, develop and test your code changes. |
27 |
| -1. Submit a pull request. |
| 43 | +## Dependencies |
28 | 44 |
|
29 |
| -All changes must be code reviewed. Coding conventions and standards are explained in the official [developer docs](https://github.com/kubernetes/community/tree/master/contributors/devel). Expect reviewers to request that you avoid common [go style mistakes](https://github.com/golang/go/wiki/CodeReviewComments) in your PRs. |
| 45 | +The build uses dependencies in the `vendor` directory, which |
| 46 | +must be installed before building a binary/image. Occasionally, you |
| 47 | +might need to update the dependencies. |
30 | 48 |
|
31 |
| -### Merge Approval |
| 49 | +Check the version of `dep` you are using and make sure it is up to date. |
| 50 | +If you have an older version of `dep`, you can update it as follows: |
32 | 51 |
|
33 |
| -Ingress collaborators may add "LGTM" (Looks Good To Me) or an equivalent comment to indicate that a PR is acceptable. Any change requires at least one LGTM. No pull requests can be merged until at least one Ingress collaborator signs off with an LGTM. |
| 52 | +```console |
| 53 | +$ go get -u github.com/golang/dep |
| 54 | +``` |
34 | 55 |
|
35 |
| -## Support Channels |
| 56 | +This will automatically save the dependencies to the `vendor/` directory. |
36 | 57 |
|
37 |
| -Whether you are a user or contributor, official support channels include: |
| 58 | +```console |
| 59 | +$ cd $GOPATH/src/github.com/kong/ingress-controller |
| 60 | +$ dep ensure -v -vendor-only |
| 61 | +``` |
38 | 62 |
|
39 |
| -- GitHub issues: https://github.com/kubernetes/ingress-nginx/issues/new |
40 |
| -- Slack: kubernetes-users room in the [Kubernetes Slack](http://slack.kubernetes.io/) |
41 |
| -- Email: [kubernetes-users](https://groups.google.com/forum/#!forum/kubernetes-users) mailing list |
| 63 | +## Running in dev mode |
42 | 64 |
|
43 |
| -Before opening a new issue or submitting a new pull request, it's helpful to search the project - it's likely that another user has already reported the issue you're facing, or it's a known issue that we're already aware of. |
| 65 | +You can run the ingress controller without building a Docker |
| 66 | +Image and installing it onto your docker container. |
| 67 | + |
| 68 | +Following is a helpful shell script that you could |
| 69 | +use to run the Ingress Controller without building |
| 70 | +the Ingress Controller: |
| 71 | + |
| 72 | +```shell |
| 73 | +#!/bin/bash |
| 74 | +pkill -f kubectl |
| 75 | +# setup proxies |
| 76 | +kubectl port-forward svc/kong-proxy -n kong 8443:443 2>&1 > /dev/null & |
| 77 | +kubectl port-forward svc/kong-proxy -n kong 8000:80 2>&1 > /dev/null & |
| 78 | +kubectl port-forward svc/kong-ingress-controller -n kong 8001:8001 2>&1 > /dev/null & |
| 79 | +kubectl proxy --port=8002 2>&1 > /dev/null & |
| 80 | + |
| 81 | +export POD_NAME=`kubectl get po -n kong -o json | jq ".items[] | .metadata.name" -r | grep ingress` |
| 82 | +export POD_NAMESPACE=kong |
| 83 | + |
| 84 | +go run -tags gcp ./cli/ingress-controller/ \ |
| 85 | +--default-backend-service kong/kong-proxy \ |
| 86 | +--kubeconfig ~/.kube/config \ |
| 87 | +--publish-service=kong/kong-proxy \ |
| 88 | +--apiserver-host=http://localhost:8002 \ |
| 89 | +--kong-url http://localhost:8001 |
| 90 | +``` |
| 91 | + |
| 92 | +## Building |
| 93 | + |
| 94 | +Build is performed via Makefile. Depending on your |
| 95 | +requirements you can build a raw server binary, a local container image, |
| 96 | +or push an image to a remote repository. |
| 97 | + |
| 98 | +### Build a raw server binary |
| 99 | + |
| 100 | +```console |
| 101 | +$ make build |
| 102 | +``` |
| 103 | + |
| 104 | +### Build a local container image |
| 105 | + |
| 106 | +```console |
| 107 | +$ TAG=DEV make docker-build |
| 108 | +``` |
| 109 | + |
| 110 | +Note: this will use the Docker daemon |
| 111 | +running on your system. |
| 112 | +If you're developing using minikube, you |
| 113 | +should exectue the following to use the |
| 114 | +Docker daemon running inside the Minikube VM: |
| 115 | + |
| 116 | +```console |
| 117 | +eval $(minikube docker-env) |
| 118 | +``` |
| 119 | + |
| 120 | +This will allow you to publish images to |
| 121 | +Minikube VM, allowing you to reference them |
| 122 | +in your Deployment specs. |
| 123 | + |
| 124 | +### Push the container image to a remote repository |
| 125 | + |
| 126 | +```console |
| 127 | +$ TAG=DEV REGISTRY=$USER/kong-ingress-controller make docker-push |
| 128 | +``` |
| 129 | + |
| 130 | +## Deploying |
| 131 | + |
| 132 | +There are several ways to deploy Kong Ingress Controller onto a cluster. |
| 133 | +Please check the [deployment guide](/deploy/README.md) |
| 134 | + |
| 135 | +## Testing |
| 136 | + |
| 137 | +To run unit-tests, just run |
| 138 | + |
| 139 | +```console |
| 140 | +$ cd $GOPATH/src/github.com/kong/kubernetes-ingress-controller |
| 141 | +$ make test |
| 142 | +``` |
| 143 | + |
| 144 | +## Releasing |
| 145 | + |
| 146 | +Makefile will produce a release binary, as shown above. To publish this |
| 147 | +to a wider Kubernetes user base, push the image to a container registry. |
| 148 | +Our images are hosted on |
| 149 | +[Bintray](https://bintray.com/kong/kubernetes-ingress-controller). |
| 150 | + |
| 151 | +An example release might look like: |
| 152 | + |
| 153 | +```shell |
| 154 | +$ export TAG=42 |
| 155 | +$ make release |
| 156 | +``` |
| 157 | + |
| 158 | +Please follow these guidelines to cut a release: |
| 159 | + |
| 160 | +- Update the [release](https://help.github.com/articles/creating-releases/) |
| 161 | + page with a link to changelog. |
| 162 | +- Cut a release branch, if appropriate. |
| 163 | + All major feature work is done in HEAD. Specific bug fixes are |
| 164 | + cherry-picked into a release branch. |
| 165 | +- If you're not confident about the stability of the code, |
| 166 | + [tag](https://help.github.com/articles/working-with-tags/) it as alpha or beta. |
| 167 | + Typically, a release branch should have stable code. |
0 commit comments