4
4
package v1alpha1
5
5
6
6
import (
7
+ corev1 "k8s.io/api/core/v1"
7
8
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
8
9
)
9
10
11
+ // NutanixSpec defines the desired state of NutanixCluster.
10
12
type NutanixSpec struct {
11
- PrismCentralEndpoint * NutanixPrismCentralEndpointSpec `json:"prismCentralEndpoint,omitempty"`
12
- ControlPlaneEndpoint * NutanixControlPlaneEndpointSpec `json:"controlPlaneEndpoint,omitempty"`
13
- FailureDomains []NutanixFailureDomain `json:"failureDomains,omitempty"`
13
+ // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
14
+ // host can be either DNS name or ip address
15
+ ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"`
16
+
17
+ // Nutanix Prism Central endpoint configuration.
18
+ PrismCentralEndpoint NutanixPrismCentralEndpointSpec `json:"prismCentralEndpoint"`
19
+
20
+ // Configures failure domains information for the Nutanix platform.
21
+ // When set, the failure domains defined here may be used to spread Machines across
22
+ // prism element clusters to improve fault tolerance of the cluster.
23
+ FailureDomains []NutanixFailureDomain `json:"failureDomains"`
14
24
}
15
25
16
26
func (NutanixSpec ) VariableSchema () clusterv1.VariableSchema {
@@ -19,20 +29,33 @@ func (NutanixSpec) VariableSchema() clusterv1.VariableSchema {
19
29
Description : "Nutanix cluster configuration" ,
20
30
Type : "object" ,
21
31
Properties : map [string ]clusterv1.JSONSchemaProps {
32
+ "controlPlaneEndpoint" : ControlPlaneEndpointSpec {}.VariableSchema ().OpenAPIV3Schema ,
22
33
"prismCentralEndpoint" : NutanixPrismCentralEndpointSpec {}.VariableSchema ().OpenAPIV3Schema ,
23
- "controlPlaneEndpoint" : NutanixControlPlaneEndpointSpec {}.VariableSchema ().OpenAPIV3Schema ,
24
34
"failureDomains" : NutanixFailureDomains {}.VariableSchema ().OpenAPIV3Schema ,
25
35
},
26
36
},
27
37
}
28
38
}
29
39
30
40
type NutanixPrismCentralEndpointSpec struct {
31
- Host string `json:"host"`
32
- Port int32 `json:"port"`
33
- Insecure bool `json:"insecure"`
34
- AdditionalTrustBundle string `json:"additionalTrustBundle,omitempty"`
35
- CredentialSecret string `json:"credentialSecret"`
41
+ // address is the endpoint address (DNS name or IP address) of the Nutanix Prism Central
42
+ Address string `json:"address"`
43
+
44
+ // port is the port number to access the Nutanix Prism Central
45
+ Port int32 `json:"port"`
46
+
47
+ // use insecure connection to Prism Central endpoint
48
+ // +optional
49
+ Insecure bool `json:"insecure"`
50
+
51
+ // A reference to the ConfigMap containing a PEM encoded x509 cert for the RootCA that was used to create
52
+ // the certificate for a Prism Central that uses certificates that were issued by a non-publicly trusted RootCA.
53
+ // The trust bundle is added to the cert pool used to authenticate the TLS connection to the Prism Central.
54
+ // +optional
55
+ AdditionalTrustBundle * corev1.LocalObjectReference `json:"additionalTrustBundle,omitempty"`
56
+
57
+ // A reference to the Secret for credential information for the target Prism Central instance
58
+ Credentials corev1.LocalObjectReference `json:"credentials"`
36
59
}
37
60
38
61
func (NutanixPrismCentralEndpointSpec ) VariableSchema () clusterv1.VariableSchema {
@@ -41,51 +64,47 @@ func (NutanixPrismCentralEndpointSpec) VariableSchema() clusterv1.VariableSchema
41
64
Description : "Nutanix Prism Central endpoint configuration" ,
42
65
Type : "object" ,
43
66
Properties : map [string ]clusterv1.JSONSchemaProps {
44
- "host " : {
45
- Description : "host ip/fqdn for Prism Central Server " ,
67
+ "address " : {
68
+ Description : "the endpoint address (DNS name or IP address) of the Nutanix Prism Central" ,
46
69
Type : "string" ,
47
70
},
48
71
"port" : {
49
- Description : "port for Prism Central Server " ,
72
+ Description : "The port number to access the Nutanix Prism Central" ,
50
73
Type : "integer" ,
51
74
},
52
75
"insecure" : {
53
- Description : "Prism Central Certificate checking " ,
76
+ Description : "Use insecure connection to Prism Central endpoint " ,
54
77
Type : "boolean" ,
55
78
},
56
79
"additionalTrustBundle" : {
57
- Description : "Name of configMap with certificate trust bundle used for Prism Central connection" ,
58
- Type : "string" ,
80
+ Description : "A reference to the ConfigMap containing a PEM encoded x509 cert for the RootCA " +
81
+ "that was used to create the certificate for a Prism Central that uses certificates " +
82
+ "that were issued by a non-publicly trusted RootCA." +
83
+ "The trust bundle is added to the cert pool used to authenticate the TLS connection " +
84
+ "to the Prism Central." ,
85
+ Type : "object" ,
86
+ Properties : map [string ]clusterv1.JSONSchemaProps {
87
+ "name" : {
88
+ Description : "The name of the ConfigMap" ,
89
+ Type : "string" ,
90
+ },
91
+ },
92
+ Required : []string {"name" },
59
93
},
60
- "credentialSecret" : {
61
- Description : "Name of a Credential information secret for the target Prism instance" ,
62
- Type : "string" ,
63
- },
64
- },
65
- },
66
- }
67
- }
68
-
69
- type NutanixControlPlaneEndpointSpec struct {
70
- Host string `json:"host,omitempty"`
71
- Port int32 `json:"port,omitempty"`
72
- }
73
-
74
- func (NutanixControlPlaneEndpointSpec ) VariableSchema () clusterv1.VariableSchema {
75
- return clusterv1.VariableSchema {
76
- OpenAPIV3Schema : clusterv1.JSONSchemaProps {
77
- Description : "Nutanix control-plane endpoint configuration" ,
78
- Type : "object" ,
79
- Properties : map [string ]clusterv1.JSONSchemaProps {
80
- "host" : {
81
- Description : "host ip/fqdn for control plane API Server" ,
82
- Type : "string" ,
83
- },
84
- "port" : {
85
- Description : "port for control plane API Server" ,
86
- Type : "integer" ,
94
+ "credentials" : {
95
+ Description : "A reference to the Secret for credential information" +
96
+ "for the target Prism Central instance" ,
97
+ Type : "object" ,
98
+ Properties : map [string ]clusterv1.JSONSchemaProps {
99
+ "name" : {
100
+ Description : "The name of the Secret" ,
101
+ Type : "string" ,
102
+ },
103
+ },
104
+ Required : []string {"name" },
87
105
},
88
106
},
107
+ Required : []string {"address" , "port" , "credentials" },
89
108
},
90
109
}
91
110
}
@@ -104,27 +123,7 @@ func (NutanixFailureDomains) VariableSchema() clusterv1.VariableSchema {
104
123
}
105
124
}
106
125
107
- type NutanixFailureDomain struct {
108
- // name defines the unique name of a failure domain.
109
- // Name is required and must be at most 64 characters in length.
110
- // It must consist of only lower case alphanumeric characters and hyphens (-).
111
- // It must start and end with an alphanumeric character.
112
- // This value is arbitrary and is used to identify the failure domain within the platform.
113
- Name string `json:"name"`
114
-
115
- // cluster is to identify the cluster (the Prism Element under management of the Prism Central),
116
- // in which the Machine's VM will be created. The cluster identifier (uuid or name) can be obtained
117
- // from the Prism Central console or using the prism_central API.
118
- Cluster NutanixResourceIdentifier `json:"cluster"`
119
-
120
- // subnets holds a list of identifiers (one or more) of the cluster's network subnets
121
- // for the Machine's VM to connect to. The subnet identifiers (uuid or name) can be
122
- // obtained from the Prism Central console or using the prism_central API.
123
- Subnets []NutanixResourceIdentifier `json:"subnets"`
124
-
125
- // indicates if a failure domain is suited for control plane nodes
126
- ControlPlane bool `json:"controlPlane,omitempty"`
127
- }
126
+ type NutanixFailureDomain capxv1.NutanixFailureDomain
128
127
129
128
func (NutanixFailureDomain ) VariableSchema () clusterv1.VariableSchema {
130
129
return clusterv1.VariableSchema {
0 commit comments