Skip to content

Secondary Ingress Template Variables Not Evaluated #1637

@cblomqvist

Description

@cblomqvist

Describe the bug

When using the Jenkins chart's secondary ingress with template variables in hostName or TLS hosts (e.g., jenkins-{{ .Release.Name }}.example.com), Kubernetes rejects the resource with validation errors:

Error: UPGRADE FAILED: failed to create resource: Ingress.networking.k8s.io "kebab-jenkins-secondary" is invalid:
[spec.rules[0].host: Invalid value: "jenkins-{{ .Release.Name }}.example.com":
a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character]

Version of Helm and Kubernetes

- Helm: version.BuildInfo{Version:"v3.19.0", GitCommit:"3d8990f0836691f0229297773f3524598f46bda6", GitTreeState:"clean", GoVersion:"go1.24.7"}
- Kubernetes: Client Version: v1.34.3, Kustomize Version: v5.7.1, Server Version: v1.31.6

Chart version

jenkins-5.9.8

What happened?

I added a Secondary Ingress configuration that used a host value like "jenkins-{{ .Release.Name }}.example.com", which works just fine in the Primary Ingress configuration. But when I ran helm template I found that for the Secondary Ingress, the string {{ .Release.Name }} was not replaced with the value, as it was in the rendered Primary Ingress configuration.

What you expected to happen?

I expected {{ .Release.Name }} to be replaced with the actual value I wanted to use.

How to reproduce it

Here is the configuration I wanted to try:

controller:
  secondaryingress:
    enabled: true
    # Route only /wsagents/ through this ingress rule so WebSocket-specific
    # annotations and timeouts do not affect regular HTTP requests to Jenkins.
    paths:
      - /wsagents/
    apiVersion: "networking.k8s.io/v1"
    annotations:
      # Must exceed ChannelPinger pingIntervalSeconds (120s).
      # Default nginx timeout is 60s which causes disconnects before the ping arrives.
      nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
      nginx.ingress.kubernetes.io/proxy-send-timeout: "300"
      nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
      nginx.ingress.kubernetes.io/configuration-snippet: |
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    ingressClassName: nginx
    hostName: jenkins-{{ .Release.Name }}.example.com


You can see the rendered result using `helm template`

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions