Skip to content

Conversation

@cprivitere
Copy link

Convert to having the EIP_MANAGEMENT variable as part of the packetcluster Type

This is my attempt to implement what we discussed in Slack. I've moved the variable controlling whether we use kube-vip or CPEM into a field in the PacketCluster Type.

--interface "lo" \
--vip "{{ .controlPlaneEndpoint }}" \
--controlplane \
--services \
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think services will work here, at least not last time I tried it. From what I experience and based on the kube-vip docs we'll actually need to run kube-vip as a daemonset on the worker nodes for service load balancers.

Copy link
Author

Choose a reason for hiding this comment

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

Agreed.


// EIPManagement represents whether this cluster uses CPEM or kube-vip to
// manage its vip for the api server IP
EipManagement string `json:"eipmanagement"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

The webhook should be updated so that this field is immutable.

cprivitere added 3 commits May 6, 2022 16:01
Signed-off-by: Chris Privitere <23177737+cprivitere@users.noreply.github.com>
Signed-off-by: Chris Privitere <23177737+cprivitere@users.noreply.github.com>
Signed-off-by: Chris Privitere <23177737+cprivitere@users.noreply.github.com>
Comment on lines 74 to 77
if !reflect.DeepEqual(c.Spec.Facility, old.Spec.Facility) {
allErrs = append(allErrs,
field.Invalid(field.NewPath("spec", "VIPManager"),
c.Spec.Facility, "field is immutable"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like a copy/paste error. Shouldn't this all reference VIPManager and not Facility?


// VIPManager represents whether this cluster uses CPEM or kube-vip to
// manage its vip for the api server IP
VIPManager string `json:"vipManager"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should probably be an enum.

type VIPManagerType string

type PacketClusterSpec struct {
    // VIPManager represents whether this cluster uses CPEM or kube-vip to
    // manage its vip for the api server IP
    // +kubebuilder:validation:Enum=CPEM;KUBE_VIP
    VIPManager VIPManagerType `json:"vipManager"`
}

It might also be good to add a default value by adding the following comment above the field.:

// +kubebuilder:default:=CPEM

Signed-off-by: Chris Privitere <23177737+cprivitere@users.noreply.github.com>
@davidspek
Copy link
Collaborator

@cprivitere Awesome, looks good to me!

@davidspek davidspek merged commit b0cff13 into pluralsh:kube-vip May 16, 2022
@cprivitere cprivitere deleted the kube-vip branch July 25, 2022 18:58
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