Skip to content

Commit c7e06c3

Browse files
authored
chore: update repository structure and workflows (#3)
* fix version increment check by moving chart back to charts directory * pre-commit: add local hook for linting * publish: create GitHub release after chart publish * ci: set permissions on job level * Update repository README.md
1 parent ab0a298 commit c7e06c3

20 files changed

Lines changed: 204 additions & 149 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ on:
66
branches:
77
- main
88

9-
permissions:
10-
contents: read
11-
129
jobs:
1310
lint:
1411
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
1514
steps:
1615
- name: Checkout
1716
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -31,4 +30,4 @@ jobs:
3130
uses: helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f # v2.8.0
3231

3332
- name: Run chart-testing (lint)
34-
run: ct lint --use-helmignore --charts .
33+
run: ct lint

.github/workflows/publish.yaml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,17 @@ on:
66
branches:
77
- main
88
paths:
9-
- templates/**
10-
- Chart.yaml
11-
- values.yaml
12-
- README.md
13-
14-
permissions:
15-
contents: read
16-
packages: write
9+
- charts
1710

1811
jobs:
1912
publish:
2013
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
packages: write
2117
steps:
2218
- name: Checkout
2319
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24-
with:
25-
fetch-depth: 0
2620

2721
- name: Login to GHCR
2822
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
@@ -31,8 +25,16 @@ jobs:
3125
username: ${{ github.actor }}
3226
password: ${{ secrets.GITHUB_TOKEN }}
3327

34-
- name: Package helm charts
35-
run: helm dependency build && helm package .
28+
- name: Get chart version
29+
run: echo "CHART_VERSION=$(helm show chart charts/base | yq .version)" | tee -a $GITHUB_ENV
30+
31+
- name: Package helm chart
32+
run: helm package --dependency-update charts/base
3633

3734
- name: Push chart to GHCR
38-
run: helm push base-*.tgz oci://ghcr.io/${{ github.repository_owner }}/helm-charts
35+
run: helm push base-${CHART_VERSION}.tgz oci://ghcr.io/${{ github.repository_owner }}/helm-charts
36+
37+
- name: Create GitHub Release
38+
run: gh release create "${CHART_VERSION}" --title "${CHART_VERSION}" --generate-notes
39+
env:
40+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos:
88
- id: check-executables-have-shebangs
99
- id: check-shebang-scripts-are-executable
1010
- id: check-yaml
11-
exclude: "^templates/.*\\.ya?ml$"
11+
exclude: "^charts/.*/templates/.*\\.ya?ml$"
1212
- id: end-of-file-fixer
1313
- id: trailing-whitespace
1414

@@ -17,5 +17,16 @@ repos:
1717
hooks:
1818
- id: helm-docs-container
1919
args:
20-
- --chart-search-root=.
20+
- --chart-search-root=charts
2121
- --sort-values-order=file
22+
23+
- repo: local
24+
hooks:
25+
- id: helm-chart-testing
26+
name: Helm Chart Testing
27+
language: docker_image
28+
alias: ct
29+
files: "^charts/"
30+
pass_filenames: false
31+
require_serial: false
32+
entry: quay.io/helmpack/chart-testing ct lint

README.md

Lines changed: 33 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,140 +1,45 @@
1-
# base
1+
# Helm Base Chart
22

3-
![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
3+
[![Last Commit](https://img.shields.io/github/last-commit/bonddim/helm-base-chart/main?style=flat-square)](https://github.com/bonddim/helm-base-chart/commits/main)
4+
[![Latest Release](https://img.shields.io/github/v/release/bonddim/helm-base-chart?style=flat-square)](https://github.com/bonddim/helm-base-chart/releases)
45

5-
Base Helm chart for Kubernetes - fully values-driven.
6+
A simple, straightforward Helm chart driven entirely by `values.yaml` for deploying standard Kubernetes resources - scaffolded from `helm create` and intentionally kept close to that structure so anyone can read, understand, and maintain it without prior knowledge of the chart.
67

7-
## Maintainers
8+
## Usage
89

9-
| Name | Email | Url |
10-
| ---- | ------ | --- |
11-
| bonddim | | |
10+
The chart is published to GitHub Container Registry as an OCI artifact.
11+
You may install it directly with your own values - **no wrapper chart, no boilerplate templates required**:
1212

13-
## Source Code
13+
```bash
14+
helm install my-release oci://ghcr.io/bonddim/helm-charts/base --values values.yaml
15+
```
1416

15-
* <https://github.com/bonddim/helm-base-chart>
17+
```bash
18+
helm upgrade --install my-release oci://ghcr.io/bonddim/helm-charts/base --values values.yaml
19+
```
1620

17-
## Values
21+
A minimal `values.yaml` to get started:
1822

19-
### Global parameters
23+
```yaml
24+
image:
25+
repository: my-app
26+
tag: "1.0.0"
2027

21-
| Key | Type | Default | Description |
22-
|-----|------|---------|-------------|
23-
| global.imageRegistry | string | `""` | Global image registry. Used as the default for all charts, but can be overridden by individual chart values. |
24-
| global.imageTag | string | `""` | Global image tag used as the default for all charts. Can be overridden by individual chart values. |
28+
service:
29+
enabled: true
30+
port: 8080
2531

26-
### Common parameters
32+
ingress:
33+
enabled: true
34+
className: nginx
35+
hosts:
36+
- host: my-app.example.com
37+
paths:
38+
- path: /
39+
pathType: Prefix
40+
```
2741
28-
| Key | Type | Default | Description |
29-
|-----|------|---------|-------------|
30-
| nameOverride | string | `""` | Override resource names (partially) |
31-
| fullnameOverride | string | `""` | Override resource names (fully) |
32-
| commonLabels | object | `{}` | Labels to add to all deployed resources |
33-
| commonAnnotations | object | `{}` | Annotations to add to all deployed resources |
42+
See [values.yaml](charts/base/values.yaml) and [README.md](charts/base/README.md) for the full list of configurable parameters.
3443
35-
### Workload parameters
36-
37-
| Key | Type | Default | Description |
38-
|-----|------|---------|-------------|
39-
| annotations | object | `{}` | Additional annotations on the Deployment resource itself. |
40-
| labels | object | `{}` | Additional labels on the Deployment resource itself. |
41-
| replicas | int | `nil` | Number of pod replicas. Ignored when autoscaling.enabled=true. Must be >= 0 if specified. null by default, which defaults to 1 and not controlled by Helm. |
42-
| strategy | object | `{}` | Deployment update strategy. e.g. { type: RollingUpdate, rollingUpdate: { maxSurge: 1, maxUnavailable: 0 } } |
43-
| revisionHistoryLimit | int | `nil` | Number of old ReplicaSets to retain. |
44-
| podAnnotations | object | `{}` | Additional annotations on the Pod template. |
45-
| podLabels | object | `{}` | Additional labels on the Pod template. |
46-
| podSecurityContext | object | `{}` | Pod-level security context. |
47-
| imagePullSecrets | list | `[]` | Image pull secrets (list of { name: ... }). |
48-
| automountServiceAccountToken | bool | `nil` | Whether to auto-mount the service account token to the pod. |
49-
| initContainers | object/list | `{}` | Init containers (values are tpl-rendered). |
50-
| sidecarContainers | object/list | `{}` | Sidecar containers (values are tpl-rendered). |
51-
| volumes | object/list | `{}` | Volumes (values are tpl-rendered). |
52-
| nodeSelector | object | `{}` | Node selector for pod scheduling. |
53-
| tolerations | list | `[]` | Tolerations for pod scheduling. |
54-
| affinity | object | `{}` | Pod affinity/anti-affinity rules. |
55-
| topologySpreadConstraints | list | `[]` | Topology spread constraints. |
56-
| dnsPolicy | string | `""` | DNS policy for the pod. |
57-
| priorityClassName | string | `""` | Priority class name. |
58-
| terminationGracePeriodSeconds | int | `nil` | Grace period (seconds) before forceful termination. |
59-
| enableServiceLinks | bool | `nil` | Enable Kubernetes service links injected as env vars. |
60-
| image.registry | string | `""` | Container image registry. |
61-
| image.repository | string | `""` | Container image repository. |
62-
| image.tag | string | `""` | Container image tag. Defaults to Chart.AppVersion when empty. @default latest |
63-
| image.pullPolicy | string | `nil` | Image pull policy. |
64-
| command | list | `[]` | Override the container entrypoint. |
65-
| args | list | `[]` | Arguments to the entrypoint. |
66-
| env | object/list | `{}` | Environment variables (tpl-rendered). |
67-
| envFrom | list | `[]` | envFrom sources (tpl-rendered). |
68-
| extraPorts | object/list | `{}` | Extra ports in addition to the primary port derived from service.port. |
69-
| resources | object | `{}` | Compute resource requests and limits. |
70-
| securityContext | object | `{}` | Container-level security context. |
71-
| livenessProbe | object | `{}` | Liveness probe configuration. |
72-
| readinessProbe | object | `{}` | Readiness probe configuration. |
73-
| startupProbe | object | `{}` | Startup probe configuration. |
74-
| lifecycle | object | `{}` | Container lifecycle hooks. |
75-
| volumeMounts | object/list | `{}` | Volume mounts (tpl-rendered). Key = volume name. |
76-
77-
### Security parameters
78-
79-
| Key | Type | Default | Description |
80-
|-----|------|---------|-------------|
81-
| serviceAccount.create | bool | `false` | Whether to create a ServiceAccount resource. |
82-
| serviceAccount.annotations | object | `{}` | Annotations for the ServiceAccount. |
83-
| serviceAccount.automount | bool | `nil` | Automatically mount API credentials. |
84-
| serviceAccount.name | string | `""` | Name of the ServiceAccount. Auto-generated from fullname if empty and create=true. |
85-
86-
### Network parameters
87-
88-
| Key | Type | Default | Description |
89-
|-----|------|---------|-------------|
90-
| service.enabled | bool | `false` | Whether to create a Service resource. |
91-
| service.annotations | object | `{}` | Annotations for the Service. |
92-
| service.type | string | `"ClusterIP"` | Service type. |
93-
| service.port | int | `nil` | Primary port exposed by the Service (also used as the container's primary port). |
94-
| service.targetPort | string | `"http"` | Target port on the container. Defaults to the port name "http". |
95-
| service.protocol | string | `"TCP"` | Protocol for the primary port. |
96-
| service.nodePort | string | `nil` | NodePort value (only applies to NodePort/LoadBalancer service types). |
97-
| service.extraPorts | object | `{}` | Extra ports Key is the port name. |
98-
| ingress.enabled | bool | `false` | Whether to create an Ingress resource. |
99-
| ingress.annotations | object | `{}` | Annotations for the Ingress. |
100-
| ingress.className | string | `""` | Ingress class name. |
101-
| ingress.hostnames | list | `[]` | List of hostnames to route traffic to this service. |
102-
| ingress.paths | list | `[{"path":"/","pathType":"Prefix"}]` | Path rules applied to every hostname. |
103-
| ingress.tls | object | `{"enabled":false,"secretName":""}` | TLS configuration. |
104-
| ingress.tls.secretName | string | `""` | Secret name; defaults to "<first-hostname>-tls" when empty. |
105-
| httpRoute.enabled | bool | `false` | Whether to create an HTTPRoute resource. |
106-
| httpRoute.annotations | object | `{}` | Annotations for the HTTPRoute. |
107-
| httpRoute.parentRefs | list | `[]` | Gateway parentRefs this route attaches to. |
108-
| httpRoute.hostnames | list | `[]` | Hostnames matched by this route. |
109-
| httpRoute.rules | list | `[]` | Routing rules. backendRefs are auto-populated from the Service. |
110-
111-
### Autoscaling parameters
112-
113-
| Key | Type | Default | Description |
114-
|-----|------|---------|-------------|
115-
| autoscaling.enabled | bool | `false` | Whether to create an HPA resource (also suppresses Deployment.spec.replicas). |
116-
| autoscaling.annotations | object | `{}` | Annotations for the HPA. |
117-
| autoscaling.labels | object | `{}` | Labels for the HPA. |
118-
| autoscaling.minReplicas | int | `1` | Minimum number of replicas when autoscaling is enabled. |
119-
| autoscaling.maxReplicas | int | `10` | Maximum number of replicas when autoscaling is enabled. |
120-
| autoscaling.targetCPUUtilizationPercentage | int | `80` | Target CPU utilization percentage. |
121-
| autoscaling.behavior | object | `{}` | Advanced scaling behavior. |
122-
| autoscaling.metrics | list | `[]` | Additional custom metrics (appended to the generated metrics list). |
123-
124-
### ConfigMap parameters
125-
126-
| Key | Type | Default | Description |
127-
|-----|------|---------|-------------|
128-
| configMap.enabled | bool | `false` | Whether to create a ConfigMap resource. |
129-
| configMap.annotations | object | `{}` | Annotations for the ConfigMap. |
130-
| configMap.labels | object | `{}` | Labels for the ConfigMap. |
131-
| configMap.data | object | `{}` | Key/value data for the ConfigMap. |
132-
133-
### Extras
134-
135-
| Key | Type | Default | Description |
136-
|-----|------|---------|-------------|
137-
| extraObjects | object/list | `[]` | Render additional Kubernetes manifests. Each entry may be a string (with Go template expressions) or a YAML object. |
138-
139-
----------------------------------------------
140-
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
44+
## Contributing
45+
Contributions are welcome! Please open an issue or submit a pull request with any improvements or bug fixes.

.helmignore renamed to charts/base/.helmignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,3 @@
2222
.idea/
2323
*.tmproj
2424
.vscode/
25-
# Ignore pre-commit config file
26-
.pre-commit-config.yaml
File renamed without changes.

0 commit comments

Comments
 (0)