Skip to content

Commit 27d69c3

Browse files
authored
re-enable: deployment: support nats configuration (#1633)
Signed-off-by: Miguel Martinez <[email protected]>
1 parent dfa77aa commit 27d69c3

File tree

5 files changed

+42
-9
lines changed

5 files changed

+42
-9
lines changed

deployment/chainloop/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Chainloop is an open source software supply chain control plane, a
77

88
type: application
99
# Bump the patch (not minor, not major) version on each change in the Chart Source code
10-
version: 1.154.0
10+
version: 1.154.1
1111
# Do not update appVersion, this is handled automatically by the release process
1212
appVersion: v0.136.0
1313

deployment/chainloop/README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -529,11 +529,16 @@ chainloop config save \
529529
| `controlplane.containerPorts.http` | controlplane HTTP container port | `8000` |
530530
| `controlplane.containerPorts.grpc` | controlplane gRPC container port | `9000` |
531531
| `controlplane.containerPorts.metrics` | controlplane prometheus metrics container port | `5000` |
532+
| `controlplane.enableProfiler` | Enable pprof profiling on port 6060 | `false` |
532533
| `controlplane.tls.existingSecret` | Existing secret name containing TLS certificate to be used by the controlplane grpc server. NOTE: When it's set it will disable secret creation. The secret must contains 2 keys: tls.crt and tls.key respectively containing the certificate and private key. | `""` |
533534
| `controlplane.pluginsDir` | Directory where to look for plugins | `/plugins` |
534535
| `controlplane.referrerSharedIndex` | Configure the shared, public index API endpoint that can be used to discover metadata referrers | |
535536
| `controlplane.referrerSharedIndex.enabled` | Enable index API endpoint | `false` |
536537
| `controlplane.referrerSharedIndex.allowedOrgs` | List of UUIDs of organizations that are allowed to publish to the shared index | `[]` |
538+
| `controlplane.nats` | optional NATS configuration for events publishing. | |
539+
| `controlplane.nats.enabled` | Enable events publishing through a Nats stream | `false` |
540+
| `controlplane.nats.host` | NATS Host | `""` |
541+
| `controlplane.nats.port` | NATS Port | `4222` |
537542
| `controlplane.onboarding.name` | Name of the organization to onboard | |
538543
| `controlplane.onboarding.role` | Role of the organization to onboard | |
539544
| `controlplane.prometheus_org_metrics` | List of organizations to expose metrics for using Prometheus | |
@@ -544,14 +549,17 @@ chainloop config save \
544549

545550
### Control Plane Database
546551

547-
| Name | Description | Value |
548-
| ---------------------------------------- | ----------------------------------------------------------------------------------------------------- | ------ |
549-
| `controlplane.externalDatabase` | External PostgreSQL configuration. These values are only used when postgresql.enabled is set to false | |
550-
| `controlplane.externalDatabase.host` | Database host | `""` |
551-
| `controlplane.externalDatabase.port` | Database port number | `5432` |
552-
| `controlplane.externalDatabase.user` | Non-root username | `""` |
553-
| `controlplane.externalDatabase.database` | Database name | `""` |
554-
| `controlplane.externalDatabase.password` | Password for the non-root username | `""` |
552+
| Name | Description | Value |
553+
| -------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ------ |
554+
| `controlplane.externalDatabase` | External PostgreSQL configuration. These values are only used when postgresql.enabled is set to false | |
555+
| `controlplane.externalDatabase.host` | Database host | `""` |
556+
| `controlplane.externalDatabase.port` | Database port number | `5432` |
557+
| `controlplane.externalDatabase.user` | Non-root username | `""` |
558+
| `controlplane.externalDatabase.database` | Database name | `""` |
559+
| `controlplane.externalDatabase.password` | Password for the non-root username | `""` |
560+
| `controlplane.externalDatabase.maxOpenConns` | Maximum number of open connections to the database. Default: max(4, num_cpus) | |
561+
| `controlplane.externalDatabase.minOpenConns` | Min number of connections. Default: 0 | |
562+
| `controlplane.externalDatabase.maxIdleTime` | Max time a connection may be idle. Default: 30m | |
555563

556564
### Control Plane Authentication
557565

deployment/chainloop/templates/_helpers.tpl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,3 +440,13 @@ Compile all warning messages into a single one
440440
{{- printf "\n\nVALUES VALIDATION:\n%s" $message -}}
441441
{{- end -}}
442442
{{- end -}}
443+
444+
445+
{{/*
446+
Return the Nats connection string
447+
*/}}
448+
{{- define "controlplane.nats.connection_string" -}}
449+
{{- $host := required "nats server hostname not set" .Values.controlplane.nats.host }}
450+
{{- $port := required "nats server port not set" .Values.controlplane.nats.port }}
451+
{{- printf "nats://%s:%d" $host ($port | int) }}
452+
{{- end -}}

deployment/chainloop/templates/controlplane/secret-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ stringData:
6363
{{- if and .Values.controlplane.externalDatabase.maxIdleTime }}
6464
max_conn_idle_time: "{{ .Values.controlplane.externalDatabase.maxIdleTime }}"
6565
{{- end }}
66+
67+
{{- if and .Values.controlplane.nats.enabled }} }}
68+
nats_server:
69+
uri: {{ include "controlplane.nats.connection_string" . | quote }}
70+
{{- end }}
71+
6672
6773
credentials_service: {{- include "chainloop.credentials_service_settings" . | indent 6 }}
6874

deployment/chainloop/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,15 @@ controlplane:
169169
referrerSharedIndex:
170170
enabled: false
171171
allowedOrgs: []
172+
173+
## @extra controlplane.nats optional NATS configuration for events publishing.
174+
## @param controlplane.nats.enabled Enable events publishing through a Nats stream
175+
## @param controlplane.nats.host NATS Host
176+
## @param controlplane.nats.port NATS Port
177+
nats:
178+
enabled: false
179+
host: ""
180+
port: 4222
172181

173182
## @extra controlplane.onboarding.name Name of the organization to onboard
174183
## @extra controlplane.onboarding.role Role of the organization to onboard

0 commit comments

Comments
 (0)