https://github.com/kubescape/gateway
Gateway is an in-cluster component of the Kubescape security platform. It broadcasts a message received to its registered clients. When a client registers itself in a Gateway it must provide a set of attributes, which will serve as identification, for message routing purposes.
https://github.com/kubescape/gateway
kubescape kubescape-helm
Last synced: 2 months ago
JSON representation
Gateway is an in-cluster component of the Kubescape security platform. It broadcasts a message received to its registered clients. When a client registers itself in a Gateway it must provide a set of attributes, which will serve as identification, for message routing purposes.
- Host: GitHub
- URL: https://github.com/kubescape/gateway
- Owner: kubescape
- License: apache-2.0
- Archived: true
- Created: 2022-03-13T16:56:18.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-01-07T12:46:21.000Z (6 months ago)
- Last Synced: 2025-05-05T18:47:24.346Z (2 months ago)
- Topics: kubescape, kubescape-helm
- Language: Go
- Homepage:
- Size: 389 KB
- Stars: 2
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Archived
This repository has been archived and is no longer in active use or maintained, as part of the Gateway component [deprecation](https://github.com/kubescape/helm-charts/pull/565).# Gateway
The Gateway enables broadcasting a single message to the different microservices running in the cluster.
The gateway works as a tree: there is the root and the different leafs.
The leafs “attach” to the root using a set of attributes, while the root provides an API.When broadcasting a message, the message must contain the attributes to whom it should be broadcast.
The root will broadcast the message to all the leafs that registered with those attributes.
## Building gateway
To build the gateway run: `go build .`## Configuration
Load config file using the `CONFIG` environment variable`export CONFIG=path/to/clusterData.json`
example/clusterData.json
```json5
{
"gatewayWebsocketURL": "127.0.0.1:8001",
"gatewayRestURL": "127.0.0.1:8002",
"kubevulnURL": "127.0.0.1:8081",
"kubescapeURL": "127.0.0.1:8080",
"eventReceiverRestURL": "https://report.armo.cloud",
"eventReceiverWebsocketURL": "wss://report.armo.cloud",
"rootGatewayURL": "wss://ens.euprod1.cyberarmorsoft.com/v1/waitfornotification",
"accountID": "*********************",
"clusterName": "******"
}
```## API Documentation
As mentioned before, the Gateway exposes an HTTP API.
You can learn more about the API using one of the provided interactive OpenAPI UIs:
- SwaggerUI, available at `/openapi/v2/swaggerui`
- RapiDoc, available at `/openapi/v2/rapi`
- Redoc, available at `/openapi/v2/docs`## Supported environment variables
* `WEBSOCKET_PORT`: websocket port (default `8001`)
* `HTTP_PORT`: restAPI port (default `8002`)For more details on environment variables, check out `pkg/environmentvariables.go`.
## VS code configuration samples
You can use the sample file below to setup your VS code environment for building and debugging purposes.
.vscode/launch.json
```json5
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceRoot}",
"env": {
"NAMESPACE": "armo-system",
"CONFIG": "${workspaceRoot}/.vscode/clusterData.json",
},
"args": [
"-alsologtostderr", "-v=4", "2>&1"
]
}
]
}
```