-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
@@ -55,6 +62,7 @@ patches: | |||
--interface "lo" \ | |||
--vip "{{ .controlPlaneEndpoint }}" \ | |||
--controlplane \ | |||
--services \ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
api/v1beta1/packetcluster_types.go
Outdated
|
||
// EIPManagement represents whether this cluster uses CPEM or kube-vip to | ||
// manage its vip for the api server IP | ||
EipManagement string `json:"eipmanagement"` |
There was a problem hiding this comment.
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>
api/v1beta1/packetcluster_webhook.go
Outdated
if !reflect.DeepEqual(c.Spec.Facility, old.Spec.Facility) { | ||
allErrs = append(allErrs, | ||
field.Invalid(field.NewPath("spec", "VIPManager"), | ||
c.Spec.Facility, "field is immutable"), |
There was a problem hiding this comment.
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?
api/v1beta1/packetcluster_types.go
Outdated
|
||
// VIPManager represents whether this cluster uses CPEM or kube-vip to | ||
// manage its vip for the api server IP | ||
VIPManager string `json:"vipManager"` |
There was a problem hiding this comment.
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>
@cprivitere Awesome, looks good to me! |
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.