Skip to content

Commit

Permalink
expose cluster load balancer spec and metadata via KubevirtCluster re…
Browse files Browse the repository at this point in the history
…source

Signed-off-by: Alex Gradouski <[email protected]>
  • Loading branch information
agradouski committed Feb 1, 2022
1 parent 8cfcdbb commit 8e6ebf4
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 319 deletions.
19 changes: 16 additions & 3 deletions api/v1alpha1/kubevirtcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@ type KubevirtClusterSpec struct {
ControlPlaneEndpoint APIEndpoint `json:"controlPlaneEndpoint,omitempty"`

// SSHKeys is a reference to a local struct for SSH keys persistence.
// +optional
SshKeys SSHKeys `json:"sshKeys,omitempty"`

// InfraClusterSecretRef is a reference to a secret with a kubeconfig for external cluster used for infra.
// +optional
InfraClusterSecretRef *corev1.ObjectReference `json:"infraClusterSecretRef,omitempty"`

// LoadBalancerServiceTemplate is a load balancer service template.
// LoadBalancerServiceTemplate describes load balancer service template.
// +optional
LoadBalancerServiceTemplate LoadBalancerServiceTemplate `json:"loadBalancerServiceTemplate,omitempty"`
}

Expand Down Expand Up @@ -90,12 +93,22 @@ type SSHKeys struct {

// LoadBalancerServiceTemplate describes the template for the cluster load balancer service.
type LoadBalancerServiceTemplate struct {
// Service metadata.
// +kubebuilder:pruning:PreserveUnknownFields
// +nullable
// Service metadata.
ObjectMeta metav1.ObjectMeta `json:"metadata,omitempty"`
// Service specification.
Spec corev1.ServiceSpec `json:"spec,omitempty" valid:"required"`
// +optional
Spec ServiceSpecTemplate `json:"spec,omitempty"`
}

// ServiceSpecTemplate describes the service spec template.
type ServiceSpecTemplate struct {
// Type determines how the Service is exposed. Defaults to ClusterIP. Valid
// options are ExternalName, ClusterIP, NodePort, and LoadBalancer.
// More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
// +optional
Type corev1.ServiceType `json:"type,omitempty"`
}

// +kubebuilder:resource:path=kubevirtclusters,scope=Namespaced,categories=cluster-api
Expand Down
17 changes: 16 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8e6ebf4

Please sign in to comment.