Skip to content

kube-vip should declare hostPort to avoid port scheduling conflicts #88

Description

@rptaylor

When addressing #82 I relied on the fact that kube-vip evidently always serves prometheus metrics on host port 2112 no matter what ( which it is able to do by virtue of having hostNetwork).

In doing so, kube-vip is actually a bit sneaky/mischievous, because it occupies host port 2112 without telling k8s, so the k8s scheduler does not have a way to avoid host port conflicts. Maybe that is a somewhat moot point as a daemonset usually runs everywhere (modulo tolerations), but strictly speaking it should declare a hostPort. At least, this way if something else on the cluster gets deployed with hostPort 2112, k8s will prevent it, instead of the apps encountering run-time crashes/conflicts.

This means that the containerPort defined in the daemonset https://github.com/kube-vip/helm-charts/blob/main/charts/kube-vip/templates/daemonset.yaml#L30
should , the way things are currently, always be present unconditionally, and also with hostPort included along with it.

However thinking about it a bit more, it might be preferable to have a flag to disable kube-vip from serving metrics on :2112
@thebsdbox is there a way to do that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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