-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add support for CAPX #384
Closed
Closed
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
94451f1
[WIP] added nutanix support
deepakm-ntnx cc7f2b6
added yamls for crs and helmaddon
deepakm-ntnx 8b93532
added generated file after make release
deepakm-ntnx df849f5
added placeholders for nutanix related clusterConfig
deepakm-ntnx 1c3160e
fixed stale code
deepakm-ntnx 223aa07
fixed the stale code
deepakm-ntnx 39747e5
test fixes
deepakm-ntnx b9ab97a
updated licenses
deepakm-ntnx ddb879f
added first variable patch and tests (WIP)
deepakm-ntnx 803193c
patches
deepakm-ntnx 1138b9f
review comments fixes
deepakm-ntnx 358610b
patches
deepakm-ntnx 33d79c5
updated latest final yaml
deepakm-ntnx aed4b42
updated yaml with faultDomain
deepakm-ntnx a2c80fb
WIP added all the types as a placeholder to share across team members
deepakm-ntnx d5390bd
added cluster config variables
deepakm-ntnx 2113e27
reverted year update in copyright for existing files
deepakm-ntnx 72fb2e8
test fixes
deepakm-ntnx 324c075
added prism central endpoint mutation
deepakm-ntnx 3d5f6f0
updated prism central endpoint mutation
deepakm-ntnx 7fb8d15
added machine details mutation
deepakm-ntnx 14732dd
added nutanix into charts to install clusterclass
deepakm-ntnx b637285
need to add double $ sign in bases so that var remains in example yaml
deepakm-ntnx 28835b7
using a dev build yaml. todo revert url of the yaml
deepakm-ntnx 24653fa
now updated examples with latest state for completeness
deepakm-ntnx 47da896
make lint fixes
deepakm-ntnx ded0d20
now able to apply nutanix cluster with topology with cre validating it
deepakm-ntnx 0c9b408
removed temp file
deepakm-ntnx e415d46
now using clusterctl.yaml vars so that its easy to fill in values
deepakm-ntnx 4a9c7e0
updated paths to new branch due to stackked PR related changes
deepakm-ntnx c422e2f
fixed examples.sync
deepakm-ntnx 9c532c4
reorg of examples kustomize yamls
deepakm-ntnx 62e86e8
fixed the naming of all the objects which was getting overriden thru …
deepakm-ntnx a3b6a9c
now added subnet settings in cre
deepakm-ntnx 7688d3e
fixed NPE
deepakm-ntnx ec87ae3
Merge branch 'nutanix-cloud-native:main' into KRBN-8015
deepakm-ntnx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,162 @@ | ||
// Copyright 2024 D2iQ, Inc. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" | ||
) | ||
|
||
type NutanixSpec struct { | ||
PrismCentralEndpoint *NutanixPrismCentralEndpointSpec `json:"prismCentralEndpoint,omitempty"` | ||
ControlPlaneEndpoint *NutanixControlPlaneEndpointSpec `json:"controlPlaneEndpoint,omitempty"` | ||
FailureDomains []NutanixFailureDomain `json:"failureDomains,omitempty"` | ||
} | ||
|
||
func (NutanixSpec) VariableSchema() clusterv1.VariableSchema { | ||
return clusterv1.VariableSchema{ | ||
OpenAPIV3Schema: clusterv1.JSONSchemaProps{ | ||
Description: "Nutanix cluster configuration", | ||
Type: "object", | ||
Properties: map[string]clusterv1.JSONSchemaProps{ | ||
"prismCentralEndpoint": NutanixPrismCentralEndpointSpec{}.VariableSchema().OpenAPIV3Schema, | ||
"controlPlaneEndpoint": NutanixControlPlaneEndpointSpec{}.VariableSchema().OpenAPIV3Schema, | ||
"failureDomains": NutanixFailureDomains{}.VariableSchema().OpenAPIV3Schema, | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
type NutanixPrismCentralEndpointSpec struct { | ||
Host string `json:"host"` | ||
Port int32 `json:"port"` | ||
Insecure bool `json:"insecure"` | ||
AdditionalTrustBundle string `json:"additionalTrustBundle,omitempty"` | ||
CredentialSecret string `json:"credentialSecret"` | ||
} | ||
|
||
func (NutanixPrismCentralEndpointSpec) VariableSchema() clusterv1.VariableSchema { | ||
return clusterv1.VariableSchema{ | ||
OpenAPIV3Schema: clusterv1.JSONSchemaProps{ | ||
Description: "Nutanix Prism Central endpoint configuration", | ||
Type: "object", | ||
Properties: map[string]clusterv1.JSONSchemaProps{ | ||
"host": { | ||
Description: "host ip/fqdn for Prism Central Server", | ||
Type: "string", | ||
}, | ||
"port": { | ||
Description: "port for Prism Central Server", | ||
Type: "integer", | ||
}, | ||
"insecure": { | ||
Description: "Prism Central Certificate checking", | ||
Type: "boolean", | ||
}, | ||
"additionalTrustBundle": { | ||
Description: "Name of configMap with certificate trust bundle used for Prism Central connection", | ||
Type: "string", | ||
}, | ||
"credentialSecret": { | ||
Description: "Name of a Credential information secret for the target Prism instance", | ||
Type: "string", | ||
}, | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
type NutanixControlPlaneEndpointSpec struct { | ||
deepakm-ntnx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Host string `json:"host,omitempty"` | ||
Port int32 `json:"port,omitempty"` | ||
} | ||
|
||
func (NutanixControlPlaneEndpointSpec) VariableSchema() clusterv1.VariableSchema { | ||
return clusterv1.VariableSchema{ | ||
OpenAPIV3Schema: clusterv1.JSONSchemaProps{ | ||
Description: "Nutanix control-plane endpoint configuration", | ||
Type: "object", | ||
Properties: map[string]clusterv1.JSONSchemaProps{ | ||
"host": { | ||
Description: "host ip/fqdn for control plane API Server", | ||
Type: "string", | ||
}, | ||
"port": { | ||
Description: "port for control plane API Server", | ||
Type: "integer", | ||
}, | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
type NutanixFailureDomains []NutanixFailureDomain | ||
|
||
func (NutanixFailureDomains) VariableSchema() clusterv1.VariableSchema { | ||
resourceSchema := NutanixFailureDomain{}.VariableSchema().OpenAPIV3Schema | ||
|
||
return clusterv1.VariableSchema{ | ||
OpenAPIV3Schema: clusterv1.JSONSchemaProps{ | ||
Description: "Nutanix failure domains", | ||
Type: "array", | ||
Items: &resourceSchema, | ||
}, | ||
} | ||
} | ||
|
||
type NutanixFailureDomain struct { | ||
// name defines the unique name of a failure domain. | ||
// Name is required and must be at most 64 characters in length. | ||
// It must consist of only lower case alphanumeric characters and hyphens (-). | ||
// It must start and end with an alphanumeric character. | ||
// This value is arbitrary and is used to identify the failure domain within the platform. | ||
Name string `json:"name"` | ||
|
||
// cluster is to identify the cluster (the Prism Element under management of the Prism Central), | ||
// in which the Machine's VM will be created. The cluster identifier (uuid or name) can be obtained | ||
// from the Prism Central console or using the prism_central API. | ||
Cluster NutanixResourceIdentifier `json:"cluster"` | ||
|
||
// subnets holds a list of identifiers (one or more) of the cluster's network subnets | ||
// for the Machine's VM to connect to. The subnet identifiers (uuid or name) can be | ||
// obtained from the Prism Central console or using the prism_central API. | ||
Subnets []NutanixResourceIdentifier `json:"subnets"` | ||
|
||
// indicates if a failure domain is suited for control plane nodes | ||
ControlPlane bool `json:"controlPlane,omitempty"` | ||
} | ||
|
||
func (NutanixFailureDomain) VariableSchema() clusterv1.VariableSchema { | ||
return clusterv1.VariableSchema{ | ||
OpenAPIV3Schema: clusterv1.JSONSchemaProps{ | ||
Description: "Nutanix Failure Domain", | ||
Type: "object", | ||
Properties: map[string]clusterv1.JSONSchemaProps{ | ||
"name": { | ||
Description: "name of failure domain", | ||
Type: "string", | ||
}, | ||
"cluster": NutanixResourceIdentifier{}.VariableSchema().OpenAPIV3Schema, | ||
"subnets": NutanixResourceIdentifiers{}.VariableSchema().OpenAPIV3Schema, | ||
"controlPlane": { | ||
Description: "indicates if a failure domain is suited for control plane nodes", | ||
Type: "boolean", | ||
}, | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
type NutanixResourceIdentifiers []NutanixResourceIdentifier | ||
|
||
func (NutanixResourceIdentifiers) VariableSchema() clusterv1.VariableSchema { | ||
resourceSchema := NutanixResourceIdentifier{}.VariableSchema().OpenAPIV3Schema | ||
|
||
return clusterv1.VariableSchema{ | ||
OpenAPIV3Schema: clusterv1.JSONSchemaProps{ | ||
Description: "Nutanix resource identifier", | ||
Type: "array", | ||
Items: &resourceSchema, | ||
}, | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make the reviewing easier what do you think about opening a PR with just API changes for only the required input?