Skip to content

Commit

Permalink
Remove Regions Completely (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
spjmurray authored Jun 20, 2024
1 parent 20e9d4d commit dc9dc49
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 360 deletions.
1 change: 0 additions & 1 deletion pkg/apis/unikorn/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ var (

//nolint:gochecknoinits
func init() {
SchemeBuilder.Register(&Region{}, &RegionList{})
SchemeBuilder.Register(&ClusterManager{}, &ClusterManagerList{})
SchemeBuilder.Register(&KubernetesCluster{}, &KubernetesClusterList{})
SchemeBuilder.Register(&ClusterManagerApplicationBundle{}, &ClusterManagerApplicationBundleList{})
Expand Down
108 changes: 0 additions & 108 deletions pkg/apis/unikorn/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,114 +152,6 @@ func (IPv4Prefix) OpenAPISchemaFormat() string {
return ""
}

// Provider is used to communicate the cloud type.
// +kubebuilder:validation:Enum=openstack
type Provider string

const (
ProviderOpenstack Provider = "openstack"
)

// RegionList is a typed list of regions.
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type RegionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Region `json:"items"`
}

// Region defines a geographical region where clusters can be provisioned.
// A region defines the endpoints that can be used to derive information
// about the provider for that region.
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:resource:scope=Cluster,categories=unikorn
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="display name",type="string",JSONPath=".metadata.labels['unikorn-cloud\\.org/name']"
// +kubebuilder:printcolumn:name="provider",type="string",JSONPath=".spec.provider"
// +kubebuilder:printcolumn:name="status",type="string",JSONPath=".status.conditions[?(@.type==\"Available\")].reason"
// +kubebuilder:printcolumn:name="age",type="date",JSONPath=".metadata.creationTimestamp"
type Region struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec RegionSpec `json:"spec"`
Status RegionStatus `json:"status,omitempty"`
}

// RegionSpec defines metadata about the region.
type RegionSpec struct {
// Type defines the provider type.
Provider Provider `json:"provider"`
// Openstack is provider specific configuration for the region.
Openstack *RegionOpenstackSpec `json:"openstack,omitempty"`
}

type RegionOpenstackSpec struct {
// Endpoint is the Keystone URL e.g. https://foo.bar:5000.
Endpoint string `json:"endpoint"`
// ServiceAccountSecretName points to the secret containing credentials
// required to perform the tasks the provider needs to perform.
ServiceAccountSecret *NamespacedObject `json:"serviceAccountSecret"`
// Identity is configuration for the identity service.
Identity *RegionOpenstackIdentitySpec `json:"identity,omitempty"`
// Compute is configuration for the compute service.
Compute *RegionOpenstackComputeSpec `json:"compute,omitempty"`
// Image is configuration for the image service.
Image *RegionOpenstackImageSpec `json:"image,omitempty"`
}

type NamespacedObject struct {
// Namespace is the namespace in which the object resides.
Namespace string `json:"namespace"`
// Name is the name of the object.
Name string `json:"name"`
}

type RegionOpenstackIdentitySpec struct {
// ClusterRoles are the roles required to be assigned to an application
// credential in order to provision, scale and deprovision a cluster, along
// with any required for CNI/CSI functionality.
ClusterRoles []string `json:"clusterRoles,omitempty"`
}

type RegionOpenstackComputeSpec struct {
// ServerGroupPolicy defines the anti-affinity policy to use for
// scheduling cluster nodes. Defaults to "soft-anti-affinity".
ServerGroupPolicy *string `json:"serverGroupPolicy,omitempty"`
// FlavorExtraSpecsExclude discards any flavors with the listed
// extra specs keys.
FlavorExtraSpecsExclude []string `json:"flavorExtraSpecsExclude,omitempty"`
// GPUDescriptors defines a set of keys that can be probed to
// list GPU topology information.
GPUDescriptors []OpenstackGPUDescriptor `json:"gpuDescriptors,omitempty"`
}

type OpenstackGPUDescriptor struct {
// Property is the property name to examine e.g. "resources.VGPU".
Property string `json:"property"`
// Expression describes how to extract the number of GPUs from the property
// if it exists. This must contain exactly one submatch that is a number
// e.g. "^(\d+)$".
Expression string `json:"expression"`
}

type RegionOpenstackImageSpec struct {
// PropertiesInclude defines the set of properties that must all exist
// for an image to be advertised by the provider.
PropertiesInclude []string `json:"propertiesInclude,omitempty"`
// SigningKey defines a PEM encoded public ECDSA signing key used to verify
// the image is trusted. If specified, an image must contain the "digest"
// property, the value of which must be a base64 encoded ECDSA signature of
// the SHA256 hash of the image ID.
SigningKey []byte `json:"signingKey,omitempty"`
}

// RegionStatus defines the status of the region.
type RegionStatus struct {
// Current service state of a region.
Conditions []unikornv1core.Condition `json:"conditions,omitempty"`
}

// ClusterManagerList is a typed list of cluster managers.
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ClusterManagerList struct {
Expand Down
251 changes: 0 additions & 251 deletions pkg/apis/unikorn/v1alpha1/zz_generated.deepcopy.go

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

0 comments on commit dc9dc49

Please sign in to comment.