Skip to content

Commit

Permalink
Update Charts README.md file from values metadata (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: azatsafin <[email protected]>
  • Loading branch information
azatsafin and azatsafin authored Oct 3, 2024
1 parent 16831e5 commit 558b944
Show file tree
Hide file tree
Showing 5 changed files with 272 additions and 70 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/readme-update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: 'Update README from values.yaml metadata'

on:
pull_request:
branches:
- main
paths:
- "charts/**"

permissions: {} # Remove all permissions by default

jobs:
update-readme-metadata:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Install readme-generator-for-helm
run: npm install -g @bitnami/readme-generator-for-helm
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Necessary for getting a complete history for diffs

- name: Get modified charts
id: get-modified-charts
run: |
paths=$(git diff --name-only origin/main... --name-only | grep 'charts/.*/values.yaml' | cut -d/ -f1,2 | uniq | tr '\n' ' ')
echo "Modified charts: $paths"
echo "paths=${paths}" >> $GITHUB_ENV # Using ENV as this is now within the same job
- name: Execute readme-generator-for-helm
if: env.paths != '' # Ensure there are paths to proceed
run: |
IFS=' ' read -ra ADDR <<< "$paths"
echo "Updating READMEs for modified charts: ${ADDR[@]}"
for chart in "${ADDR[@]}"; do
echo "Updating README.md for ${chart}"
readme-generator --values "${chart}/values.yaml" --readme "${chart}/README.md"
if [[ $? -ne 0 ]]; then
echo "Error: Failed to update README for ${chart}"
exit 1
fi
# fix schema for nullable
# cat <<< $(jq '(..|objects|select(.nullable)).type |= ["string","null"]' "${chart}/values.schema.json") > "${chart}/values.schema.json"
done
- name: Commit and Push Changes
if: env.paths != '' # Only commit if there are changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update README.md for modified charts
16 changes: 6 additions & 10 deletions .github/workflows/release-helm.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
name: Release helm
on:
push:
push:
branches:
- main
- main
paths:
- "charts/**"

jobs:
release-helm:
runs-on:
ubuntu-latest
steps:
release-helm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1

- run: |
git config user.name github-actions
git config user.email [email protected]
- uses: azure/setup-helm@v3

- name: add chart #realse helm with new version
run: |
VERSION=$(cat charts/kafka-ui/Chart.yaml | grep version | awk '{print $2}')
Expand All @@ -36,4 +32,4 @@ jobs:
git push
- uses: rickstaa/action-create-tag@v1 #create new tag
with:
tag: "charts/kafka-ui-${{ env.HELM_VERSION }}"
tag: "charts/kafka-ui-${{ env.HELM_VERSION }}"
2 changes: 1 addition & 1 deletion charts/kafka-ui/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ apiVersion: v2
name: kafka-ui
description: A Helm chart for kafka-UI
type: application
version: 1.4.5
version: 1.4.6
appVersion: v1.0.0
icon: https://raw.githubusercontent.com/kafbat/kafka-ui/main/documentation/images/logo_new.png
89 changes: 88 additions & 1 deletion charts/kafka-ui/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,88 @@
Please refer to our [documentation](https://ui.docs.kafbat.io/configuration/helm-charts) to get some info on our helm charts.
## Parameters

### Common

| Name | Description | Value |
| ------------------ | ------------------------------------------ | ----- |
| `replicaCount` | Number of Kafka-UI replicas to deploy | `1` |
| `image.registry` | image registry | `""` |
| `image.repository` | image repository | `""` |
| `image.pullPolicy` | image pull policy | `""` |
| `image.tag` | image tag (immutable tags are recommended) | `""` |
| `imagePullSecrets` | Docker registry secret names as an array | `[]` |
| `nameOverride` | String to partially override chart name | `""` |
| `fullnameOverride` | String to fully override app name | `""` |

### ServiceAccount configuration

| Name | Description | Value |
| ---------------------------- | ---------------------------------------------------- | ------ |
| `serviceAccount.name` | The name of the ServiceAccount to use. | `""` |
| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` |
| `serviceAccount.annotations` | Additional Service Account annotations | `{}` |

### Application configuration

| Name | Description | Value |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| `existingConfigMap` | Name of the existing ConfigMap with kafbat-ui environment variables | `""` |
| `yamlApplicationConfig` | Kafbat-UI config in Yaml format | `{}` |
| `yamlApplicationConfigConfigMap` | Map with name and keyName keys, name refers to the existing ConfigMap, keyName refers to the ConfigMap key with Kafbat-UI config in Yaml format | `{}` |
| `yamlApplicationConfigSecret` | Secret with name and keyName keys, name refers to the existing ConfigMap, keyName refers to the ConfigMap key with Kafbat-UI config in Yaml format | `{}` |
| `existingSecret` | Name of the existing Secret with Kafbat-UI environment variables | `""` |
| `envs.secret` | Set of the sensitive environment variables to pass to Kafbat-UI | `{}` |
| `envs.config` | Set of the environment variables to pass to Kafbat-UI | `{}` |
| `envs.secretMappings` | The mapping of existing secret to env variable. | `{}` |
| `envs.configMappings` | The mapping of configmap and keyName to get env variable. | `{}` |
| `env` | Envs to be added to the Kafka-UI container | `{}` |
| `resources` | Set Kafka-UI container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` |
| `initContainers` | Add additional init containers to the Kafka-UI pods | `{}` |
| `volumeMounts` | Optionally specify additional volumeMounts for the kafka-UI container | `{}` |
| `volumes` | Optionally specify additional volumes for the Kafka-UI pods | `{}` |
| `hostAliases` | Kafka-UI pods host aliases | `{}` |
| `extraContainers` | Specify additional containers in extraContainers. | `""` |

### Network Policies

| Name | Description | Value |
| ----------------------- | --------------------------------------------------------- | ------- |
| `networkPolicy.enabled` | Specifies whether a NetworkPolicy should be created | `false` |
| `podAnnotations` | Annotations for Kafka-UI pods | `{}` |
| `podLabels` | Extra labels for Kafka-UI pods | `{}` |
| `annotations` | Annotations to be added to kafka-ui Deployment | `{}` |
| `probes.useHttpsScheme` | Set field schema as HTTPS for readines and liveness probe | `false` |

### Security Context

| Name | Description | Value |
| -------------------- | ----------------------------------------------------------------------------------- | ----- |
| `podSecurityContext` | The security settings that you specify for a Pod apply to all Containers in the Pod | `{}` |
| `securityContext` | The security settings that you specify for a Kafka-UI container | `{}` |

### Traffic Exposure Parameters

| Name | Description | Value |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| `service.type` | Kafka-UI service type | `ClusterIP` |
| `service.port` | Kafka-UI pod port number | `80` |
| `ingress.enabled` | Enable ingress record generation for Kafka-UI | `""` |
| `ingress.annotations` | Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. | `{}` |
| `ingress.labels` | Labels for the Ingress | `{}` |
| `ingress.ingressClassName` | IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) | `""` |
| `ingress.path` | Default path for the ingress record | `/` |
| `ingress.pathType` | Ingress path type | `Prefix` |
| `ingress.host` | Default hostname for the ingress record | `""` |
| `ingress.tls.enabled` | Enable TLS configuration for the host defined at `ingress.host` parameter | `false` |
| `ingress.tls.secretName` | The name of a pre-created Secret containing a TLS private key and certificate | `""` |
| `ingress.precedingPaths` | HTTP paths to add to the Ingress before the default path | `[]` |
| `ingress.succeedingPaths` | Http paths to add to the Ingress after the default path | `[]` |
| `resources` | Set Kafka-UI pod requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` |

### Scheduling

| Name | Description | Value |
| ---------------------- | ----------------------------------------------------------------------- | ----- |
| `nodeSelector` | Node labels for Kafka-UI pods assignment | `{}` |
| `tolerations` | Tolerations for Kafka-UI pods assignment | `[]` |
| `affinity` | Affinity for Kafka-UI pods assignment | `{}` |
| `revisionHistoryLimit` | Specify how many old ReplicaSets for this Deployment you want to retain | `nil` |
Loading

0 comments on commit 558b944

Please sign in to comment.