Skip to content

Commit b86a8ca

Browse files
committed
helm chart for config manager
1 parent 96737b3 commit b86a8ca

16 files changed

Lines changed: 497 additions & 11 deletions

File tree

helm-charts/AGENTS.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,29 @@ The relevant skill if available for this project is: $helm-chart-patterns
1717

1818
## Repository Layout
1919

20+
This directory holds two independent charts.
21+
2022
- `README.md`: chart repository usage
21-
- `charts/README.md`: values and chart configuration documentation
23+
- `charts/README.md`: values and chart configuration documentation for `charts/vauthenticator`
2224
- `charts/vauthenticator/Chart.yaml`: chart metadata and dependencies
2325
- `charts/vauthenticator/values.yaml`: default values
2426
- `charts/vauthenticator/templates`: rendered Kubernetes resources, including workload ConfigMaps in `vauthenticator.yaml` and `vauthenticator-management-ui.yaml`
25-
- `changelog`: chart release notes
27+
- `changelog`: `charts/vauthenticator` release notes
28+
- `charts/config-manager/Chart.yaml`, `charts/config-manager/values.yaml`, `charts/config-manager/templates`: the `config-manager` chart
29+
- `charts/config-manager/README.md`: values and chart configuration documentation for `charts/config-manager`
30+
- `charts/config-manager/changelog`: `charts/config-manager` release notes
2631

2732
## Workloads
2833

29-
The current chart renders:
34+
`charts/vauthenticator` renders:
3035

3136
- `application`: the VAuthenticator authorization server
3237
- `managementUi`: the management UI application image configured by the chart templates
3338
- optional in-namespace Redis subchart
3439

35-
`config-manager` is a separate Go project at the repository root and is not currently templated by this chart unless a change explicitly adds that deployment.
40+
`charts/config-manager` renders the `config-manager` Go service (Deployment + ClusterIP Service
41+
only, no Ingress — see `charts/config-manager/README.md`). `config-manager`'s source lives at the
42+
repository root, separate from this chart.
3643

3744
## Build And Validation Commands
3845

@@ -41,6 +48,8 @@ From `helm-charts`:
4148
- `helm dependency update charts/vauthenticator`
4249
- `helm lint charts/vauthenticator --set application.ingress.host=localhost --set managementUi.ingress.host=localhost`
4350
- `helm template vauthenticator charts/vauthenticator --set application.ingress.host=localhost --set managementUi.ingress.host=localhost`
51+
- `helm lint charts/config-manager --set application.managementUiServerUrl=http://localhost`
52+
- `helm template config-manager charts/config-manager --set application.managementUiServerUrl=http://localhost`
4453

4554
## Conventions For Changes
4655

helm-charts/README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22

33
This directory contains the Helm chart repository assets for the VAuthenticator ecosystem.
44

5-
The current chart deploys:
5+
Two charts are published from this directory:
66

7-
- VAuthenticator authorization server (`application`)
8-
- VAuthenticator management UI workload (`managementUi`)
9-
- optional in-namespace Redis dependency from Bitnami
10-
11-
`config-manager` is a separate Go project in this monorepo and is not currently rendered by the chart.
7+
- `charts/vauthenticator`: VAuthenticator authorization server (`application`), management UI
8+
workload (`managementUi`), and an optional in-namespace Redis dependency from Bitnami
9+
- `charts/config-manager`: the `config-manager` runtime-config service consumed by the management UI
1210

1311
## Usage
1412

@@ -27,6 +25,9 @@ cd helm-charts
2725
helm dependency update charts/vauthenticator
2826
helm lint charts/vauthenticator --set application.ingress.host=localhost --set managementUi.ingress.host=localhost
2927
helm template vauthenticator charts/vauthenticator --set application.ingress.host=localhost --set managementUi.ingress.host=localhost
28+
29+
helm lint charts/config-manager --set application.managementUiServerUrl=http://localhost
30+
helm template config-manager charts/config-manager --set application.managementUiServerUrl=http://localhost
3031
```
3132

3233
## Redis
@@ -37,4 +38,5 @@ The chart can install Redis in the same namespace when `in-namespace.redis.enabl
3738

3839
## Documentation
3940

40-
Detailed chart values are documented in [charts/README.md](charts/README.md).
41+
Detailed chart values are documented in [charts/README.md](charts/README.md) (vauthenticator) and
42+
[charts/config-manager/README.md](charts/config-manager/README.md) (config-manager).

helm-charts/changelog/0.11.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# VAuthenticator helm charts 0.11
2+
3+
## :star: New Features
4+
5+
- add configurable Spring datasource settings to the `vauthenticator` chart and render `spring.datasource` when `application.profiles` includes `database`

helm-charts/changelog/0.12.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# VAuthenticator helm charts 0.12
2+
3+
## :star: New Features
4+
5+
- add `application.aws.sns.endpointOverride` and `application.aws.lambda.endpointOverride` to configure AWS SNS and Lambda endpoint overrides, matching the code defaults (blank/unset)
6+
- add `application.lambda.aws.enabled`, `application.lambda.aws.functionName`, and `application.lambda.aws.functionResultCacheTtl` to configure the Lambda-based token enhancer, matching the code defaults (`false`, `vauthenticator-token-enhancer`, `10s`)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: config-manager
3+
description: A Helm chart for the VAuthenticator management UI config-manager service
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: "0.1.0"
19+
20+
# This is the version number of the application being deployed. This number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "latest"
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# config-manager Chart Values
2+
3+
This document describes the values for the `charts/config-manager` Helm chart.
4+
5+
The chart deploys the `config-manager` Go service as a `ClusterIP` Service and Deployment,
6+
with an optional Ingress and an optional Gateway API `HTTPRoute` for external access. See
7+
`config-manager/AGENTS.md` for the runtime contract this chart configures.
8+
9+
## Development Commands
10+
11+
Run these commands from `helm-charts`:
12+
13+
```bash
14+
helm lint charts/config-manager --set application.managementUiServerUrl=http://localhost
15+
helm template config-manager charts/config-manager --set application.managementUiServerUrl=http://localhost
16+
```
17+
18+
## Image, Service, Resources
19+
20+
```yaml
21+
image:
22+
repository: mrflick72/vauthenticator-config-manager-k8s
23+
pullPolicy: Always
24+
tag: "latest"
25+
26+
service:
27+
type: ClusterIP
28+
port: 8086
29+
30+
resources:
31+
requests:
32+
cpu: "50m"
33+
memory: "32Mi"
34+
limits:
35+
cpu: "100m"
36+
memory: "64Mi"
37+
38+
replicaCount: 1
39+
```
40+
41+
| Name | Description | Default |
42+
| --- | --- | --- |
43+
| `image.repository` | Container image repository. | `mrflick72/vauthenticator-config-manager-k8s` |
44+
| `image.pullPolicy` | Container image pull policy. | `Always` |
45+
| `image.tag` | Container image tag. | `latest` |
46+
| `service.type` | Kubernetes service type. | `ClusterIP` |
47+
| `service.port` | Service and container port. Matches the app's `SERVER_ADDRESS` port. | `8086` |
48+
| `resources` | Container resource requests and limits. | See `values.yaml` |
49+
| `replicaCount` | Deployment replica count. | `1` |
50+
| `pod.probes.liveness.*` / `pod.probes.readiness.*` | Probe timing. Both probes call the unauthenticated `GET /api/config` endpoint. | `5`, `30` |
51+
| `labels` | Extra pod labels. | `{}` |
52+
| `selectorLabels` | Selector labels used by Deployment and Service. Change with care. | `app: vauthenticator-config-manager` |
53+
| `podAnnotations` | Extra pod annotations. | `{}` |
54+
| `imagePullSecrets` | Image pull secrets. | `[]` |
55+
56+
## Ingress
57+
58+
```yaml
59+
ingress:
60+
host: "*"
61+
annotations: {}
62+
tls: {}
63+
enabled: true
64+
class: nginx
65+
```
66+
67+
| Name | Description | Default |
68+
| --- | --- | --- |
69+
| `ingress.enabled` | Render an Ingress resource. | `true` |
70+
| `ingress.host` | Ingress host. | `"*"` |
71+
| `ingress.annotations` | Extra ingress annotations. | `{}` |
72+
| `ingress.tls` | Ingress TLS block. | `{}` |
73+
| `ingress.class` | Ingress class annotation value. | `nginx` |
74+
75+
The rendered Ingress always routes path `/` to this Service. Since config-manager only
76+
ever serves `/api/config`, give it its own `ingress.host` rather than sharing the
77+
management UI's host, unless your ingress controller resolves overlapping host/path rules
78+
across separate Ingress objects the way you expect.
79+
80+
## Gateway API HTTPRoute
81+
82+
```yaml
83+
gateway:
84+
enabled: false
85+
annotations: {}
86+
labels: {}
87+
parentRefs: []
88+
hostnames: []
89+
rules: []
90+
```
91+
92+
| Name | Description | Default |
93+
| --- | --- | --- |
94+
| `gateway.enabled` | Render a Gateway API `HTTPRoute` instead of / alongside the Ingress. | `false` |
95+
| `gateway.parentRefs` | Gateway references. Required (fails the render) when `gateway.enabled=true`. | `[]` |
96+
| `gateway.hostnames` | Hostnames for the route. | `[]` |
97+
| `gateway.rules` | Route rules. Defaults to a single `PathPrefix /` rule targeting this Service when empty. | `[]` |
98+
| `gateway.annotations` / `gateway.labels` | Extra metadata on the `HTTPRoute`. | `{}` |
99+
100+
TLS/cert-manager is configured on the referenced Gateway listener, not on this `HTTPRoute`.
101+
102+
## Application Configuration
103+
104+
```yaml
105+
application:
106+
serverAddress: ":8086"
107+
managementUiServerUrl: http://management-ui-example-host.com
108+
idpBaseUrl: http://application-example-host.com
109+
clientApplicationId: vauthenticator-management-ui
110+
redirectUri: http://management-ui-example-host.com/callback
111+
authenticationCheckInterval: "15000"
112+
apiBaseUrl: http://application-example-host.com/api
113+
```
114+
115+
These map 1:1 to the environment variables read by config-manager (`config-manager/internal/config/config.go`):
116+
117+
| Name | Environment variable | Description | Default |
118+
| --- | --- | --- | --- |
119+
| `application.serverAddress` | `SERVER_ADDRESS` | Listen address. | `:8086` |
120+
| `application.managementUiServerUrl` | `MANAGEMENT_UI_SERVER_URL` | Allowed CORS origin; must match the management UI host. Required, no safe default — always set explicitly. | placeholder |
121+
| `application.idpBaseUrl` | `IDP_BASE_URL` | Authorization server base URL returned to the management UI. | placeholder |
122+
| `application.clientApplicationId` | `CLIENT_APPLICATION_ID` | OAuth2 client ID returned to the management UI. | `vauthenticator-management-ui` |
123+
| `application.redirectUri` | `REDIRECT_URI` | OAuth2 redirect URI returned to the management UI. | placeholder |
124+
| `application.authenticationCheckInterval` | `AUTHENTICATION_CHECK_INTERVAL` | Auth check polling interval in milliseconds, as a string. | `15000` |
125+
| `application.apiBaseUrl` | `API_BASE_URL` | Authorization server API base URL returned to the management UI. | placeholder |
126+
127+
All of these except `serverAddress` are required by the application at startup (see
128+
`Config.Validate()`); the Deployment template uses `required` so a missing value fails
129+
`helm template`/`helm install` with a clear error instead of deploying a broken pod.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# config-manager helm chart 0.1
2+
3+
## :star: New Features
4+
5+
- initial release of the `config-manager` chart: Deployment + ClusterIP Service for the `config-manager` Go service, configured entirely through environment variables matching `config-manager/internal/config/config.go`
6+
- add an optional Ingress (`ingress.*`, enabled by default) and an optional Gateway API `HTTPRoute` (`gateway.*`, disabled by default) for external access, mirroring the pattern used by the `vauthenticator` chart's `application` workload
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
config-manager is deployed as a ClusterIP service reachable at:
2+
3+
{{ include "config-manager.name" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}
4+
5+
{{- if .Values.ingress.enabled }}
6+
7+
An Ingress is also rendered at host {{ .Values.ingress.host }} (path /) for external access.
8+
{{- end }}
9+
{{- if .Values.gateway.enabled }}
10+
11+
A Gateway API HTTPRoute is also rendered for external access.
12+
{{- end }}
13+
14+
Whatever serves the management UI frontend must route `/api/config` to this Service
15+
(directly via the Ingress/HTTPRoute above, or via its own reverse proxy) for the
16+
management UI to load its runtime configuration.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "config-manager.chart" -}}
5+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{- define "config-manager.name" -}}
9+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
10+
{{- end }}
11+
12+
{{/*
13+
Common labels
14+
*/}}
15+
{{- define "config-manager.labels" -}}
16+
helm.sh/chart: {{ include "config-manager.chart" . }}
17+
{{ include "config-manager.selectorLabels" . }}
18+
{{- if .Chart.AppVersion }}
19+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
20+
{{- end }}
21+
app.kubernetes.io/managed-by: {{ .Release.Service }}
22+
{{- end }}
23+
24+
{{/*
25+
Selector labels
26+
*/}}
27+
{{- define "config-manager.selectorLabels" -}}
28+
{{- toYaml .Values.selectorLabels }}
29+
app.kubernetes.io/name: {{ include "config-manager.name" . }}
30+
app.kubernetes.io/instance: {{ .Release.Name }}
31+
{{- end }}

0 commit comments

Comments
 (0)