diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 52c965e..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,7 +0,0 @@ -* @kafbat/maintainers - -# HELM CHARTS -/charts/ @kafbat/devops - -# INFRA -.github/workflows @kafbat/devops diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index dffd1a1..0000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,11 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Official documentation - url: https://ui.docs.kafbat.io/ - about: Before reaching out for support, please refer to our documentation. Read "FAQ" and "Common problems", also try using search there. - - name: Community Discord - url: https://discord.gg/4DWzD7pGE5 - about: Chat with other users, get some support or ask questions. - - name: GitHub Discussions - url: https://github.com/kafbat/kafka-ui/discussions - about: An alternative place to ask questions or to get some support. diff --git a/.github/ISSUE_TEMPLATE/helm.yml b/.github/ISSUE_TEMPLATE/helm.yml deleted file mode 100644 index f925479..0000000 --- a/.github/ISSUE_TEMPLATE/helm.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: "⎈ K8s/Helm problem report" -description: "Report a problem with k8s/helm charts/etc" -labels: ["status/triage", "scope/k8s"] -assignees: [] - -body: - - type: markdown - attributes: - value: | - Hi, thanks for raising the issue(-s), all contributions really matter! - Please, note that we'll close the issue without further explanation if you don't follow - this template and don't provide the information requested within this template. - - - type: checkboxes - id: terms - attributes: - label: Issue submitter TODO list - description: By you checking these checkboxes we can be sure you've done the essential things. - options: - - label: I've looked up my issue in [FAQ](https://ui.docs.kafbat.io/faq/common-problems) - required: true - - label: I've searched for an already existing issues [here (legacy)](https://github.com/kafbat/kafka-ui/issues) and [here](https://github.com/kafbat/helm-charts/issues) - required: true - - label: I've tried installing latest charts and the issue still persists there - required: true - - label: I'm running a supported version of the application & chart which is listed [here](https://github.com/kafbat/kafka-ui/blob/master/.github/SECURITY.md) - required: true - - - type: textarea - attributes: - label: Describe the bug (actual behavior) - description: A clear and concise description of what the bug is. Use a list, if there is more than one problem - validations: - required: true - - - type: textarea - attributes: - label: Expected behavior - description: A clear and concise description of what you expected to happen - validations: - required: false - - - type: textarea - attributes: - label: Your installation details - description: | - How do you run the app? Please provide as much info as possible: - 1. App version (commit hash in the top left corner of the UI) - 2. Helm chart version - 3. Your application config. Please remove the sensitive info like passwords or API keys. - 4. Any IAAC configs - validations: - required: true - - - type: textarea - attributes: - label: Steps to reproduce - description: | - Please write down the order of the actions required to reproduce the issue. - For the advanced setups/complicated issue, we might need you to provide - a minimal [reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). - validations: - required: true - - - type: textarea - attributes: - label: Screenshots - description: | - If applicable, add screenshots to help explain your problem - validations: - required: false - - - type: textarea - attributes: - label: Logs - description: | - If applicable, *upload* screenshots to help explain your problem - validations: - required: false - - - type: textarea - attributes: - label: Additional context - description: | - Add any other context about the problem here. E.G.: - 1. Are there any alternative scenarios (different data/methods/configuration/setup) you have tried? - Were they successful or the same issue occurred? Please provide steps as well. - 2. Related issues (if there are any). - 3. Logs (if available) - 4. Is there any serious impact or behaviour on the end-user because of this issue, that can be overlooked? - validations: - required: false diff --git a/.github/workflows/create-branch-for-helm.yaml b/.github/workflows/create-branch-for-helm.yaml deleted file mode 100644 index 8ac005c..0000000 --- a/.github/workflows/create-branch-for-helm.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Prepare helm release -on: - repository_dispatch: - types: [prepare-helm-release] -jobs: - change-app-version: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - run: | - git config user.name github-actions - git config user.email github-actions@github.com - - name: Change versions - run: | - git checkout -b release-${{ github.event.client_payload.appversion}} - version=$(cat charts/kafka-ui/Chart.yaml | grep version | awk '{print $2}') - version=${version%.*}.$((${version##*.}+1)) - sed -i "s/version:.*/version: ${version}/" charts/kafka-ui/Chart.yaml - sed -i "s/appVersion:.*/appVersion: ${{ github.event.client_payload.appversion}}/" charts/kafka-ui/Chart.yaml - git add charts/kafka-ui/Chart.yaml - git commit -m "release ${version}" - git push --set-upstream origin release-${{ github.event.client_payload.appversion}} - - name: Slack Notification - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_TITLE: "release-${{ github.event.client_payload.appversion}}" - SLACK_MESSAGE: "A new release of the helm chart has been prepared. Branch name: release-${{ github.event.client_payload.appversion}}" - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} \ No newline at end of file diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml deleted file mode 100644 index 2dbdd77..0000000 --- a/.github/workflows/helm.yaml +++ /dev/null @@ -1,52 +0,0 @@ -name: Helm linter -on: - pull_request: - types: ["opened", "edited", "reopened", "synchronize"] - branches: - - 'main' - paths: - - "charts/**" -jobs: - build-and-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Helm tool installer - uses: Azure/setup-helm@v3 - - #check, was helm version increased in Chart.yaml? - - name: Check version - shell: bash - run: | - helm_version_new=$(cat charts/kafka-ui/Chart.yaml | grep version | awk '{print $2}') - helm_version_old=$(curl -s https://raw.githubusercontent.com/kafbat/helm-charts/main/charts/kafka-ui/Chart.yaml | grep version | awk '{print $2}' ) - echo $helm_version_old - echo $helm_version_new - if [[ "$helm_version_new" > "$helm_version_old" ]]; then exit 0 ; else exit 1 ; fi - - - name: Pull kubeconform image - run: docker pull ghcr.io/yannh/kubeconform:v0.7.0@sha256:7426d17ca19f3731d2a6287c868005f052f2682800141f20e83d3109f5c8faa1 - - - name: Run kubeconform - shell: bash - run: | - set -euo pipefail - sed -i "s@enabled: false@enabled: true@g" charts/kafka-ui/values.yaml - K8S_VERSIONS=$( - git ls-remote --refs --tags https://github.com/kubernetes/kubernetes.git | - cut -d/ -f3 | # keep only the tag name, e.g. v1.32.0, v1.32.0^{} - grep -E '^v1\.[0-9]{2,3}\.0$' | # select release tags v1.xx.0 or v1.xxx.0 - sort -Vu | # remove duplicates (^{} entries) and sort ascending - sed 's/^v//' # strip the leading v → 1.32.0, 1.33.0, … - ) - echo "" - for version in $K8S_VERSIONS; do - helm template \ - --kube-version "$version" \ - --set ingress.enabled=true \ - charts/kafka-ui \ - -f charts/kafka-ui/values.yaml | \ - docker run --rm -i ghcr.io/yannh/kubeconform:latest \ - -strict -summary -ignore-missing-schemas -kubernetes-version "$version" - | \ - sed "s/^/v${version}: /" - done \ No newline at end of file diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..dac7f51 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,48 @@ +name: Lint and Validate Charts + +on: + pull_request: + branches: [main] + paths: [charts/**] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: azure/setup-helm@v4 + + - name: Check version bump + run: | + version_new=$(grep '^version:' charts/kafka-ui/Chart.yaml | awk '{print $2}') + version_old=$(curl -s https://raw.githubusercontent.com/${{ github.repository }}/main/charts/kafka-ui/Chart.yaml | grep '^version:' | awk '{print $2}') + echo "main: $version_old pr: $version_new" + if [[ "$version_new" > "$version_old" ]]; then exit 0; else exit 1; fi + + - name: Run kubeconform + run: | + set -euo pipefail + sed -i "s@enabled: false@enabled: true@g" charts/kafka-ui/values.yaml + K8S_VERSIONS=$( + git ls-remote --refs --tags https://github.com/kubernetes/kubernetes.git | + cut -d/ -f3 | + grep -E '^v1\.[0-9]{2,3}\.0$' | + sort -Vu | + sed 's/^v//' + ) + for version in $K8S_VERSIONS; do + helm template \ + --kube-version "$version" \ + --set ingress.enabled=true \ + charts/kafka-ui \ + -f charts/kafka-ui/values.yaml | \ + docker run --rm -i ghcr.io/yannh/kubeconform:latest \ + -strict -summary -ignore-missing-schemas \ + -schema-location default \ + -schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json' \ + -kubernetes-version "$version" - | \ + sed "s/^/v${version}: /" + done diff --git a/.github/workflows/release-helm.yaml b/.github/workflows/release-helm.yaml deleted file mode 100644 index 2cb917a..0000000 --- a/.github/workflows/release-helm.yaml +++ /dev/null @@ -1,51 +0,0 @@ -name: Release helm -on: - push: - branches: - - main - paths: - - "charts/**" - -jobs: - release-helm: - runs-on: ubuntu-latest - permissions: - contents: write # to push chart release and create a release (helm/chart-releaser-action) - packages: write # needed for ghcr access - id-token: write # needed for keyless signing - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - run: | - git config user.name github-actions - git config user.email github-actions@github.com - - 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}') - echo "HELM_VERSION=$(echo ${VERSION})" >> $GITHUB_ENV - MSG=$(helm package charts/kafka-ui) - git fetch origin - git stash - git checkout -b gh-pages origin/gh-pages - git pull - helm repo index . - git add -f ${MSG##*/} index.yaml - git commit -m "release ${VERSION}" - git push - - uses: rickstaa/action-create-tag@v1 #create new tag - with: - tag: "charts/kafka-ui-${{ env.HELM_VERSION }}" - - name: Login to GitHub Container Registry - uses: docker/login-action@v3.6.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Push chart to GHCR - run: | - git checkout - - helm package charts/kafka-ui - helm push kafka-ui-*.tgz oci://ghcr.io/${{ github.repository_owner }}/charts - diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..472cf93 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,42 @@ +name: Release Charts + +on: + push: + branches: [main] + paths: [charts/**] + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: azure/setup-helm@v4 + + - uses: helm/chart-releaser-action@v1.6.0 + id: release + env: + CR_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + charts_dir: charts + skip_existing: true + + - name: Login to GHCR + if: steps.release.outputs.changed_charts != '' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push charts to GHCR OCI + if: steps.release.outputs.changed_charts != '' + run: | + for pkg in .cr-release-packages/*.tgz; do + helm push "$pkg" oci://ghcr.io/${{ github.repository_owner }}/charts + done diff --git a/.github/workflows/update-config-docs.yaml b/.github/workflows/update-config-docs.yaml deleted file mode 100644 index 214b7a6..0000000 --- a/.github/workflows/update-config-docs.yaml +++ /dev/null @@ -1,51 +0,0 @@ -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 CONFIGURATION.md for ${chart}" - readme-generator --values "${chart}/values.yaml" --readme "${chart}/CONFIGURATION.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@v6 - with: - commit_message: Update CONFIGURATION.md for modified charts diff --git a/charts/kafka-ui/Chart.yaml b/charts/kafka-ui/Chart.yaml index eb927d0..5680eae 100644 --- a/charts/kafka-ui/Chart.yaml +++ b/charts/kafka-ui/Chart.yaml @@ -2,6 +2,6 @@ apiVersion: v2 name: kafka-ui description: A Helm chart for kafka-UI type: application -version: 1.6.2 +version: 1.6.3 appVersion: v1.4.2 icon: https://raw.githubusercontent.com/kafbat/kafka-ui/main/documentation/images/logo_new.png diff --git a/charts/kafka-ui/templates/http-route.yaml b/charts/kafka-ui/templates/http-route.yaml new file mode 100644 index 0000000..422b314 --- /dev/null +++ b/charts/kafka-ui/templates/http-route.yaml @@ -0,0 +1,87 @@ +{{- range $routeIdx, $route := .Values.httpRoutes }} +{{- if $route.enabled }} +{{- if or (not $route.gatewayParentRefs) (lt (len $route.gatewayParentRefs) 1) }} +{{- fail (printf "httpRoute[%d].gatewayParentRefs must be defined and contain at least one gateway reference." $routeIdx) }} +{{- end -}} + +{{- if or (not $route.matches) (lt (len $route.matches) 1) }} +{{- fail (printf "httpRoute[%d].matches must be defined and contain at least one match element." $routeIdx) }} +{{- end -}} + +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ $route.nameOverride | default (printf "%s-%s" (include "kafka-ui.fullname" $) (first $route.gatewayParentRefs).name) | trunc 54 | trimSuffix "-" }}-httproute + namespace: {{ $.Release.Namespace }} + labels: + {{- include "kafka-ui.labels" $ | nindent 4 }} + {{- if $route.labels }} + {{- tpl (toYaml $route.labels) $ | nindent 4 }} + {{- end }} + {{- if $route.annotations }} + annotations: + {{- tpl (toYaml $route.annotations) $ | nindent 4 }} + {{- end }} +spec: + parentRefs: + {{- range $idx, $parentRef := $route.gatewayParentRefs }} + - group: gateway.networking.k8s.io + kind: Gateway + name: {{ tpl (required (printf "httpRoutes[%d].gatewayParentRefs[%d].name is required." $routeIdx $idx) $parentRef.name) $ }} + {{- if $parentRef.namespace }} + namespace: {{ $parentRef.namespace }} + {{- end }} + {{- if $parentRef.sectionName }} + sectionName: {{ $parentRef.sectionName }} + {{- end }} + {{- end }} + {{- if $route.hostnames }} + hostnames: + {{- tpl (toYaml $route.hostnames) $ | nindent 2 }} + {{- end }} + rules: + - matches: + {{- tpl (toYaml $route.matches) $ | nindent 4 }} + {{- if $route.shouldRouteToService }} + backendRefs: + - group: '' + kind: Service + name: {{ include "kafka-ui.fullname" $ }} + port: {{ $.Values.service.port | default 80 | int }} + weight: 1 + {{- end }} + {{- if $route.filters }} + filters: + {{- /* shouldStripPath is prepended before any custom filters */ -}} + {{- if $route.shouldStripPath }} + - type: URLRewrite + urlRewrite: + path: + type: ReplacePrefixMatch + replacePrefixMatch: "/" + {{- end }} + {{- tpl (toYaml $route.filters) $ | nindent 4 }} + {{- else if $route.shouldStripPath }} + filters: + - type: URLRewrite + urlRewrite: + path: + type: ReplacePrefixMatch + replacePrefixMatch: "/" + {{- end }} + {{- if $route.timeouts }} + timeouts: + {{- tpl (toYaml $route.timeouts) $ | nindent 4 }} + {{- end }} +{{- /* Add a document separator only if there is a subsequent enabled route */ -}} +{{- $hasMoreEnabled := false -}} +{{- range $i, $r := $.Values.httpRoutes -}} + {{- if and (gt $i $routeIdx) $r.enabled -}} + {{- $hasMoreEnabled = true -}} + {{- end -}} +{{- end -}} +{{- if $hasMoreEnabled }} +--- +{{- end }} +{{- end -}} +{{- end -}} diff --git a/charts/kafka-ui/values.yaml b/charts/kafka-ui/values.yaml index 8b1f4dd..66c787e 100644 --- a/charts/kafka-ui/values.yaml +++ b/charts/kafka-ui/values.yaml @@ -256,6 +256,48 @@ ingress: ## @param ingress.succeedingPaths [array] Http paths to add to the Ingress after the default path succeedingPaths: [] + +## Kafka-UI HTTPRoute configuration +## ref: https://gateway-api.sigs.k8s.io/api-types/httproute/ +## +## @param httpRoutes [array] HTTPRoute resources to create. +httpRoutes: +## @param httpRoutes.enabled [string] Enable this HTTPRoute +- enabled: false + ## @param httpRoutes.hostnames [array] Hostnames to expose this HTTPRoute under + hostnames: + - "example.com" + ## @param httpRoutes.annotations [object] Additional annotations for the HTTPRoute resource. + annotations: {} + ## @param httpRoutes.labels [object] Labels for the HTTPRoute + labels: {} + ## @param httpRoutes.nameOverride [string] The name to give this HTTPRoute resource. + nameOverride: "" + ## @param httpRoutes.gatewayParentRefs [array] Which gateway to bind this HTTPRoute to + gatewayParentRefs: + ## @param httpRoutes.gatewayParentRefs.name [string] The name of the gateway to bind this HTTPRoute to. + - name: "gateway-example" + ## @param httpRoutes.gatewayParentRefs.namespace [string] The namespace that the gateway is defined under. + namespace: "gateway-example" + ## @param httpRoutes.gatewayParentRefs.sectionName [string] The section name of the listener to bind to on the Gateway. + sectionName: "http-listener" + ## @param httpRoutes.shouldStripPath [bool] Whether to strip the path before sending the request to the service. + shouldStripPath: true + ## @param httpRoutes.shouldRouteToService [bool] Whether this HTTPRoute should route to the backend service. + shouldRouteToService: true + ## @param httpRoutes.matches [array] HTTPRoute match rules, ref: https://gateway-api.sigs.k8s.io/reference/spec/#httproutematch. + matches: + ## @param httpRoutes.matches.path [object] Match the route based on this path structure. + - path: + ## @param httpRoutes.matches.path.type [string] One of Exact, PathPrefix or RegularExpression. + type: PathPrefix + ## @param httpRoutes.matches.path.value [string] The path to match on after the host. + value: "/kafka-ui" + ## @param httpRoutes.filters [array] HTTPRoute filters, ref: https://gateway-api.sigs.k8s.io/reference/spec/#httproutefilter. + filters: [] + ## @param httpRoutes.timeouts [object] HTTPRoute timeouts, ref: https://gateway-api.sigs.k8s.io/reference/spec/#httproutetimeouts. + timeouts: {} + ## @param resources [object] Set Kafka-UI pod requests and limits for different resources like CPU or memory (essential for production workloads) ## @section Scheduling