Skip to content

Make per-stack hostnames configurable #693

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

Closed
wants to merge 4 commits into from
Closed

Conversation

demonCoder95
Copy link
Member

This makes per-stack hostnames configurable in the stackset.

This allows us to disable support for per-stack hostnames, which is required to solve the problem of duplication of hostnames when a stackset is deployed in multiple namespaces, or multiple clusters in the same account.

The objective is to first be able to disable the support, and then encourage the users that actually rely on this to use .cluster.local hostnames instead for their e2e testing.

@@ -570,7 +570,7 @@ func TestGenerateIngressSegmentWithSyncAnnotations(t *testing.T) {
ingressAnnotationsToSync: tc.ingresssAnnotationsToSync,
syncAnnotationsInIngress: tc.syncAnnotationsInIngress,
}
res, _ := c.GenerateIngressSegment()
res, _ := c.GenerateIngressSegment(true)
Copy link
Member

@linki linki Jun 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we duplicate this block of tests for GenerateIngressSegment(false) or would the result just be empty?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the result would just be empty, because ingresses wouldn't be generated.

@demonCoder95
Copy link
Member Author

The default value of the flag enable-per-stack-hostname is set to false so we can test the behavior with e2e tests. It will later be set to true for backwards compatibility so we can safely merge the PR and rollout the change.

e2e is also currently failing as the flag doesn't completely "disable" the per-stack ingresses. Looking into it now.

@demonCoder95
Copy link
Member Author

demonCoder95 commented Jun 25, 2025

Will test e2e tests by setting default to true, which should make the flag a no-op.

Update: This works, will disable the hostnames again and try to get e2es to pass.

@@ -70,6 +71,7 @@ func main() {
kingpin.Flag("enable-configmap-support", "Enable support for ConfigMaps on StackSets.").Default("false").BoolVar(&config.ConfigMapSupportEnabled)
kingpin.Flag("enable-secret-support", "Enable support for Secrets on StackSets.").Default("false").BoolVar(&config.SecretSupportEnabled)
kingpin.Flag("enable-pcs-support", "Enable support for PlatformCredentialsSet on StackSets.").Default("false").BoolVar(&config.PCSSupportEnabled)
kingpin.Flag("enable-per-stack-hostname", "Enable support for per-stack hostnames.").Default("false").BoolVar(&config.PerStackHostnameEnabled)
Copy link
Contributor

@mikkeloscar mikkeloscar Jun 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Let's make it true by default to be backwards compatible.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I can keep this TODO open for now. I want to keep it false for now to be able to test. I'll set it to true before merging.

*networking.Ingress,
error,
) {

// If Per-stack Hostnames are disabled, no need to generate per stack ingresses
if !perStackHostnameEnabled {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only if segment is also false, because we want to generate segment ingresses regardless.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. I'll try with that. Thanks.

@demonCoder95
Copy link
Member Author

Closing this in favor of #696 which implements a better solution.

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

Successfully merging this pull request may close these issues.

3 participants