Skip to content
Open
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ test-helm: ## Test Helm charts (lint, template, validate)
--set image.repository=openshift-hyperfleet/hyperfleet-sentinel \
--set image.tag=latest \
--set broker.type=googlepubsub \
--set broker.googlepubsub.projectId=test-project > /dev/null
--set broker.googlepubsub.project_id=test-project > /dev/null
@echo "Google Pub/Sub broker template OK"
@echo ""
@echo "Testing template with PodMonitoring enabled..."
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ Broker configuration is managed by the [hyperfleet-broker library](https://githu

| Variable | Description | Example |
|----------|-------------|---------|
| `BROKER_TOPIC` | Topic name for publishing events | `hyperfleet-dev-clusters` |
| `HYPERFLEET_BROKER_TOPIC` | Topic name for publishing events | `hyperfleet-dev-clusters` |

The `BROKER_TOPIC` environment variable sets the full topic name where events will be published. When using Helm, the default topic is `{namespace}-{resourceType}` (e.g., `hyperfleet-dev-clusters`, `hyperfleet-dev-nodepools`). This enables isolation between different environments or tenants sharing the same broker. See [Naming Strategy](https://github.com/openshift-hyperfleet/architecture/blob/main/hyperfleet/components/sentinel/sentinel-naming-strategy.md) for details.
The `HYPERFLEET_BROKER_TOPIC` environment variable sets the full topic name where events will be published. When using Helm, the default topic is `{namespace}-{resourceType}` (e.g., `hyperfleet-dev-clusters`, `hyperfleet-dev-nodepools`). This enables isolation between different environments or tenants sharing the same broker. See [Naming Strategy](https://github.com/openshift-hyperfleet/architecture/blob/main/hyperfleet/components/sentinel/sentinel-naming-strategy.md) for details.

For detailed broker configuration options, see the [hyperfleet-broker documentation](https://github.com/openshift-hyperfleet/hyperfleet-broker).

Expand Down
11 changes: 9 additions & 2 deletions charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,19 @@ The following table lists the configurable parameters of the Sentinel chart and

| Parameter | Description | Default |
|-----------|-------------|---------|
| `config.sentinel.name` | Sentinel component name (supports Helm templates) | `hyperfleet-sentinel-{{ .Values.config.resourceType }}` |
| `config.debugConfig` | Log the full merged configuration after load | `false` |
| `config.tracingEnabled` | Enable OpenTelemetry tracing | `true` |
| `config.log.level` | Log level: `debug`, `info`, `warn`, `error` | `info` |
| `config.log.format` | Log format: `text`, `json` | `json` |
| `config.log.output` | Log output: `stdout`, `stderr` | `stdout` |
| `config.resourceType` | Resource type to watch | `clusters` |
| `config.pollInterval` | Polling interval | `5s` |
| `config.messageDecision` | CEL-based decision logic (params + result) | See values.yaml |
| `config.resourceSelector` | Resource selector for sharding | See values.yaml |
| `config.hyperfleetApi.baseUrl` | HyperFleet API base URL | `http://hyperfleet-api:8000` |
| `config.hyperfleetApi.timeout` | API timeout | `5s` |
| `config.clients.hyperfleetApi.baseUrl` | HyperFleet API base URL | `http://hyperfleet-api:8000` |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Category: Inconsistency

The table was updated for the hyperfleetApi path change but doesn't add rows for the 6 new values.yaml parameters: config.sentinel.name, config.debugConfig, config.log.level, config.log.format, config.log.output, and config.clients.hyperfleetApi.version. Users won't know these are configurable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added

| `config.clients.hyperfleetApi.version` | HyperFleet API version | `v1` |
| `config.clients.hyperfleetApi.timeout` | API timeout | `10s` |
| `config.messageData` | CloudEvents data payload fields | See values.yaml |

### Broker Configuration
Expand Down
30 changes: 25 additions & 5 deletions charts/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,31 @@ metadata:
{{- include "sentinel.labels" . | nindent 4 }}
data:
config.yaml: |
# Sentinel information
sentinel:
name: {{ tpl .Values.config.sentinel.name . | quote }}

# Debug configuration
debug_config: {{ .Values.config.debugConfig }}

# Logging configuration
log:
level: {{ .Values.config.log.level | quote }}
format: {{ .Values.config.log.format | quote }}
output: {{ .Values.config.log.output | quote }}

# Client configurations
clients:
# HyperFleet API client
hyperfleet_api:
base_url: {{ .Values.config.clients.hyperfleetApi.baseUrl | quote }}
version: {{ .Values.config.clients.hyperfleetApi.version | quote }}
timeout: {{ .Values.config.clients.hyperfleetApi.timeout | quote }}

# Broker client
broker:
topic: {{ tpl .Values.broker.topic . | quote }}

# Sentinel configuration
resource_type: {{ .Values.config.resourceType }}
poll_interval: {{ .Values.config.pollInterval }}
Expand All @@ -19,11 +44,6 @@ data:
{{- end }}
{{- end }}

# HyperFleet API configuration
hyperfleet_api:
endpoint: {{ .Values.config.hyperfleetApi.baseUrl }}
timeout: {{ .Values.config.hyperfleetApi.timeout }}

{{- if .Values.config.messageDecision }}
# Configurable CEL-based decision logic
message_decision:
Expand Down
11 changes: 4 additions & 7 deletions charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- serve
- --config=/etc/sentinel/config.yaml
- --config=/etc/hyperfleet/config.yaml
ports:
- name: http
containerPort: 8080
Expand All @@ -66,10 +66,7 @@ spec:
env:
# Broker configuration file location
- name: BROKER_CONFIG_FILE
value: /etc/sentinel/broker.yaml
# Topic name for broker publishing
- name: BROKER_TOPIC
value: {{ tpl .Values.broker.topic . | quote }}
value: /etc/hyperfleet/broker.yaml
# Broker credentials can be overridden via environment variables from Secret
{{- if eq .Values.broker.type "rabbitmq" }}
- name: BROKER_RABBITMQ_URL
Expand All @@ -80,11 +77,11 @@ spec:
{{- end }}
volumeMounts:
- name: config
mountPath: /etc/sentinel/config.yaml
mountPath: /etc/hyperfleet/config.yaml
subPath: config.yaml
readOnly: true
- name: broker-config
mountPath: /etc/sentinel/broker.yaml
mountPath: /etc/hyperfleet/broker.yaml
subPath: broker.yaml
readOnly: true
resources:
Expand Down
36 changes: 30 additions & 6 deletions charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,36 @@ podDisruptionBudget:

# Sentinel configuration
config:
# Sentinel information
sentinel:
# Sentinel component name - will be templated with shard value if resource selector is used
# Example: hyperfleet-sentinel-clusters-shard-1
name: hyperfleet-sentinel-{{ .Values.config.resourceType }}

# Debug configuration - log merged config on startup
debugConfig: false

# Logging configuration
log:
level: info
format: json
output: stdout

# Client configurations
clients:
# HyperFleet API client configuration
hyperfleetApi:
# Use in-cluster service name for API endpoint
baseUrl: http://hyperfleet-api:8000
version: v1
timeout: 10s

# Broker configuration
# Note: broker implementation details (RabbitMQ URL, etc.) are in broker section below
broker:
# Topic will be set from broker.topic template below
topic: ""

# Resource type to watch (clusters, nodepools)
resourceType: clusters

Expand All @@ -104,12 +134,6 @@ config:
- label: shard
value: "1"

# HyperFleet API configuration
hyperfleetApi:
# Use in-cluster service name for API endpoint
baseUrl: http://hyperfleet-api:8000
timeout: 5s

# CloudEvents data payload configuration
messageData:
id: resource.id
Expand Down
Loading