@@ -17,29 +17,82 @@ limitations under the License.
17
17
package v1alpha4
18
18
19
19
import (
20
+ corev1 "k8s.io/api/core/v1"
20
21
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22
+ clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4"
21
23
)
22
24
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
-
26
25
// NestedControlPlaneSpec defines the desired state of NestedControlPlane
27
26
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"`
30
37
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"`
33
41
}
34
42
35
43
// NestedControlPlaneStatus defines the observed state of NestedControlPlane
36
44
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"`
39
88
}
40
89
41
90
// +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
43
96
44
97
// NestedControlPlane is the Schema for the nestedcontrolplanes API
45
98
type NestedControlPlane struct {
0 commit comments