Skip to content

Commit

Permalink
Merge pull request #125 from WyriHaximusNet/generate-documentation
Browse files Browse the repository at this point in the history
Generate documentation
  • Loading branch information
WyriHaximus authored Dec 1, 2024
2 parents a85673c + cfb7d01 commit d3b7bfd
Show file tree
Hide file tree
Showing 34 changed files with 768 additions and 17 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/helm-charts-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,33 @@ jobs:
echo ${{ steps.deprecated.outputs.charts }}
echo "Maintained:"
echo ${{ steps.maintained.outputs.charts }}
ensure-readme-is-up-to-date:
name: Ensure ${{ matrix.chart }} README is up to date
needs:
- generate-charts
strategy:
fail-fast: false
matrix:
chart: ${{ fromJson(needs.generate-charts.outputs.maintained) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Move current README
run: |
mv charts/${{ matrix.chart }}/README.md charts/${{ matrix.chart }}/README.current.md
- name: Generate README.md
run: |
make generate
- name: Check that the files are the exact same
uses: LouisBrunner/[email protected]
with:
old: charts/${{ matrix.chart }}/README.current.md
new: charts/${{ matrix.chart }}/README.md
mode: strict
tolerance: same
token: ${{ secrets.GITHUB_TOKEN }}
notify_check: true
notify_issue: true
validate-values-schema:
runs-on: ubuntu-latest
name: Validate values schema json
Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
charts/**/charts
charts/**/charts
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
3 changes: 3 additions & 0 deletions .helmdocsignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
charts/commento
charts/commentoplusplus
charts/horizontal-pod-autoscalers
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# set all to phony
SHELL=bash

.PHONY: *

generate:
docker run -v $$(pwd):/helm-docs jnorwood/helm-docs:v1.9.1 --document-dependency-values=true

2 changes: 2 additions & 0 deletions charts/commento/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Commento

> **:exclamation: This Helm Chart is deprecated!**
<p align="center">
<img width="200" height="200" src="https://cdn.commento.io/images/logo.svg">
</p>
Expand Down
2 changes: 2 additions & 0 deletions charts/commentoplusplus/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Commento++

> **:exclamation: This Helm Chart is deprecated!**
<p align="center">
<img width="200" height="200" src="https://helm.wyrihaximus.net/images/charts/commento.svg">
</p>
Expand Down
7 changes: 7 additions & 0 deletions charts/commons/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@
.idea/
*.tmproj
.vscode/
# OWNERS file for Kubernetes
OWNERS
# Chart testing
ci/
library-ci/
# README template
*.gotmpl
1 change: 1 addition & 0 deletions charts/commons/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ version: 0.1.1
maintainers:
- name: WyriHaximus
email: [email protected]
url: https://wyrihaximus.net
11 changes: 11 additions & 0 deletions charts/commons/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<img src="https://helm.wyrihaximus.net/images/charts/commons.png">
</p>

![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square)

Opinionated helm library chart containing metadata helpers for helm application charts.

Example deployment using helpers from this chart:
Expand Down Expand Up @@ -74,3 +76,12 @@ spec:
topologyKey: "kubernetes.io/hostname"

```

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| WyriHaximus | <[email protected]> | <https://wyrihaximus.net> |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1)
90 changes: 90 additions & 0 deletions charts/commons/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Commons

{{ template "chart.deprecationWarning" . }}

<p align="center">
<img src="https://helm.wyrihaximus.net/images/charts/commons.png">
</p>

{{ template "chart.badgesSection" . }}

Opinionated helm library chart containing metadata helpers for helm application charts.

Example deployment using helpers from this chart:
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ "{{" }} template "commons.fullname" . {{ "}}" }}
labels:
{{ "{{-" }} include "commons.labels" . | nindent 4 {{ "}}" }}
app.kubernetes.io/component: controller
spec:
selector:
matchLabels:
{{ "{{-" }} include "commons.selectorLabels" . | nindent 6 {{ "}}" }}
replicas: 1
template:
metadata:
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "9696"
labels:
{{ "{{-" }} include "commons.labels" . | nindent 8 {{ "}}" }}
spec:
containers:
- name: default-backend
image: "ghcr.io/wyrihaximusnet/default-backend:random"
imagePullPolicy: Always
ports:
- name: default-backend
containerPort: 6969
protocol: TCP
- name: metrics
containerPort: 9696
protocol: TCP
livenessProbe:
failureThreshold: 6
httpGet:
path: /
port: metrics
readinessProbe:
failureThreshold: 6
httpGet:
path: /
port: metrics
startupProbe:
httpGet:
path: /
port: metrics
failureThreshold: 90
periodSeconds: 1
resources:
limits:
cpu: 75m
memory: 64Mi
requests:
cpu: 75m
memory: 64Mi
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: appRevision
operator: In
values:
- {{ "{{" }} template "commons.nameRevision" . {{ "}}" }}
topologyKey: "kubernetes.io/hostname"

```

{{ template "chart.maintainersSection" . }}

{{ template "chart.sourcesSection" . }}

{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesSection" . }}

{{ template "helm-docs.versionFooter" . }}
7 changes: 7 additions & 0 deletions charts/cron-jobs/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@
.idea/
*.tmproj
.vscode/
# OWNERS file for Kubernetes
OWNERS
# Chart testing
ci/
library-ci/
# README template
*.gotmpl
1 change: 1 addition & 0 deletions charts/cron-jobs/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ kubeVersion: ">= 1.21"
maintainers:
- name: WyriHaximus
email: [email protected]
url: https://wyrihaximus.net
23 changes: 22 additions & 1 deletion charts/cron-jobs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<img src="https://helm.wyrihaximus.net/images/charts/cron-jobs.png">
</p>

![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square)

Opinionated helm library chart for easy creation of cron jobs.

# Example
Expand Down Expand Up @@ -49,4 +51,23 @@ jobs:
* No restarts
* No concurrently
* A single container per cron job
* `cron` and `name` labels are set on each cron job with the name you give it
* `cron` and `name` labels are set on each cron job with the name you give it

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| WyriHaximus | <[email protected]> | <https://wyrihaximus.net> |

## Requirements

Kubernetes: `>= 1.21`

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| jobs | list | `[]` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1)
66 changes: 66 additions & 0 deletions charts/cron-jobs/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Cron Jobs

{{ template "chart.deprecationWarning" . }}

<p align="center">
<img src="https://helm.wyrihaximus.net/images/charts/cron-jobs.png">
</p>

{{ template "chart.badgesSection" . }}

Opinionated helm library chart for easy creation of cron jobs.

# Example

Very basic example without any customization:

```gotemplate
{{ "{{-" }} range $job := .Values.jobs {{ "}}" }}
{{ "{{-" }} include "cron-jobs.cronjob" $job {{ "-}}" }}
{{ "{{-" }} end {{ "}}" }}
```

The following values will run a cronjob that sleeps for 1 second any minute

```yaml
jobs:
- name: sleep
schedule: "* * * * *"
labels:
cronjob:
key: value
jobTemplate:
key: value
container:
command: ["sleep"]
args: ["1"]
resources:
limits:
cpu: 1m
memory: 12Mi
requests:
cpu: 1m
memory: 12Mi
image:
repository: alpine
tag: 3.12
pullPolicy: IfNotPresent
```

## Opinionated decisions

* A history of `3` failed and `3` successful jobs are kept around for log checking.
* No restarts
* No concurrently
* A single container per cron job
* `cron` and `name` labels are set on each cron job with the name you give it

{{ template "chart.maintainersSection" . }}

{{ template "chart.sourcesSection" . }}

{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesSection" . }}

{{ template "helm-docs.versionFooter" . }}
1 change: 1 addition & 0 deletions charts/default-backend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ appVersion: random
maintainers:
- name: WyriHaximus
email: [email protected]
url: https://wyrihaximus.net
dependencies:
- name: commons
version: ^0.1
Expand Down
Loading

0 comments on commit d3b7bfd

Please sign in to comment.