Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Readme #26

Merged
merged 2 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 45 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,72 @@
# Event Publisher Proxy
# Eventing Publisher Proxy

## Overview

The Event Publisher Proxy receives legacy and Cloud Event publishing requests from the cluster workloads (microservice or Serverless functions) and redirects them to the Enterprise Messaging Service Cloud Event Gateway. It also fetches a list of subscriptions for a connected application.
The Eventing Publisher Proxy receives legacy and Cloud Event publishing requests from the cluster workloads (microservice or Serverless functions) and redirects them to the Enterprise Messaging Service Cloud Event Gateway. It also fetches a list of subscriptions for a connected application.

## Prerequisites

- Go modules
- [ko](https://github.com/google/ko)
- lint
- Install lint on the local environment:
```bash
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin
```
- [Go](https://go.dev/)
- [Docker](https://www.docker.com/)
- [kubectl](https://kubernetes.io/docs/tasks/tools/)
- [kustomize](https://kustomize.io/)
- Access to a Kubernetes cluster (e.g. [k3d](https://k3d.io/) / k8s)

## Development
- check code quality before a commit:
```bash
$ make code-check
```

### Build

```bash
$ go mod vendor
make build
```

### Test
### Run Tests

```bash
$ make test-local
Run the unit and integration tests:

```sh
make generate-and-test
```

### Linting

1. Fix common lint issues:

```sh
make imports
make fmt
make lint
```

### Build Container Images

Build and push your image to the location specified by `IMG`:

```sh
make docker-build docker-push IMG=<container-registry>/eventing-publisher-proxy:<tag> # If using docker, <container-registry> is your username.
```

For MacBook M1 devices, run:

```sh
make docker-buildx IMG=<container-registry>/eventing-publisher-proxy:<tag>
```

### Deploy inside a cluster
## Deployment

You need a Kubernetes cluster to run against. You can use [k3d](https://k3d.io/) to get a local cluster for testing, or run against a remote cluster.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this already listed in the ## Prerequisites section? Why mention it again here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just followed the pattern from our other repos (example), I can remove it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep consistency for now. In the long term, we can look into removing redundancy in all repos.


### Deploy Inside a Cluster

```bash
$ ko apply -f config/event-publisher-proxy/
```

## Usage

### Send Events

This command supports **CloudEvents**:
The following command supports **CloudEvents**:
```bash
curl -v -X POST \
-H "Content-Type: application/cloudevents+json" \
Expand Down Expand Up @@ -103,59 +129,3 @@ curl -v -X GET \
| ----------------------- | ------------- |------------------------------------------------------------------------------------------- |
| max-request-size | 65536 | The maximum size of the request. |
| metrics-addr | :9090 | The address the metric endpoint binds to. |
=======
> **NOTE:** This is a general template that you can use for a project README.md. Except for the mandatory sections, use only those sections that suit your use case but keep the proposed section order.
>
> Mandatory sections:
> - `Overview`
> - `Prerequisites`, if there are any requirements regarding hard- or software
> - `Installation`
> - `Contributing` - do not change this!
> - `Code of Conduct` - do not change this!
> - `Licensing` - do not change this!

# {Project Title}
<!--- mandatory --->
> Modify the title and insert the name of your project. Use Heading 1 (H1).

## Overview
<!--- mandatory section --->

> Provide a description of the project's functionality.
>
> If it is an example README.md, describe what the example illustrates.

## Prerequisites

> List the requirements to run the project or example.

## Installation

> Explain the steps to install your project. If there are multiple installation options, mention the recommended one and include others in a separate document. Create an ordered list for each installation task.
>
> If it is an example README.md, describe how to build, run locally, and deploy the example. Format the example as code blocks and specify the language, highlighting where possible. Explain how you can validate that the example ran successfully. For example, define the expected output or commands to run which check a successful deployment.
>
> Add subsections (H3) for better readability.

## Usage

> Explain how to use the project. You can create multiple subsections (H3). Include the instructions or provide links to the related documentation.

## Development

> Add instructions on how to develop the project or example. It must be clear what to do and, for example, how to trigger the tests so that other contributors know how to make their pull requests acceptable. Include the instructions or provide links to related documentation.

## Contributing
<!--- mandatory section - do not change this! --->

See [CONTRIBUTING.md](CONTRIBUTING.md).

## Code of Conduct
<!--- mandatory section - do not change this! --->

See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).

## Licensing
<!--- mandatory section - do not change this! --->

See the [LICENSE file](./LICENSE).
4 changes: 2 additions & 2 deletions config/event-publisher-proxy/300-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ spec:
value: "json"
- name: APP_LOG_LEVEL
value: "info"
image: ko://github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy
imagePullPolicy: IfNotPresent
image: ko://github.com/kyma-project/eventing-publisher-proxy/cmd/event-publisher-proxy
imagePullPolicy: Always
name: event-publisher-proxy
ports:
- containerPort: 8080
Expand Down