Skip to content
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
29 changes: 29 additions & 0 deletions .github/workflows/lint-and-test-helm-charts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint and Test Charts

on: pull_request

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Fetch history
run: git fetch --prune --unshallow

- name: lint helm charts
id: lint_helm
uses: helm/chart-testing-action@v1.0.0
with:
command: lint

- name: Create kind cluster
uses: helm/kind-action@v1.0.0
# Only build a kind cluster if there are chart changes to test.
if: steps.lint_helm.outputs.changed == 'true'

- name: install and test helm charts
uses: helm/chart-testing-action@v1.0.0
with:
command: install
26 changes: 26 additions & 0 deletions .github/workflows/release-helm-charts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release Helm Charts

on:
push:
branches:
- master

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.0.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
charts_dir: deployment/helm
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Change above affects also `"response_from": "kafka"` proxy functionality. RIG will forward to clients only Kafka body, no headers. This means, when using binary mode, clients receive only the data part, no CloudEvents context attributes.
- Changed `response_from` handler to expect a message in binary format, **NOT** a cloud event (`kafka` and `http_async`). [#321](https://github.com/Accenture/reactive-interaction-gateway/pull/321)
- Updated Helm v2 template, kubectl yaml file and instructions in the `deployment` folder [#288](https://github.com/Accenture/reactive-interaction-gateway/issues/288)
- Publish Helm Chart to Github pages. With this change, we can simply install the chart using

```shell
helm repo add accenture https://accenture.github.io/reactive-interaction-gateway
helm install rig accenture/reactive-interaction-gateway
```

More information, follow the [deployment Readme](./deployment/README.md). [#319](https://github.com/Accenture/reactive-interaction-gateway/issues/319)

### Fixed

Expand Down
5 changes: 5 additions & 0 deletions ct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# See https://github.com/helm/chart-testing#configuration
remote: origin
chart-dirs:
- deployment/helm
debug: true
51 changes: 21 additions & 30 deletions deployment/README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,28 @@
# Running RIG on Kubernetes

## Kubectl
The easiest way to deploy RIG is using Helm:

```bash
kubectl apply -f kubectl/rig.yaml
```shell
helm repo add accenture https://accenture.github.io/reactive-interaction-gateway
# Helm v3
helm install rig accenture/reactive-interaction-gateway
# Helm v2
helm install --name=rig accenture/reactive-interaction-gateway-helm-v2
```

## Helm
Check out the [Helm v2 README](helm/reactive-interaction-gateway-helm-v2/README.md) or [Helm v3 README](./helm/reactive-interaction-gateway/README.md) and [Operator's Guide](https://accenture.github.io/reactive-interaction-gateway/docs/rig-ops-guide.html) for more information on configuring RIG.

The Helm Charts are stored in [./helm2](./helm2) and [./helm3](./helm3) directory, which are essentially the same but only use a different `apiVersion` in the `Chart.yaml`.
## Deploy with kubectl

### Version 2
> This deployment is not recommended as lots of configurations is hard coded

```bash
cd helm2
# dry run to verify that everything is ok
helm install --name=rig reactive-interaction-gateway --dry-run
# install
helm install --name=rig reactive-interaction-gateway
kubectl apply -f kubectl/rig.yaml
```

### Version 3

```bash
cd helm3
# dry run to verify that everything is ok
helm install rig reactive-interaction-gateway --dry-run
# install
helm install rig reactive-interaction-gateway
```
## Some Additional information

## Communication
### Communication

Both `kubectl` and `helm` deploy bunch of Kubernetes resources:

Expand All @@ -41,26 +33,25 @@ Both `kubectl` and `helm` deploy bunch of Kubernetes resources:
To allow external communication (outside of your cluster) do:

```bash
# both helm versions
helm upgrade --set service.type=LoadBalancer rig reactive-interaction-gateway
helm upgrade --set service.type=LoadBalancer rig accenture/reactive-interaction-gateway
# for kubectl update kubectl/rig.yaml to use a service of type LoadBalancer instead of ClusterIP
```

## Scaling
### Scaling

Scale the deployment and create multiple pods

```bash
helm upgrade --set service.type=LoadBalancer --set replicaCount=<replicas> rig reactive-interaction-gateway
helm upgrade --set replicaCount=<replicas> rig accenture/reactive-interaction-gateway
# or
kubectl scale deployment/<deployment_name> --replicas <replicas>
```

You can also inspect the logs of the pods with `kubectl logs <pod_name>` to see how they automatically re-balance Kafka consumers (if you are using Kafka) and adapt Proxy APIs from other nodes.

## Configuration
### Configuration

### Node host
#### Node host

Every node in cluster needs to be discoverable by other nodes. For that Elixir/Erlang uses so called `long name` or `short name`. We are using `long name` which is formed in the following way `app_name@node_host`. `app_name` is in our case set to `rig` and `node_host` is taken from environment variable `NODE_HOST`. This can be either IP or container alias or whatever that is routable in network by other nodes.

Expand All @@ -73,13 +64,13 @@ We are using the pod IP with:
fieldPath: status.podIP
```

### Node cookie
#### Node cookie

Nodes in Erlang cluster use cookies as a form of authorization/authentication between them. Only nodes with the same cookie can communicate together. Ideally, it is some generated hash, that's why we recommend adapting `NODE_COOKIE` environment variable in the `values.yaml`.

### Additional configuration
#### Additional configuration

You can configure bunch of environment variables, please check the [Operator's Guide](https://accenture.github.io/reactive-interaction-gateway/docs/rig-ops-guide.html).
You can configure bunch of environment variables, please check the [Helm v2 README](helm/reactive-interaction-gateway-helm-v2/README.md) or [Helm v3 README](./helm/reactive-interaction-gateway/README.md) and [Operator's Guide](https://accenture.github.io/reactive-interaction-gateway/docs/rig-ops-guide.html).

## Cleanup

Expand Down
21 changes: 21 additions & 0 deletions deployment/helm/reactive-interaction-gateway-helm-v2/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
name: reactive-interaction-gateway-helm-v2
description: A Helm v2 chart for Kubernetes
home: https://github.com/Accenture/reactive-interaction-gateway
icon: https://github.com/Accenture/reactive-interaction-gateway/blob/master/logo/Reactive-Interaction-Gateway-logo-cropped.png

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 1.0.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 3.0.0-alpha.1

maintainers:
- name: kevinbader
url: https://github.com/kevinbader
- name: mmacai
url: https://github.com/mmacai
- name: Knappek
url: https://github.com/Knappek
35 changes: 35 additions & 0 deletions deployment/helm/reactive-interaction-gateway-helm-v2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# reactive-interaction-gateway-helm-v2

![Version: 1.0.1](https://img.shields.io/badge/Version-1.0.1-informational?style=flat-square) ![AppVersion: 3.0.0-alpha.1](https://img.shields.io/badge/AppVersion-3.0.0-alpha.1-informational?style=flat-square)

A Helm v2 chart for Kubernetes

**Homepage:** <https://github.com/Accenture/reactive-interaction-gateway>

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| kevinbader | | https://github.com/kevinbader |
| mmacai | | https://github.com/mmacai |
| Knappek | | https://github.com/Knappek |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| deployment.env.API_HTTPS_PORT | int | `4011` | See docs/rig-ops-guide.md |
| deployment.env.API_HTTP_PORT | int | `4010` | See docs/rig-ops-guide.md |
| deployment.env.DISCOVERY_TYPE | string | `"dns"` | See docs/rig-ops-guide.md |
| deployment.env.INBOUND_HTTPS_PORT | int | `4001` | See docs/rig-ops-guide.md |
| deployment.env.INBOUND_PORT | int | `4000` | See docs/rig-ops-guide.md |
| deployment.env.LOG_LEVEL | string | `"warn"` | See docs/rig-ops-guide.md |
| deployment.env.NODE_COOKIE | string | `"magiccookie"` | See docs/rig-ops-guide.md |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"accenture/reactive-interaction-gateway"` | |
| nodeSelector | object | `{}` | |
| replicaCount | int | `1` | |
| resources | object | `{}` | |
| service.type | string | `"ClusterIP"` | |
| tolerations | list | `[]` | |
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ spec:
labels:
{{- include "reactive-interaction-gateway.selectorLabels" . | nindent 8 }}
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
runAsNonRoot: true
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ service:

deployment:
env:
## Proxy ports
# Proxy ports
# deployment.env.INBOUND_PORT -- See docs/rig-ops-guide.md
INBOUND_PORT: 4000
# deployment.env.INBOUND_HTTPS_PORT -- See docs/rig-ops-guide.md
INBOUND_HTTPS_PORT: 4001
## Internal HTTP API ports
# deployment.env.API_HTTP_PORT -- See docs/rig-ops-guide.md
API_HTTP_PORT: 4010
# deployment.env.API_HTTPS_PORT -- See docs/rig-ops-guide.md
API_HTTPS_PORT: 4011

## Hostname for HTTP endpoints
Expand All @@ -35,10 +38,11 @@ deployment:
# CORS: *

## Discovery
# deployment.env.DISCOVERY_TYPE -- See docs/rig-ops-guide.md
DISCOVERY_TYPE: dns
## DNS_NAME is set dynamically
## NODE_HOST is set dynamically to PodIP in "templates/deployment.yaml"
## Change magiccookie to some individual hash
# deployment.env.NODE_COOKIE -- See docs/rig-ops-guide.md
NODE_COOKIE: magiccookie


Expand Down Expand Up @@ -101,7 +105,8 @@ deployment:
# JWT_SESSION_FIELD: /userId

## Logging
# REQUEST_LOG: console,kafka
## REQUEST_LOG: console,kafka
# deployment.env.LOG_LEVEL -- See docs/rig-ops-guide.md
LOG_LEVEL: warn

## SSE, WS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
apiVersion: v1
apiVersion: v2
name: reactive-interaction-gateway
description: A Helm chart for Kubernetes
home: https://github.com/Accenture/reactive-interaction-gateway
icon: https://github.com/Accenture/reactive-interaction-gateway/blob/master/logo/Reactive-Interaction-Gateway-logo-cropped.png

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 1.0.0
version: 1.0.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 3.0.0-alpha.1

maintainers:
- name: kevinbader
url: https://github.com/kevinbader
- name: mmacai
url: https://github.com/mmacai
- name: Knappek
url: https://github.com/Knappek
35 changes: 35 additions & 0 deletions deployment/helm/reactive-interaction-gateway/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# reactive-interaction-gateway

![Version: 1.0.1](https://img.shields.io/badge/Version-1.0.1-informational?style=flat-square) ![AppVersion: 2.4.0](https://img.shields.io/badge/AppVersion-2.4.0-informational?style=flat-square)

A Helm chart for Kubernetes

**Homepage:** <https://github.com/Accenture/reactive-interaction-gateway>

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| kevinbader | | https://github.com/kevinbader |
| mmacai | | https://github.com/mmacai |
| Knappek | | https://github.com/Knappek |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| deployment.env.API_HTTPS_PORT | int | `4011` | See docs/rig-ops-guide.md |
| deployment.env.API_HTTP_PORT | int | `4010` | See docs/rig-ops-guide.md |
| deployment.env.DISCOVERY_TYPE | string | `"dns"` | See docs/rig-ops-guide.md |
| deployment.env.INBOUND_HTTPS_PORT | int | `4001` | See docs/rig-ops-guide.md |
| deployment.env.INBOUND_PORT | int | `4000` | See docs/rig-ops-guide.md |
| deployment.env.LOG_LEVEL | string | `"warn"` | See docs/rig-ops-guide.md |
| deployment.env.NODE_COOKIE | string | `"magiccookie"` | See docs/rig-ops-guide.md |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"accenture/reactive-interaction-gateway"` | |
| nodeSelector | object | `{}` | |
| replicaCount | int | `1` | |
| resources | object | `{}` | |
| service.type | string | `"ClusterIP"` | |
| tolerations | list | `[]` | |
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ spec:
labels:
{{- include "reactive-interaction-gateway.selectorLabels" . | nindent 8 }}
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
runAsNonRoot: true
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ service:

deployment:
env:
## Proxy ports
# Proxy ports
# deployment.env.INBOUND_PORT -- See docs/rig-ops-guide.md
INBOUND_PORT: 4000
# deployment.env.INBOUND_HTTPS_PORT -- See docs/rig-ops-guide.md
INBOUND_HTTPS_PORT: 4001
## Internal HTTP API ports
# deployment.env.API_HTTP_PORT -- See docs/rig-ops-guide.md
API_HTTP_PORT: 4010
# deployment.env.API_HTTPS_PORT -- See docs/rig-ops-guide.md
API_HTTPS_PORT: 4011

## Hostname for HTTP endpoints
Expand All @@ -35,10 +38,11 @@ deployment:
# CORS: *

## Discovery
# deployment.env.DISCOVERY_TYPE -- See docs/rig-ops-guide.md
DISCOVERY_TYPE: dns
## DNS_NAME is set dynamically
## NODE_HOST is set dynamically to PodIP in "templates/deployment.yaml"
## Change magiccookie to some individual hash
# deployment.env.NODE_COOKIE -- See docs/rig-ops-guide.md
NODE_COOKIE: magiccookie


Expand Down Expand Up @@ -101,7 +105,8 @@ deployment:
# JWT_SESSION_FIELD: /userId

## Logging
# REQUEST_LOG: console,kafka
## REQUEST_LOG: console,kafka
# deployment.env.LOG_LEVEL -- See docs/rig-ops-guide.md
LOG_LEVEL: warn

## SSE, WS
Expand Down
Loading