Skip to content

Commit 897499e

Browse files
authored
Magefiles (#89)
* Add contributing docs Signed-off-by: Lucas Santos <[email protected]> * Add README Signed-off-by: Lucas Santos <[email protected]> * Add magefiles Signed-off-by: Lucas Santos <[email protected]>
1 parent c99982f commit 897499e

File tree

9 files changed

+532
-2
lines changed

9 files changed

+532
-2
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ See that document at [docs/walkthrough.md](./docs/walkthrough.md)
1919

2020
## Design
2121

22-
The HTTP add-on is composed of multiple mostly independent components. This design was chosen to allow for highly customizable installations while allowing us to ship reasonable defaults.
22+
The HTTP add-on is composed of multiple mostly independent components. This design was chosen to allow for highly
23+
customizable installations while allowing us to ship reasonable defaults.
2324

2425
We have written a complete design document. Please see it at [docs/design.md](./docs/design.md).
2526

@@ -29,6 +30,10 @@ If you have further questions about the project, please see our [FAQ document](.
2930

3031
Please see the [complete installation instructions](./docs/install.md).
3132

33+
## Contributing
34+
35+
Please see the [contributing documentation for all instructions](./docs/contributing.md).
36+
3237
---
3338
We are a Cloud Native Computing Foundation (CNCF) sandbox project.
3439
<p align="center"><img src="https://raw.githubusercontent.com/kedacore/keda/main/images/logo-cncf.svg" height="75px"></p>

docs/contributing.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Contributing
2+
3+
In this file you'll find all the references needed for you to start contributing with the HTTP Add-on project.
4+
5+
## Getting started
6+
7+
To get started, first [fork](https://github.com/kedacore/http-add-on/fork) this repository to your account. You'll need
8+
to have the following tools installed:
9+
10+
- [Golang](http://golang.org/) for development
11+
- [Docker](https://docker.com) for building the images and testing it locally
12+
13+
## Prerequisites
14+
15+
### Kubernetes cluster
16+
17+
It's recommended to have a running Kubernetes cluster to test the development, there are faster approaches using public
18+
clouds like:
19+
20+
- Azure with [AKS](https://azure.microsoft.com/services/kubernetes-service/?WT.mc_id=opensource-12724-ludossan)
21+
- Google Cloud with [GKE](https://cloud.google.com/kubernetes-engine)
22+
- AWS with [EKS](https://aws.amazon.com/eks/)
23+
- [Digital Ocean](https://www.digitalocean.com/products/kubernetes/)
24+
25+
These providers will let you deploy a simple and quick K8S cluster, however, they're paid. If you don't want to pay for
26+
the service, you can host your own with a series of amazing tools like:
27+
28+
- [Microk8s](https://microk8s.io/)
29+
- [Minikube](https://minikube.sigs.k8s.io/docs/)
30+
- [K3S](https://k3s.io/)
31+
- [KinD (Kubernetes in Docker)](https://kind.sigs.k8s.io/)
32+
33+
### Keda
34+
35+
Follow the [install instructions](./install.md) to check out how to install and get this add-on up and running.
36+
37+
## Build scripts
38+
39+
This project uses [Mage](https://magefile.org) as opposed to Make because it's way faster to build and push images, as
40+
well as to run tests and other common tasks. Please install it to have access to the task runner.
41+
42+
> **Note:** The Magefile located in the root directory is related to the whole project, so it gives you the ability to control the build and install process of all the modules in this project. On the other hand, the build binary located in the [operator](../operator/magefile.go) directory, is **just related to the operator module**.
43+
44+
The usage is as follows:
45+
46+
- Type `mage -l` on the magefile directory to print a list of all available commands
47+
- Type `mage -h <command>` to check the help for that specific command
48+
- `mage -h` shows the general help
49+
50+
Most of the commands are simple, and we have a few commands that chain other commands together, for reference on chains,
51+
check the [Magefile](../magefile.go) source code. Below is a list of the most common build commands
52+
53+
> All commands are case insensitive, so `buildAll` and `buildall` are the same.
54+
55+
In the root directory:
56+
57+
- `mage All`: Builds all the binaries for local testing.
58+
- `mage deleteOperator [namespace]`: Deletes the installed add-on in the given `namespace` for the active K8S
59+
cluster.
60+
- `mage dockerBuildAll <repository>`: Builds all the images for the `interceptor`, `scaler`, and `operator` modules
61+
for the specified `repository`.
62+
- You can also build specific images by using `mage dockerBuild <repository> <module>`, where module is one
63+
of `interceptor`, `scaler`, or `operator`.
64+
- `mage dockerPushAll <repository>`: Pushes all the built images for a given repository.
65+
- You can push the images using `mage dockerPush <repository> <module>` like the `dockerBuild` command.
66+
- `mage installKeda [namespace]`: will install KEDA on the given namespace.
67+
- `mage upgradeOperator [namespace] <image>`: Will install the add-on in the given `namespace` if not installed, or
68+
update it using the provided `image`.
69+
- `mage Operator`: Alias to `mage -d operator All`, just to have everything on the same dir level.
70+
- `mage Manifests`: Alias to `mage -d operator Manifests`.
71+
72+
> The default values for the `namespace` if not provided (when passed as `""`, like `mage upgradeOperator "" image`) is `kedahttp`
73+
74+
In the operator directory:
75+
76+
- `mage Manifests`: Builds all the manifest files for Kubernetes, it's important to build after every change
77+
to a Kustomize annotation.
78+
- `mage All`: Generates the operator.

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ require (
66
github.com/go-logr/logr v0.3.0
77
github.com/golang/protobuf v1.4.3
88
github.com/labstack/echo/v4 v4.1.17
9+
github.com/magefile/mage v1.11.0
910
github.com/onsi/ginkgo v1.14.1
1011
github.com/onsi/gomega v1.10.2
1112
github.com/pkg/errors v0.9.1

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ github.com/labstack/echo/v4 v4.1.17 h1:PQIBaRplyRy3OjwILGkPg89JRtH2x5bssi59G2EL3
248248
github.com/labstack/echo/v4 v4.1.17/go.mod h1:Tn2yRQL/UclUalpb5rPdXDevbkJ+lp/2svdyFBg6CHQ=
249249
github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0=
250250
github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k=
251+
github.com/magefile/mage v1.11.0 h1:C/55Ywp9BpgVVclD3lRnSYCwXTYxmSppIgLeDYlNuls=
252+
github.com/magefile/mage v1.11.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
251253
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
252254
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
253255
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=

0 commit comments

Comments
 (0)