Skip to content
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

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

Merged
merged 5 commits into from
May 16, 2022
Merged

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.

@@ -55,6 +62,7 @@ patches:
--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.

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
2 participants