-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Can now build Isolated network with extra CRDs. * Such awesome, much wow * Saving progress and switching gears. * Abstractions gallore. * Further abstraction of the controller as an idea. Compiles and almost works. * More generalized than before. * More abstraction still. * Made things work. * Made things work. * Zones firing. * Machines work via new style now. * Slight cleanup. * Iso net with load balancer rules working now. * Set nginx to use default ports. * Isolated networks create and delete with load balancer and fill endpoint hosts now. * Builds a cluster. * Added Affinity group crd. * Added machine health checker. * Afinity groups are a go. * Update partially to main. * Some cleanup. More to come. * Fixup missing dispose iso net call. * Removed machine health checker crd. * Removed machine health checker crd. * Passes webhook and controller tests. Passes lint. * Unit tests fixed up. * Mild cleanup. * Updated per PR comments. * Fixup tests. * Fixup again. * Readd non-root. * Fix isolated network deletion. * pr review comments addressed. * Fix tests. * Fixup finalizer.
- Loading branch information
Showing
68 changed files
with
3,416 additions
and
1,199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
Copyright 2022 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1beta1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
const ( | ||
AffinityGroupFinalizer = "affinitygroup.infrastructure.cluster.x-k8s.io" | ||
) | ||
|
||
// CloudStackAffinityGroupSpec defines the desired state of CloudStackAffinityGroup | ||
type CloudStackAffinityGroupSpec struct { | ||
// Mutually exclusive parameter with AffinityGroupIDs. | ||
// Can be "host affinity" or "host anti-affinity". Will create an affinity group per machine set. | ||
Type string `json:"type,omitempty"` | ||
|
||
// Name. | ||
Name string `json:"name,omitempty"` | ||
|
||
// ID. | ||
//+optional | ||
ID string `json:"id,omitempty"` | ||
} | ||
|
||
// CloudStackAffinityGroupStatus defines the observed state of CloudStackAffinityGroup | ||
type CloudStackAffinityGroupStatus struct { | ||
// Reflects the readiness of the CS Affinity Group. | ||
Ready bool `json:"ready"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
|
||
// CloudStackAffinityGroup is the Schema for the cloudstackaffinitygroups API | ||
type CloudStackAffinityGroup struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec CloudStackAffinityGroupSpec `json:"spec,omitempty"` | ||
Status CloudStackAffinityGroupStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// CloudStackAffinityGroupList contains a list of CloudStackAffinityGroup | ||
type CloudStackAffinityGroupList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []CloudStackAffinityGroup `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&CloudStackAffinityGroup{}, &CloudStackAffinityGroupList{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
Copyright 2022 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1beta1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" | ||
) | ||
|
||
const ( | ||
// The presence of a finalizer prevents CAPI from deleting the corresponding CAPI data. | ||
IsolatedNetworkFinalizer = "cloudstackisolatednetwork.infrastructure.cluster.x-k8s.io" | ||
) | ||
|
||
// CloudStackIsolatedNetworkSpec defines the desired state of CloudStackIsolatedNetwork | ||
type CloudStackIsolatedNetworkSpec struct { | ||
// Name. | ||
//+optional | ||
Name string `json:"name,omitempty"` | ||
|
||
// ID. | ||
//+optional | ||
ID string `json:"id,omitempty"` | ||
|
||
// The kubernetes control plane endpoint. | ||
ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"` | ||
} | ||
|
||
// CloudStackIsolatedNetworkStatus defines the observed state of CloudStackIsolatedNetwork | ||
type CloudStackIsolatedNetworkStatus struct { | ||
// The CS public IP ID to use for the k8s endpoint. | ||
PublicIPID string `json:"publicIPID,omitempty"` | ||
|
||
// The ID of the lb rule used to assign VMs to the lb. | ||
LBRuleID string `json:"loadBalancerRuleID,omitempty"` | ||
|
||
// Ready indicates the readiness of this provider resource. | ||
Ready bool `json:"ready"` | ||
} | ||
|
||
func (n *CloudStackIsolatedNetwork) Network() *Network { | ||
return &Network{ | ||
Name: n.Spec.Name, | ||
Type: "IsolatedNetwork", | ||
ID: n.Spec.ID} | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
|
||
// CloudStackIsolatedNetwork is the Schema for the cloudstackisolatednetworks API | ||
type CloudStackIsolatedNetwork struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec CloudStackIsolatedNetworkSpec `json:"spec,omitempty"` | ||
Status CloudStackIsolatedNetworkStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// CloudStackIsolatedNetworkList contains a list of CloudStackIsolatedNetwork | ||
type CloudStackIsolatedNetworkList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []CloudStackIsolatedNetwork `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&CloudStackIsolatedNetwork{}, &CloudStackIsolatedNetworkList{}) | ||
} |
Oops, something went wrong.