-
Notifications
You must be signed in to change notification settings - Fork 29
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
duplicate containerPort
with distinct protocol
are not rendered correctly
#13
Comments
Thanks for opening this issue, @herwigstuetz! I'll have to dig into this more over the weekend. Since it's an upstream issue without a clear resolution (from a quick glance, at least) my guess is that best we can do (if anything) would be to add a hacky workaround. Let us know if you have any suggestions but I'll see if I can't figure something out. |
@hall, thanks for looking into this, but also thanks for driving kubenix forward! I think the merge strategy described in https://kubernetes.io/docs/reference/using-api/server-side-apply/#merge-strategy might be worth looking into, but I'm not sure how easily this can be adopted for the kubenix modules. For now, as a workaround, I'm basically just excluding |
How about this for a workaround? ports = {
http = { containerPort = 8080; protocol = "TCP"; };
not-http = { containerPort = 8080; protocol = "UDP"; };
}; It outputs this Yaml: ports:
- containerPort: 8080
protocol: TCP
- containerPort: 8080
protocol: UDP |
Thanks, this does work when I'm able to define my whole deployment in But I am currently working on a fix, and I'm hoping that I can submit a PR soon. |
This change uses the attribute `name` if `x-kubernetes-patch-merge-key` is not the full `x-kubernetes-list-map-keys` to avoid data corruption. Fixes hall#13
Exposing the same
containerPort
on bothTCP
andUDP
does not work as only one port ends up in the manifest, see the example below.After some digging, I found out that the
x-kubernetes-patch-merge-key
forports
inio.k8s.api.core.v1.Container
in the swagger spec consists of onlycontainerPort
but notprotocol
. And since this is used by the generator to create the module, such ports get dropped during the evaluation in the module.Since this is a known issue in kubernetes, kubenix probably shouldn't use
x-kubernetes-patch-strategy
forports
to generate the k8s manifests.Example
nix build .
on the flakeonly produces
and is missing
The text was updated successfully, but these errors were encountered: