Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple ingress releases with the same name but in different namespaces #942

Open
1 task
pmalek opened this issue Nov 15, 2023 · 4 comments
Open
1 task
Labels
enhancement New feature or request

Comments

@pmalek
Copy link
Member

pmalek commented Nov 15, 2023

Problem statement

Currently, ingress (through the means of kong subcharts) chart creates a ClusterRole named

{{- $name := default .Chart.Name .Values.nameOverride -}}

which (when .Values.nameOverride is unspecified) collides since it uses the same name default .Chart.Name .Values.nameOverride.

The purpose of this issue is to allow multiple installations of ingress chart (and possibly kong as well) with the same release name in different namespaces

Acceptance criteria

  • As a user I can install ingress chart with the same release name in different namespaces
@pmalek pmalek added the enhancement New feature or request label Nov 15, 2023
@rainest
Copy link
Contributor

rainest commented Nov 15, 2023

It does include the release name also, OP has an initial prep variable that's then used in the full template output:

{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- default (printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-") .Values.fullnameOverride -}}

Resource names and other fields that use fullname are length limited and we have encountered issues with that in the past:

#675
#819

Injecting the namespace in there will make all names longer, forcing other installs to either shorter release names or nameOverride. You'd have to weigh how critical being able to use the same release name across namespaces is against that. AFAIK there's no reason you'd have to use the same release name across namespaces; it's mostly a gotcha.

@pmalek
Copy link
Member Author

pmalek commented Nov 15, 2023

If we change

{{- $name := default .Chart.Name .Values.nameOverride -}}

to

{{- $name := default .Release.Namespace .Values.nameOverride -}}

wouldn't that work? This could in theory collide with other ClusterRoles that use this release's namespace and name but 🤷 The probability of a collision is the same using the .Chart.Name (which in ingress is either controller or gateway)

@rainest
Copy link
Contributor

rainest commented Nov 15, 2023

I'm fairly sure that will break stuff in ingress even without multiple releases. The namespace is the same for both subcharts, and stuff like the HPA can be turned on for both and just uses kong.fullname.

I think you'd need to create a separate kong.ns-fullname and use it for Cluster-level resources. That does still run the same overflow risk, but less so--AFAIK most of the problem resources are adding additional suffixes past kong.fullname (the migration jobs with their long -TASK-migrations suffixes are the ones that usually hit the limit). If we only create one of a resource (which I think is the case for most or all cluster resources), we usually just use kong.fullname alone as the resource name.

@pmalek
Copy link
Member Author

pmalek commented Nov 16, 2023

The namespace is the same for both subcharts

Ah, right 🤦

I think you'd need to create a separate kong.ns-fullname and use it for Cluster-level resources.

What would be the advantage over reusing kong.fullname?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants