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
3 changes: 2 additions & 1 deletion .github/workflows/reusable_semantic_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
"version": "1.0.0",
"devDependencies": {
"semantic-release-export-data": "^1.0.1",
"semantic-release": "25.0.0-beta.6",
"@semantic-release/changelog": "^6.0.3"
}
}
Expand Down Expand Up @@ -87,7 +88,7 @@ jobs:
]
}
- name: setup semantic-release
run: npm i
run: npm install --legacy-peer-deps
- name: Release
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_OBSERVABILITY_RELEASE_WEBHOOK }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
"version": "1.0.0",
"devDependencies": {
"semantic-release-export-data": "^1.0.1",
"semantic-release": "25.0.0-beta.6",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/github": "^8.0.0",
Expand Down Expand Up @@ -94,7 +95,7 @@ jobs:
]
}
- name: setup semantic-release
run: npm i
run: npm install --legacy-peer-deps
- name: release dry-run
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_OBSERVABILITY_RELEASE_WEBHOOK }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Diode is a data ingestion service for NetBox that greatly simplifies and enhance

## Project Status

The Diode project is currently in the _Public Preview_ stage. Please see [NetBox Labs Product and Feature Lifecycle](https://netboxlabs.com/docs/console/product_feature_lifecycle/) for more details. We actively welcome feedback to help identify and prioritize bugs, new features and areas of improvement.
The Diode project is currently in the _General Availability (GA)_ stage. Please see [NetBox Labs Product and Feature Lifecycle](https://netboxlabs.com/docs/console/product_feature_lifecycle/) for more details. We actively welcome feedback to help identify and prioritize bugs, new features and areas of improvement.

## Prerequisites

Expand Down
2 changes: 1 addition & 1 deletion charts/diode/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: diode
description: A Helm chart for Diode
type: application
version: 1.7.0
version: 1.8.0
appVersion: "1.5.0"
home: https://github.com/netboxlabs/diode
sources:
Expand Down
14 changes: 11 additions & 3 deletions charts/diode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A Helm chart for Diode

![Version: 1.7.0](https://img.shields.io/badge/Version-1.7.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.5.0](https://img.shields.io/badge/AppVersion-1.5.0-informational?style=flat-square)
![Version: 1.8.0](https://img.shields.io/badge/Version-1.8.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.5.0](https://img.shields.io/badge/AppVersion-1.5.0-informational?style=flat-square)

## Prerequisites

Expand Down Expand Up @@ -304,16 +304,24 @@ helm show values diode/diode
| diodeReconciler.replicaCount | int | `1` | replica count |
| diodeReconciler.resources | object | `{"limits":{"cpu":"500m","memory":"512Mi"},"requests":{"cpu":"100m","memory":"128Mi"}}` | resources |
| diodeReconciler.serviceAccount.create | bool | `true` | create service account |
| externalPostgresql.database | string | `"diode"` | database name |
| externalPostgresql.existingSecretKey | string | `"postgresql-password"` | key of password in existing postgresql secret |
| externalPostgresql.existingSecretName | string | `""` | existing postgresql secret |
| externalPostgresql.hostname | string | `"localhost"` | hostname |
| externalPostgresql.password | string | `""` | password |
| externalPostgresql.port | int | `5432` | port |
| externalPostgresql.username | string | `"diode"` | username |
| externalRedis.hostname | string | `"localhost"` | hostname |
| externalRedis.port | int | `6379` | port |
| global.commonAnnotations | object | `{}` | common annotations for all resources |
| global.commonLabels | object | `{}` | common labels for all resources |
| global.diode | object | `{"busybox":{"image":"busybox:latest","imagePullPolicy":"IfNotPresent"},"hydra":{"waitForPostgres":true}}` | diode global configuration |
| global.diode | object | `{"busybox":{"image":"busybox:latest","imagePullPolicy":"IfNotPresent"},"hydra":{"waitForPostgres":true},"ingester":{"waitForRedis":true},"reconciler":{"waitForPostgres":true,"waitForRedis":true}}` | diode global configuration |
| global.diode.busybox | object | `{"image":"busybox:latest","imagePullPolicy":"IfNotPresent"}` | busybox image configuration |
| global.diode.hydra | object | `{"waitForPostgres":true}` | hydra additional init containers configuration |
| global.diode.hydra.waitForPostgres | bool | `true` | wait for PostgreSQL |
| global.diode.hydra.waitForPostgres | bool | `true` | wait for PostgreSQL to be reachable |
| global.diode.ingester.waitForRedis | bool | `true` | wait for Redis to be reachable |
| global.diode.reconciler.waitForPostgres | bool | `true` | wait for PostgreSQL to be reachable |
| global.diode.reconciler.waitForRedis | bool | `true` | wait for Redis to be reachable |
| hydra | object | `{"deployment":{"extraInitContainers":"{{ include \"diode.hydra.extrainitcontainers\" . }}","resources":{"limits":{"cpu":"500m","memory":"512Mi"},"requests":{"cpu":"100m","memory":"128Mi"}}},"enabled":true,"fullnameOverride":"diode-hydra","hydra":{"automigration":{"enabled":true},"config":{"oidc":{"subject_identifiers":{"supported_types":["public"]}},"strategies":{"access_token":"jwt","jwt":{"scope_claim":"both"}},"ttl":{"access_token":"1h"},"urls":{"self":{"issuer":"http://diode-hydra-public.{{ .Release.Namespace }}.svc.cluster.local:4444"}}},"dev":true,"ingress":{"admin":{"enabled":false},"public":{"enabled":false}},"service":{"admin":{"enabled":true,"port":4445,"type":"ClusterIP"},"public":{"enabled":true,"port":4444,"type":"ClusterIP"}}},"job":{"annotations":{"helm.sh/hook":"post-install, post-upgrade","helm.sh/hook-delete-policy":"hook-succeeded","helm.sh/hook-weight":"1"},"extraInitContainers":"{{ include \"diode.hydra.extrainitcontainers\" . }}"},"secret":{"enabled":false,"nameOverride":"diode-hydra-secret"}}` | ref: https://github.com/ory/k8s/blob/master/helm/charts/hydra/values.yaml |
| hydra.deployment.extraInitContainers | string or list | `"{{ include \"diode.hydra.extrainitcontainers\" . }}"` | extra init containers |
| hydra.deployment.resources | object | `{"limits":{"cpu":"500m","memory":"512Mi"},"requests":{"cpu":"100m","memory":"128Mi"}}` | resources |
Expand Down
52 changes: 52 additions & 0 deletions charts/diode/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,58 @@ Create the port of the Redis database
{{- end }}
{{- end }}

{{/*
Create the database name for PostgreSQL
*/}}
{{- define "diode.postgresql.database" -}}
{{- if .Values.postgresql.enabled -}}
{{- printf "diode" }}
{{- else if and .Values.externalPostgresql (hasKey .Values.externalPostgresql "database") -}}
{{- .Values.externalPostgresql.database }}
{{- else -}}
{{- fail "externalPostgresql.database must be defined when postgresql.enabled is false" }}
{{- end }}
{{- end }}

{{/*
Create the username for PostgreSQL
*/}}
{{- define "diode.postgresql.username" -}}
{{- if .Values.postgresql.enabled -}}
{{- printf "diode" }}
{{- else if and .Values.externalPostgresql (hasKey .Values.externalPostgresql "username") -}}
{{- .Values.externalPostgresql.username }}
{{- else -}}
{{- fail "externalPostgresql.username must be defined when postgresql.enabled is false" }}
{{- end }}
{{- end }}

{{/*
Create the secret name for PostgreSQL credentials
*/}}
{{- define "diode.postgresql.secretname" -}}
{{- if .Values.postgresql.enabled -}}
{{- printf "diode-postgresql-secret" }}
{{- else if and .Values.externalPostgresql (hasKey .Values.externalPostgresql "existingSecretName") (not (empty .Values.externalPostgresql.existingSecretName)) -}}
{{- .Values.externalPostgresql.existingSecretName }}
{{- else -}}
{{- printf "diode-external-postgresql-secret" }}
{{- end }}
{{- end }}

{{/*
Create the secret key for PostgreSQL password
*/}}
{{- define "diode.postgresql.secretkey" -}}
{{- if .Values.postgresql.enabled -}}
{{- printf "postgres-password" }}
{{- else if and .Values.externalPostgresql (hasKey .Values.externalPostgresql "existingSecretKey") (not (empty .Values.externalPostgresql.existingSecretKey)) -}}
{{- .Values.externalPostgresql.existingSecretKey }}
{{- else -}}
{{- printf "postgresql-password" }}
{{- end }}
{{- end }}

{{/*
Create the hostname of the public Hydra service
*/}}
Expand Down
6 changes: 3 additions & 3 deletions charts/diode/templates/diode-ingester-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
{{- toYaml .Values.diodeIngester.image.imagePullSecrets | nindent 8 }}
{{- end }}
initContainers:
{{- if .Values.redis.enabled }}
{{- if .Values.global.diode.ingester.waitForRedis }}
- name: wait-for-redis
image: {{ include "diode.busybox.image" . }}
imagePullPolicy: {{ include "diode.busybox.imagepullpolicy" . }}
Expand All @@ -53,8 +53,8 @@ spec:
done;
echo "Redis server is up and running";
{{- end }}
{{- if .Values.diodeAuth.extraInitContainers }}
{{- include "common.tplvalues.render" ( dict "value" .Values.diodeAuth.extraInitContainers "context" $ ) | nindent 8 }}
{{- if .Values.diodeIngester.extraInitContainers }}
{{- include "common.tplvalues.render" ( dict "value" .Values.diodeIngester.extraInitContainers "context" $ ) | nindent 8 }}
{{- end }}
containers:
- name: {{ include "diode.ingester.servicename" . }}
Expand Down
4 changes: 2 additions & 2 deletions charts/diode/templates/diode-reconciler-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ data:
DIODE_TO_NETBOX_RATE_LIMITER_BURST: {{ $config.diodeToNetboxRateLimiterBurst | default "1" | quote }}
POSTGRES_HOST: {{ include "diode.postgresql.hostname" . | quote }}
POSTGRES_PORT: {{ include "diode.postgresql.port" . | quote }}
POSTGRES_DB_NAME: {{ $config.postgresDbName | default "diode" | quote }}
POSTGRES_USER: {{ $config.postgresUser | default "diode" | quote }}
POSTGRES_DB_NAME: {{ include "diode.postgresql.database" . | quote }}
POSTGRES_USER: {{ include "diode.postgresql.username" . | quote }}
NETBOX_DIODE_PLUGIN_API_BASE_URL: {{ $config.netboxDiodePluginApiBaseUrl | quote }}
NETBOX_DIODE_PLUGIN_SKIP_TLS_VERIFY: {{ $config.netboxDiodePluginSkipTlsVerify | quote }}
DIODE_AUTH_TOKEN_URL: {{ printf "%s/token" (include "diode.auth.url" .) | quote }}
Expand Down
20 changes: 13 additions & 7 deletions charts/diode/templates/diode-reconciler-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
{{- toYaml .Values.diodeReconciler.image.imagePullSecrets | nindent 8 }}
{{- end }}
initContainers:
{{- if .Values.redis.enabled }}
{{- if .Values.global.diode.reconciler.waitForRedis }}
- name: wait-for-redis
image: {{ include "diode.busybox.image" . }}
imagePullPolicy: {{ include "diode.busybox.imagepullpolicy" . }}
Expand All @@ -53,7 +53,7 @@ spec:
done;
echo "Redis server is up and running";
{{- end }}
{{- if .Values.postgresql.enabled }}
{{- if .Values.global.diode.reconciler.waitForPostgres }}
- name: wait-for-postgres
image: {{ include "diode.busybox.image" . }}
imagePullPolicy: {{ include "diode.busybox.imagepullpolicy" . }}
Expand All @@ -67,8 +67,8 @@ spec:
done;
echo "PostgreSQL server is up and running";
{{- end }}
{{- if .Values.diodeAuth.extraInitContainers }}
{{- include "common.tplvalues.render" ( dict "value" .Values.diodeAuth.extraInitContainers "context" $ ) | nindent 8 }}
{{- if .Values.diodeReconciler.extraInitContainers }}
{{- include "common.tplvalues.render" ( dict "value" .Values.diodeReconciler.extraInitContainers "context" $ ) | nindent 8 }}
{{- end }}
containers:
- name: {{ include "diode.reconciler.servicename" . }}
Expand All @@ -84,9 +84,15 @@ spec:
resources:
{{- toYaml .| nindent 12 }}
{{- end }}
{{- if .Values.diodeReconciler.extraEnvs }}
env: {{- include "common.tplvalues.render" (dict "value" .Values.diodeReconciler.extraEnvs "context" $) | nindent 12 }}
{{- end }}
env:
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "diode.postgresql.secretname" . }}
key: {{ include "diode.postgresql.secretkey" . }}
{{- if .Values.diodeReconciler.extraEnvs }}
{{- include "common.tplvalues.render" (dict "value" .Values.diodeReconciler.extraEnvs "context" $) | nindent 12 }}
{{- end }}
envFrom:
- configMapRef:
name: {{ include "diode.reconciler.configmap" . }}
Expand Down
16 changes: 16 additions & 0 deletions charts/diode/templates/diode-secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if and (not .Values.postgresql.enabled) (not .Values.externalPostgresql.existingSecretName) (not (empty .Values.externalPostgresql.password)) }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "diode.postgresql.secretname" . }}
namespace: {{ include "diode.namespace" . }}
labels:
{{- include "diode.labels" . | nindent 4 }}
{{- if .Values.global.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.global.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
type: Opaque
data:
{{ include "diode.postgresql.secretkey" . }}: {{ .Values.externalPostgresql.password | b64enc | quote }}
{{- end }}
21 changes: 19 additions & 2 deletions charts/diode/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,23 @@ global:
imagePullPolicy: IfNotPresent
# -- hydra additional init containers configuration
hydra:
# -- wait for PostgreSQL
# -- wait for PostgreSQL to be reachable
waitForPostgres: true
ingester:
# -- wait for Redis to be reachable
waitForRedis: true
reconciler:
# -- wait for PostgreSQL to be reachable
waitForPostgres: true
# -- wait for Redis to be reachable
waitForRedis: true

# -- common annotations for all resources
commonAnnotations: {}

# -- common labels for all resources
commonLabels: {}


diode:
# -- environment name
environment: development
Expand All @@ -27,6 +34,16 @@ externalPostgresql:
hostname: localhost
# -- port
port: 5432
# -- database name
database: diode
# -- username
username: diode
# -- password
password: ""
# -- existing postgresql secret
existingSecretName: ""
# -- key of password in existing postgresql secret
existingSecretKey: postgresql-password

# External Redis configuration (optional)
externalRedis:
Expand Down
Loading
Loading