Skip to content

Commit bb910c0

Browse files
committed
clean up
Signed-off-by: Alan Sherman <[email protected]>
1 parent e403106 commit bb910c0

File tree

15 files changed

+193
-239
lines changed

15 files changed

+193
-239
lines changed

charts/lfx-service/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# SPDX-License-Identifier: MIT
33
---
44
apiVersion: v2
5-
name: lfx-v2-service-base
5+
name: lfx-service
66
description: LFX Service v2 Helm chart
77
type: application
8-
version: 0.1.0
8+
version: 1.0.0
99
icon: https://github.com/linuxfoundation/lfx-v2-helm/raw/main/img/lfx-logo-color.svg

charts/lfx-service/README.md

Lines changed: 56 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -244,45 +244,6 @@ nats:
244244
annotations: {}
245245
```
246246
247-
### External Secrets
248-
249-
Integrates with AWS Secrets Manager (requires `global.awsRegion`):
250-
251-
```yaml
252-
externalSecrets:
253-
enabled: false
254-
255-
# SecretStore configuration
256-
secretStore:
257-
name: "" # Defaults to "{release-name}-secret-store"
258-
labels: {}
259-
annotations: {}
260-
261-
# ExternalSecret configuration
262-
name: "" # Defaults to "{release-name}-external-secret"
263-
refreshInterval: "1h"
264-
labels: {}
265-
annotations: {}
266-
267-
# Target secret configuration
268-
target:
269-
creationPolicy: "Owner"
270-
deletionPolicy: "Retain"
271-
template: {}
272-
273-
# Individual secret mappings
274-
data:
275-
- secretKey: database-password
276-
remoteRef:
277-
key: /app/database
278-
property: password
279-
280-
# Bulk secret import (use either data OR dataFrom)
281-
dataFrom:
282-
- extract:
283-
key: /app/all-secrets
284-
```
285-
286247
### Horizontal Pod Autoscaler
287248
288249
Configures automatic scaling based on metrics:
@@ -311,6 +272,58 @@ podDisruptionBudget:
311272
annotations: {}
312273
```
313274
275+
### External Secrets Operator
276+
277+
Integrates with AWS Secrets Manager (requires `global.awsRegion`):
278+
279+
```yaml
280+
externalSecretsOperator:
281+
enabled: false
282+
283+
# SecretStore configuration
284+
secretStore:
285+
name: "" # Defaults to "{release-name}-secret-store"
286+
labels: {}
287+
annotations: {}
288+
289+
# ExternalSecret configuration
290+
externalSecret:
291+
name: "" # Defaults to "{release-name}-external-secret"
292+
refreshInterval: "10m"
293+
labels: {}
294+
annotations: {}
295+
296+
# Target secret configuration
297+
target:
298+
name: "" # Defaults to "{release-name}-secrets"
299+
creationPolicy: "Owner"
300+
deletionPolicy: "Retain"
301+
template: {}
302+
303+
# Secret data configuration
304+
# IMPORTANT: Use EITHER data OR dataFrom, never both
305+
# If both are empty, defaults to tag-based discovery
306+
307+
# Individual secret mappings
308+
data:
309+
- secretKey: database-password
310+
remoteRef:
311+
key: /app/database
312+
property: password
313+
- secretKey: api-key
314+
remoteRef:
315+
key: /app/api-credentials
316+
property: key
317+
318+
# Bulk secret import (alternative to data)
319+
dataFrom: []
320+
# - extract:
321+
# key: /app/all-secrets
322+
# - find:
323+
# name:
324+
# regexp: ".*"
325+
```
326+
314327

315328
## Values Reference
316329

@@ -328,10 +341,10 @@ podDisruptionBudget:
328341
| `heimdall.enabled` | Enable Heimdall auth | `false` |
329342
| `ruleSet.enabled` | Create RuleSet | `false` |
330343
| `nats.kvBuckets` | NATS KV bucket configurations | `[]` |
331-
| `externalSecrets.enabled` | Enable External Secrets | `false` |
332-
| `externalSecrets.data` | Individual secret mappings | `[]` |
333-
| `externalSecrets.dataFrom` | Bulk secret import | `[]` |
334-
| `externalSecrets.refreshInterval` | Secret refresh interval | `"1h"` |
344+
| `externalSecretsOperator.enabled` | Enable External Secrets Operator | `false` |
345+
| `externalSecretsOperator.externalSecret.data` | Individual secret mappings | `[]` |
346+
| `externalSecretsOperator.externalSecret.dataFrom` | Bulk secret import | `[]` |
347+
| `externalSecretsOperator.externalSecret.refreshInterval` | Secret refresh interval | `"1h"` |
335348
| `serviceAccount.awsRoleArn` | AWS IAM role for External Secrets | `""` |
336349
| `global.awsRegion` | AWS region for External Secrets | `""` (blank for local) |
337350
| `commonLabels` | Labels applied to all resources | `{}` |

charts/lfx-service/templates/_helpers.tpl

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SPDX-License-Identifier: MIT
66
{{/*
77
Expand the name of the chart.
88
*/}}
9-
{{- define "lfx-v2-service-base.name" -}}
9+
{{- define "lfx-service.name" -}}
1010
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
1111
{{- end }}
1212

@@ -15,7 +15,7 @@ Create a default fully qualified app name.
1515
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
1616
If release name contains chart name it will be used as a full name.
1717
*/}}
18-
{{- define "lfx-v2-service-base.fullname" -}}
18+
{{- define "lfx-service.fullname" -}}
1919
{{- if .Values.fullnameOverride }}
2020
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
2121
{{- else }}
@@ -31,19 +31,19 @@ If release name contains chart name it will be used as a full name.
3131
{{/*
3232
Create chart name and version as used by the chart label.
3333
*/}}
34-
{{- define "lfx-v2-service-base.chart" -}}
34+
{{- define "lfx-service.chart" -}}
3535
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
3636
{{- end }}
3737

3838

3939
{{/*
4040
Merged labels (standard + chart-wide + resource-specific)
41-
Usage: {{ include "lfx-v2-service-base.mergedLabels" (dict "context" . "resourceLabels" .Values.service.labels) }}
41+
Usage: {{ include "lfx-service.mergedLabels" (dict "context" . "resourceLabels" .Values.service.labels) }}
4242
*/}}
43-
{{- define "lfx-v2-service-base.mergedLabels" -}}
43+
{{- define "lfx-service.mergedLabels" -}}
4444
{{- $standardLabels := dict
45-
"helm.sh/chart" (include "lfx-v2-service-base.chart" .context)
46-
"app.kubernetes.io/name" (include "lfx-v2-service-base.name" .context)
45+
"helm.sh/chart" (include "lfx-service.chart" .context)
46+
"app.kubernetes.io/name" (include "lfx-service.name" .context)
4747
"app.kubernetes.io/instance" .context.Release.Name
4848
"app.kubernetes.io/managed-by" .context.Release.Service
4949
}}
@@ -59,17 +59,17 @@ Usage: {{ include "lfx-v2-service-base.mergedLabels" (dict "context" . "resource
5959
{{/*
6060
Selector labels
6161
*/}}
62-
{{- define "lfx-v2-service-base.selectorLabels" -}}
63-
app.kubernetes.io/name: {{ include "lfx-v2-service-base.name" . }}
62+
{{- define "lfx-service.selectorLabels" -}}
63+
app.kubernetes.io/name: {{ include "lfx-service.name" . }}
6464
app.kubernetes.io/instance: {{ .Release.Name }}
6565
{{- end }}
6666

6767
{{/*
6868
Create the name of the service account to use
6969
*/}}
70-
{{- define "lfx-v2-service-base.serviceAccountName" -}}
70+
{{- define "lfx-service.serviceAccountName" -}}
7171
{{- if .Values.serviceAccount.create }}
72-
{{- default (include "lfx-v2-service-base.fullname" .) .Values.serviceAccount.name }}
72+
{{- default (include "lfx-service.fullname" .) .Values.serviceAccount.name }}
7373
{{- else }}
7474
{{- default "default" .Values.serviceAccount.name }}
7575
{{- end }}
@@ -78,9 +78,9 @@ Create the name of the service account to use
7878

7979
{{/*
8080
Merged annotations (chart-wide + resource-specific)
81-
Usage: {{ include "lfx-v2-service-base.mergedAnnotations" (dict "context" . "resourceAnnotations" .Values.service.annotations) }}
81+
Usage: {{ include "lfx-service.mergedAnnotations" (dict "context" . "resourceAnnotations" .Values.service.annotations) }}
8282
*/}}
83-
{{- define "lfx-v2-service-base.mergedAnnotations" -}}
83+
{{- define "lfx-service.mergedAnnotations" -}}
8484
{{- $commonAnnotations := .context.Values.commonAnnotations | default dict }}
8585
{{- $resourceAnnotations := .resourceAnnotations | default dict }}
8686
{{- $merged := mergeOverwrite $commonAnnotations $resourceAnnotations }}
@@ -93,22 +93,22 @@ Usage: {{ include "lfx-v2-service-base.mergedAnnotations" (dict "context" . "res
9393
{{/*
9494
Get the image tag
9595
*/}}
96-
{{- define "lfx-v2-service-base.imageTag" -}}
96+
{{- define "lfx-service.imageTag" -}}
9797
{{- .Values.image.tag | default .Chart.AppVersion }}
9898
{{- end }}
9999

100100

101101
{{/*
102102
Get the default hostname for HTTPRoute
103103
*/}}
104-
{{- define "lfx-v2-service-base.defaultHostname" -}}
104+
{{- define "lfx-service.defaultHostname" -}}
105105
{{- printf "lfx-api.%s" .Values.global.domain }}
106106
{{- end }}
107107

108108
{{/*
109109
Generate Heimdall rule execute section
110110
*/}}
111-
{{- define "lfx-v2-service-base.ruleExecute" -}}
111+
{{- define "lfx-service.ruleExecute" -}}
112112
- authenticator: oidc
113113
- authenticator: anonymous_authenticator
114114
{{- if .Values.ruleSet.useOidcContextualizer }}
@@ -141,32 +141,32 @@ Generate Heimdall rule execute section
141141
{{/*
142142
Create the name of the secret store to use
143143
*/}}
144-
{{- define "lfx-v2-service-base.secretStoreName" -}}
145-
{{- if .Values.externalSecrets.secretStore.name }}
146-
{{- .Values.externalSecrets.secretStore.name }}
144+
{{- define "lfx-service.secretStoreName" -}}
145+
{{- if .Values.externalSecretsOperator.secretStore.name }}
146+
{{- .Values.externalSecretsOperator.secretStore.name }}
147147
{{- else }}
148-
{{- printf "%s-secret-store" (include "lfx-v2-service-base.fullname" .) }}
148+
{{- printf "%s-secret-store" (include "lfx-service.fullname" .) }}
149149
{{- end }}
150150
{{- end }}
151151

152152
{{/*
153153
Create the name of the external secret to use
154154
*/}}
155-
{{- define "lfx-v2-service-base.externalSecretName" -}}
156-
{{- if .Values.externalSecrets.name }}
157-
{{- .Values.externalSecrets.name }}
155+
{{- define "lfx-service.externalSecretName" -}}
156+
{{- if .Values.externalSecretsOperator.externalSecret.name }}
157+
{{- .Values.externalSecretsOperator.externalSecret.name }}
158158
{{- else }}
159-
{{- printf "%s-external-secret" (include "lfx-v2-service-base.fullname" .) }}
159+
{{- printf "%s-external-secret" (include "lfx-service.fullname" .) }}
160160
{{- end }}
161161
{{- end }}
162162

163163
{{/*
164164
Create the name of the secret to use
165165
*/}}
166-
{{- define "lfx-v2-service-base.secretName" -}}
167-
{{- if .Values.externalSecrets.secret.name }}
168-
{{- .Values.externalSecrets.secret.name }}
166+
{{- define "lfx-service.secretName" -}}
167+
{{- if .Values.externalSecretsOperator.externalSecret.target.name }}
168+
{{- .Values.externalSecretsOperator.externalSecret.target.name }}
169169
{{- else }}
170-
{{- printf "%s-secrets" (include "lfx-v2-service-base.fullname" .) }}
170+
{{- printf "%s-secrets" (include "lfx-service.fullname" .) }}
171171
{{- end }}
172172
{{- end }}

charts/lfx-service/templates/deployment.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
apiVersion: apps/v1
55
kind: Deployment
66
metadata:
7-
name: {{ include "lfx-v2-service-base.fullname" . }}
7+
name: {{ include "lfx-service.fullname" . }}
88
namespace: {{ .Release.Namespace }}
99
labels:
10-
{{- include "lfx-v2-service-base.mergedLabels" (dict "context" . "resourceLabels" .Values.deployment.labels) | nindent 4 }}
11-
{{- $annotations := include "lfx-v2-service-base.mergedAnnotations" (dict "context" . "resourceAnnotations" .Values.deployment.annotations) }}
10+
{{- include "lfx-service.mergedLabels" (dict "context" . "resourceLabels" .Values.deployment.labels) | nindent 4 }}
11+
{{- $annotations := include "lfx-service.mergedAnnotations" (dict "context" . "resourceAnnotations" .Values.deployment.annotations) }}
1212
{{- if $annotations }}
1313
annotations:
1414
{{- $annotations | nindent 4 }}
@@ -17,22 +17,22 @@ spec:
1717
replicas: {{ .Values.deployment.replicaCount }}
1818
selector:
1919
matchLabels:
20-
{{- include "lfx-v2-service-base.selectorLabels" . | nindent 6 }}
20+
{{- include "lfx-service.selectorLabels" . | nindent 6 }}
2121
template:
2222
metadata:
2323
labels:
24-
{{- include "lfx-v2-service-base.selectorLabels" . | nindent 8 }}
24+
{{- include "lfx-service.selectorLabels" . | nindent 8 }}
2525
{{- with .Values.commonLabels }}
2626
{{- toYaml . | nindent 8 }}
2727
{{- end }}
28-
{{- $annotations := include "lfx-v2-service-base.annotations" . }}
28+
{{- $annotations := include "lfx-service.mergedAnnotations" (dict "context" . "resourceAnnotations" .Values.deployment.annotations) }}
2929
{{- if $annotations }}
3030
annotations:
3131
{{- $annotations | nindent 8 }}
3232
{{- end }}
3333
spec:
3434
{{- if .Values.serviceAccount.create }}
35-
serviceAccountName: {{ include "lfx-v2-service-base.serviceAccountName" . }}
35+
serviceAccountName: {{ include "lfx-service.serviceAccountName" . }}
3636
{{- end }}
3737
{{- with .Values.deployment.nodeSelector }}
3838
nodeSelector:
@@ -48,7 +48,7 @@ spec:
4848
{{- end }}
4949
containers:
5050
- name: app
51-
image: "{{ .Values.image.repository }}:{{ include "lfx-v2-service-base.imageTag" . }}"
51+
image: "{{ .Values.image.repository }}:{{ include "lfx-service.imageTag" . }}"
5252
imagePullPolicy: {{ .Values.image.pullPolicy }}
5353
{{- with .Values.deployment.securityContext }}
5454
securityContext:

0 commit comments

Comments
 (0)