https://github.com/flowcore-io/service-core-secret-request-controller
https://github.com/flowcore-io/service-core-secret-request-controller
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/flowcore-io/service-core-secret-request-controller
- Owner: flowcore-io
- Created: 2023-08-19T14:06:53.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-16T09:38:54.000Z (about 2 years ago)
- Last Synced: 2025-01-09T11:54:45.511Z (over 1 year ago)
- Language: TypeScript
- Size: 207 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Secret Request Controller
A secret request [metacontroller](https://metacontroller.github.io/metacontroller/intro.html) hook that handles requests for secrets from within the kubernetes cluster
## Key Systems
### NestJS Structure
```mermaid
classDiagram
class AppModule
class MetaModule
class MetaController
class MetaService
class IngestionAdapterModule
class IngestionAdapterService
class Kubernetes
AppModule *-- MetaModule
AppModule *-- IngestionAdapterModule
IngestionAdapterModule *-- IngestionAdapterService
MetaModule *-- MetaController
MetaModule *-- MetaService
MetaController ..> MetaService
MetaService ..> IngestionAdapterService
Kubernetes ..> MetaController: External
```
### Environment Variables
| Environment Variable | Description | Type | Default Value | Required |
|------------------------|-----------------------------------------|:--------:|------------------|:--------:|
| PORT | The port the service will listen on | `number` | `3000` | |
## Installation
To install the [metacontroller](https://metacontroller.github.io/metacontroller/intro.html) on your own environment you first need to install metacontroller using helm
example values file:
```yaml
replicas: 2
commandArgs:
- --zap-log-level=4
- --discovery-interval=20s
- --leader-election=true
- --workers=10
```
```bash
helm install oci://ghcr.io/metacontroller/metacontroller-helm --version=4.11.12 --values ./values.yaml
```
then install the controller manually
```bash
curl -s https://raw.githubusercontent.com/flowcore-io/service-core-secret-request-controller/main/crd/metacontroller-controller.yaml | kubectl apply -n flowcore -f -
```
or using helm
```bash
helm add repo flowcore https://flowcore-io.github.io/helm-charts
helm install secret-request-controller flowcore/secret-request-controller
```
> Note: see the [helm chart](https://github.com/flowcore-io/flowcore-helm-charts/blob/main/charts/flowcore-secret-request-controller/README.md) for more information
This will install the controller and the crds required to run the controller.
## Usage
To use the controller you need to create a secret request object, they look like this and are cluster scoped:
```yaml
apiVersion: flowcore.io/v1
kind: SecretRequest
metadata:
name: my-secret-request
spec:
sourceSecret:
name: source-secret-name
namespace: source-secret-namespace
destinationSecret:
name: destination-secret-name
namespace: destination-secret-namespace
```
## Development
To start using the project just configure it using:
### Configuration
```bash
yarn install
yarn reconfigure
```
### Testing
local testing requires a local kubernetes cluster to be running, this can be done using kind
```bash
brew install kind
kind create cluster --name local
```
### Run
run with:
```bash
yarn start
```