Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Commit cdd8cb0

Browse files
Update NCP types (#38)
* adding updated ncp types Signed-off-by: Chris Hein <[email protected]> * adding generated files for ncp type Signed-off-by: Chris Hein <[email protected]>
1 parent 1d6af6a commit cdd8cb0

File tree

3 files changed

+309
-16
lines changed

3 files changed

+309
-16
lines changed

apis/controlplane/v1alpha4/nestedcontrolplane_types.go

+63-10
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,82 @@ limitations under the License.
1717
package v1alpha4
1818

1919
import (
20+
corev1 "k8s.io/api/core/v1"
2021
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4"
2123
)
2224

23-
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
24-
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
25-
2625
// NestedControlPlaneSpec defines the desired state of NestedControlPlane
2726
type NestedControlPlaneSpec struct {
28-
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
29-
// Important: Run "make" to regenerate code after modifying this file
27+
// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
28+
// +optional
29+
ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"`
30+
31+
// EtcdRef is the reference to the NestedEtcd
32+
EtcdRef *corev1.ObjectReference `json:"etcd,omitempty"`
33+
34+
// APIServerRef is the reference to the NestedAPIServer
35+
// +optional
36+
APIServerRef *corev1.ObjectReference `json:"apiserver,omitempty"`
3037

31-
// Foo is an example field of NestedControlPlane. Edit NestedControlPlane_types.go to remove/update
32-
Foo string `json:"foo,omitempty"`
38+
// ContollerManagerRef is the reference to the NestedControllerManager
39+
// +optional
40+
ControllerManagerRef *corev1.ObjectReference `json:"controllerManager,omitempty"`
3341
}
3442

3543
// NestedControlPlaneStatus defines the observed state of NestedControlPlane
3644
type NestedControlPlaneStatus struct {
37-
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
38-
// Important: Run "make" to regenerate code after modifying this file
45+
// Etcd stores the connection information from the downstream etcd
46+
// implementation if the NestedEtcd type isn't used this
47+
// allows other component controllers to fetch the endpoints.
48+
// +optional
49+
Etcd *NestedControlPlaneStatusEtcd `json:"etcd,omitempty"`
50+
51+
// APIServer stores the connection information from the control plane
52+
// this should contain anything shared between control plane components
53+
// +optional
54+
APIServer *NestedControlPlaneStatusAPIServer `json:"apiserver,omitempty"`
55+
56+
// Initialized denotes whether or not the control plane finished initializing.
57+
// +optional
58+
Initialized bool `json:"initialized"`
59+
60+
// Ready denotes that the NestedControlPlane API Server is ready to
61+
// receive requests
62+
// +kubebuilder:default=false
63+
Ready bool `json:"ready"`
64+
65+
// ErrorMessage indicates that there is a terminal problem reconciling the
66+
// state, and will be set to a descriptive error message.
67+
// +optional
68+
FailureMessage *string `json:"failureMessage,omitempty"`
69+
70+
// Conditions specifies the conditions for the managed control plane
71+
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
72+
}
73+
74+
// NestedControlPlaneStatusEtcd defines the status of the etcd component to
75+
// allow other component controllers to take over the deployment
76+
type NestedControlPlaneStatusEtcd struct {
77+
// Addresses defines how to address the etcd instance
78+
Addresses []NestedEtcdAddress `json:"addresses,omitempty"`
79+
}
80+
81+
// NestedControlPlaneStatusAPIServer defines the status of the APIServer
82+
// component, this allows the next set of component controllers to take over
83+
// the deployment
84+
type NestedControlPlaneStatusAPIServer struct {
85+
// ServiceCIDRs which is provided to kube-apiserver and kube-controller-manager
86+
// +optional
87+
ServiceCIDR string `json:"serviceCidr,omitempty"`
3988
}
4089

4190
// +kubebuilder:object:root=true
42-
// +kubebuilder:subresource:status
91+
//+kubebuilder:resource:scope=Namespaced,shortName=ncp
92+
//+kubebuilder:categories=capi,capn
93+
//+kubebuilder:printcolumn:name="Ready",type="boolean",JSONPath=".status.rady"
94+
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
95+
//+kubebuilder:subresource:status
4396

4497
// NestedControlPlane is the Schema for the nestedcontrolplanes API
4598
type NestedControlPlane struct {

apis/controlplane/v1alpha4/zz_generated.deepcopy.go

+77-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)