monochart fails to create ingress due to wrongly chosen API version

Open
#280 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
helm, kubernetes

Research direction

Start with inc/monochart/templates/ingress.yaml and reproduce the example using Helm 3.18.3 or helmfile to inspect how the Kubernetes version is detected. Done means the chart selects an API version supported by Kubernetes over 1.30 and the ingress is created in the chosen namespace without the networking.k8s.io/v1beta1 error.

Written by the indexing model from the issue text.

Description

bug

Describe the Bug

monochart fails to create ingress when kube > 1.30 due to a problem in detecting kube version. For the example below, using helmfile:


  - name: test
    namespace: test
    chart: cloudposse/monochart
    version: ~0.25.0
    values:
      - ingress:
          default:
            enabled: true
            className: nginx
            port: http
            pathType: ImplementationSpecific
            hosts:
              "foo.example.com": /


It fails with message:


  Error: Failed to render chart: exit status 1: install.go:225: 2025-06-24 23:32:25.598827 -0300 -03 m=+0.019158251 [debug] Original chart version: "~0.25.0"
  install.go:242: 2025-06-24 23:32:26.242879 -0300 -03 m=+0.663214876 [debug] CHART PATH: /Users/slaterx/Library/Caches/helm/repository/monochart-0.25.0.tgz
  Error: unable to build kubernetes objects from release manifest: resource mapping not found for name: "test-default" namespace: "" from "": no matches for kind "Ingress" in version "networking.k8s.io/v1beta1"


You can notice the failure is so critical that it happens before monochart can detect chosen namespace for release. According to https://github.com/helm/helm/issues/12072, we should not use .GitVersion to detect kube version. However, inspecting source for ingress in monochart, we can see that:


{{- if semverCompare ">=1.19-0" $root.Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" $root.Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}

Expected Behavior

ingress is defined in cluster under the chosen namespace

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create ingress as per example above
  2. run helm install (or if you use helmfile, run helmfile -f <file> apply

Screenshots

If applicable, add screenshots or logs to help explain your problem.

Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:

  • OS: macOS
  • Version 0.25.0
  • helm: 3.18.3
  • helmfile: 1.1.2
Dominant language
Mustache
Stars
160
Forks
60
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cloudposse/charts

All issues in cloudposse/charts

Similar issues

More DevOps issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.