Skip to content

fix(konnectivity): render the server in the Deployment first revision - #1372

Merged
prometherion merged 3 commits into
clastix:masterfrom
serhiimazurok:fix/konnectivity-single-rollout
Oct 21, 2026
Merged

prometherion merged 3 commits into
clastix:masterfrom
serhiimazurok:fix/konnectivity-single-rollout

Conversation

@serhiimazurok

@serhiimazurok serhiimazurok commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

With konnectivity enabled, a new TCP gets two ReplicaSets at once. The first one has no konnectivity-server, so its kube-apiserver crash-loops on the missing egress selector config until the second one is ready and replaces it.

The Deployment builder now adds and removes the Konnectivity server itself, and the separate Konnectivity Deployment handler is gone.

Discussed in #663.

Before

Screenshot 2026-10-20 at 02 35 55

After

Screenshot 2026-10-20 at 02 56 43

@netlify

netlify Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for kamaji-documentation canceled.

Name Link
🔨 Latest commit 088ff08
🔍 Latest deploy log https://app.netlify.com/projects/kamaji-documentation/deploys/6ad7ec2154e0981735bc351e

@prometherion prometherion left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't we then remove the handler that wraps the Konnectivity builder? It's going to be a no-op since it doesn't ass anything else.

Comment on lines +73 to +76
if tenantControlPlane.Spec.Addons.Konnectivity != nil {
builder.Konnectivity{Scheme: *r.Client.Scheme()}.Build(r.resource, *tenantControlPlane)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If I understand correctly, we're adding this builder only to avoid the second Replica Set, and keeping the Konnectivity Server handler in place.

type KubernetesDeploymentResource struct {
resource *appsv1.Deployment
Builder builder.Konnectivity
Client client.Client
}

I think it's not entirely elegant, since we're ending up with multiple handlers doing the same thing: do you think we should consolidate the handlers (Deployment + Konnectivity) all together?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, agreed. I'll push a follow-up commit soon

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The Deployment builder now adds and removes the Konnectivity server itself, and the Konnectivity Deployment handler is gone. Could you please check?

@serhiimazurok serhiimazurok Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should I do the same for the Service in a separate PR? konnectivity.ServiceResource adds its port to the Service created by KubernetesServiceResource. What do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's safe for the Service, it doesn't rollout a new Pod so it's fine keeping it as a separate handler.

k.buildVolumeMounts(&deployment.Spec.Template.Spec)
k.buildVolumes(tenantControlPlane.Status.Addons.Konnectivity, &deployment.Spec.Template.Spec)

k.Scheme.Default(deployment)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why has this been removed? IIRC, it's required to avoid an infinite loop while reconciling due to default values applied by the API Server, causing the reflection package to return a false positive of non-identical structs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We had two calls, and one of them is still here, in Deployment.Build:

Konnectivity{}.Build(deployment, tenantControlPlane)
d.Client.Scheme().Default(deployment)

Konnectivity{}.Build now runs right before it, so the Konnectivity container, volumes and mounts get the defaults too.

@prometherion
prometherion merged commit 136dac3 into clastix:master Oct 21, 2026
13 checks passed
rossigee pushed a commit to rossigee/kamaji that referenced this pull request Oct 30, 2026
…clastix#1372)

* fix(konnectivity): render the server in the Deployment first revision

* refactor(konnectivity): render the server from the Deployment builder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants