Skip to content
Open
13 changes: 12 additions & 1 deletion .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,16 @@ jobs:
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Helm
uses: azure/setup-helm@v4
with:
version: v3.19.0
- name: Validate Helm charts
run: task helm-validate
run: task helm-validate
- name: Install helm-unittest plugin
run: |
if ! helm plugin list | awk '{print $1}' | grep -qx unittest; then
helm plugin install https://github.com/helm-unittest/helm-unittest
fi
- name: Run chart unit tests
run: task helm-unittest
36 changes: 35 additions & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ tasks:
desc: Validate Helm charts
cmds:
- |
NAME={{.CLI_ARGS}}

for chart in charts/*; do
chart_name=$(basename "$chart")
if [ -n "$NAME" ] && [ "$chart_name" != "$NAME" ]; then
continue
fi
(
cd "$chart" || exit 1
echo "Validating $chart_name..."
Expand All @@ -34,6 +39,36 @@ tasks:
) || exit 1
done

helm-unittest:
desc: Run Helm unit tests (helm-unittest plugin)
cmds:
- |
NAME={{.CLI_ARGS}}

if ! helm unittest -h >/dev/null 2>&1; then
echo "❌ helm-unittest plugin is not installed."
echo "Install: helm plugin install https://github.com/helm-unittest/helm-unittest"
exit 1
fi

for chart in charts/*; do
chart_name=$(basename "$chart")
if [ -n "$NAME" ] && [ "$chart_name" != "$NAME" ]; then
continue
fi

if [ ! -d "$chart/tests" ] || [ -z "$(ls -A "$chart/tests" 2>/dev/null)" ]; then
echo "⏭️ Skipping $chart_name (no unit tests)"
continue
fi

(
cd "$chart" || exit 1
echo "Running unit tests for $chart_name..."
helm unittest .
) || exit 1
done

helm-package-index:
desc: Package Helm charts and update repository index
cmds:
Expand All @@ -59,4 +94,3 @@ tasks:
- echo "✅ Charts packaged successfully!"
- echo "📦 Files created in web/static/charts/"
- ls -lh web/static/charts/

Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,32 @@ Create one or more `ExternalSecret` resources (External Secrets Operator).
Rendered by: `templates/external-secret.yaml`

```yaml
externalSecrets: # struct[] | Optional list of ExternalSecrets
- name: my-external-secret # string | Required
externalSecrets: # struct | Optional external-secrets config
# ref: https://external-secrets.io/latest/api/secretstore/
secretstore: # struct | Optional SecretStore to create
name: my-secret-store # string | Default: release name
labels: {} # map | Optional labels
annotations: {} # map | Optional annotations
refreshInterval: "0s" # string | "0s" disables auto-refresh
secretStoreRef: # struct | Required
name: my-secret-store # string
kind: SecretStore # string | Default: SecretStore
target: # struct | Optional target config
name: my-k8s-secret # string | Default: external secret name
creationPolicy: Owner # string | Default: Owner
template: {} # any | Optional target template
data: # struct[] | Optional per-key mapping
- secretKey: MY_SECRET_KEY # string
remoteRef:
key: /path/to/parameter # string
property: someProperty # string | Optional
version: latest # string | Optional
dataFrom: [] # any | Optional passthrough list
provider: {} # any | Required when secretstore is set
secrets: # struct[] | Optional list of ExternalSecrets
# ref: https://external-secrets.io/latest/api/externalsecret/
- name: my-external-secret # string | Required
annotations: {} # map | Optional annotations
refreshInterval: "0s" # string | "0s" disables auto-refresh
secretStoreRef: # struct | Optional
name: my-secret-store # string | Default order: secretStoreRef.name -> externalSecrets.secretstore.name -> release name
kind: SecretStore # string | Default: SecretStore
target: # struct | Optional target config
name: my-k8s-secret # string | Default: external secret name
creationPolicy: Owner # string | Default: Owner
template: {} # any | Optional target template
data: # struct[] | Optional per-key mapping
- secretKey: MY_SECRET_KEY # string
remoteRef:
key: /path/to/parameter # string
property: someProperty # string | Optional
version: latest # string | Optional
dataFrom: [] # any | Optional passthrough list
```


48 changes: 48 additions & 0 deletions charts/component-chart/docs/pages/configuration/job.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: Job & CronJob Configuration
---

The `component-chart` fully supports setting up background tasks using Kubernetes `Job` or `CronJob` resources instead of the standard `Deployment`.

It automatically evaluates the API `kind` based on the specified values. Providing a `job` object or a `job.schedule` string signals the chart to generate `Job` or `CronJob` resources, respectively.

## Deploying a Job

To deploy a one-off `Job`, you can define `job` settings. Any specific configurations under `job` will transform the component into a `Job`.

```yaml
job:
backoffLimit: 4
activeDeadlineSeconds: 100
ttlSecondsAfterFinished: 100
```

## Deploying a CronJob

To deploy a periodic `CronJob`, define the `schedule` string. The component chart will dynamically wrap the pod template into a `jobTemplate`.

```yaml
job:
schedule: "*/5 * * * *"
concurrencyPolicy: Allow
failedJobsHistoryLimit: 1
successfulJobsHistoryLimit: 3
startingDeadlineSeconds: 100
suspend: false
# You can also apply Job parameters to the instantiated jobs
backoffLimit: 4
```

### Configuration Options

The `job` configuration block accepts fields mapped to the Kubernetes `JobSpec` and `CronJobSpec` specifications:

- **`job.schedule`**: (String) The cron schedule (e.g., `* * * * *`). **Triggers CronJob mode.**
- **`job.backoffLimit`**: (Int) Specifies the number of retries before marking a job as failed.
- **`job.activeDeadlineSeconds`**: (Int) Specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it.
- **`job.ttlSecondsAfterFinished`**: (Int) TTL mechanism to clean up finished jobs.
- **`job.concurrencyPolicy`**: (String) Specifies how to treat concurrent executions of a Job created by a CronJob. (`Allow`, `Forbid`, `Replace`)
- **`job.failedJobsHistoryLimit`**: (Int) The number of failed finished jobs to retain.
- **`job.successfulJobsHistoryLimit`**: (Int) The number of successful finished jobs to retain.
- **`job.startingDeadlineSeconds`**: (Int) Optional deadline in seconds for starting the job if it misses scheduled time for any reason.
- **`job.suspend`**: (Bool) This flag tells the controller to suspend subsequent executions.
Loading
Loading