From f04bdc36182d1c4689eb045b0199d220e12c03c2 Mon Sep 17 00:00:00 2001 From: Faisal Memon Date: Fri, 22 Sep 2023 14:55:03 -0700 Subject: [PATCH] Add support for experimental flags (#492) Add support for the experimental section of the config. Needed for developers. This PR doesnt add support for the `auth_opa_policy_engine` experimental config. --------- Signed-off-by: Faisal Memon --- charts/spire/charts/spire-server/README.md | 3 +++ .../charts/spire-server/templates/configmap.yaml | 13 +++++++++++++ charts/spire/charts/spire-server/values.yaml | 8 ++++++++ charts/spire/templates/NOTES.txt | 8 ++++++-- 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/charts/spire/charts/spire-server/README.md b/charts/spire/charts/spire-server/README.md index 9222c7a..80f223c 100644 --- a/charts/spire/charts/spire-server/README.md +++ b/charts/spire/charts/spire-server/README.md @@ -279,6 +279,9 @@ In order to run Tornjak with simple HTTP Connection only, make sure you don't cr | `tornjak.config.clientCA.type` | Type of delivery for the user CA for TLS client verification. Options are `Secret` or `ConfigMap` (required for `mtls` connectionType) | `Secret` | | `tornjak.config.clientCA.name` | Name of the resource secret or configMap with user CA for TLS | `tornjak-client-ca` | | `tornjak.resources` | Resource requests and limits | `{}` | +| `experimental.enabled` | Allow configuration of experimental features | `false` | +| `experimental.cacheReloadInterval` | The amount of time between two reloads of the in-memory entry cache. | `5s` | +| `experimental.featureFlags` | List of developer feature flags | `[]` | | `tests.hostAliases` | List of host aliases for testing | `[]` | | `tests.tls.enabled` | Flag for enabling tls for tests | `false` | | `tests.tls.customCA` | Custom CA value for tests | `""` | diff --git a/charts/spire/charts/spire-server/templates/configmap.yaml b/charts/spire/charts/spire-server/templates/configmap.yaml index 1fea319..f540c57 100644 --- a/charts/spire/charts/spire-server/templates/configmap.yaml +++ b/charts/spire/charts/spire-server/templates/configmap.yaml @@ -49,6 +49,19 @@ server: {{- end }} {{- end }} + {{- with .Values.experimental }} + {{- if eq (.enabled | toString) "true" }} + experimental: + cache_reload_interval: {{ .cacheReloadInterval | quote }} + {{- if gt (len .featureFlags) 0 }} + feature_flags: + {{- range .featureFlags }} + - {{ . | quote }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + plugins: DataStore: sql: diff --git a/charts/spire/charts/spire-server/values.yaml b/charts/spire/charts/spire-server/values.yaml index c66ed60..01cf2cc 100644 --- a/charts/spire/charts/spire-server/values.yaml +++ b/charts/spire/charts/spire-server/values.yaml @@ -628,6 +628,14 @@ customPlugins: upstreamAuthority: {} notifier: {} +experimental: + ## @param experimental.enabled Allow configuration of experimental features + enabled: false + ## @param experimental.cacheReloadInterval The amount of time between two reloads of the in-memory entry cache. + cacheReloadInterval: 5s + ## @param experimental.featureFlags [array] List of developer feature flags + featureFlags: [] + tests: ## @param tests.hostAliases [array] List of host aliases for testing hostAliases: [] diff --git a/charts/spire/templates/NOTES.txt b/charts/spire/templates/NOTES.txt index 519b6c1..f1f6983 100644 --- a/charts/spire/templates/NOTES.txt +++ b/charts/spire/templates/NOTES.txt @@ -3,6 +3,10 @@ Installed {{ .Chart.Name }}… {{- $s := add (len $up.keyManager) (len $up.nodeAttestor) (len $up.upstreamAuthority) (len $up.notifier) }} {{- if gt $s 0 }} -Warning: - You are using an unsupported plugin. Functionality of this release and future upgrades are not guaranteed to work smoothly. +Warning: You're using an unsupported plugin. Functionality of this release and future upgrades aren't guaranteed to work smoothly. +{{- end }} + +{{- if eq ((index .Values "spire-server").experimental.enabled | toString) "true" }} + +Warning: You're using an experimental config. Functionality of this release and future upgrades aren't guaranteed to work smoothly. {{- end }}