-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add methods to support CRUD operations on CSE Kubernetes clusters #645
Merged
Conversation
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
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
sahithi
reviewed
Feb 26, 2024
sahithi
reviewed
Feb 26, 2024
lvirbalas
approved these changes
Feb 27, 2024
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.
Huge! Looking forward to the Terraform part!
Didainius
reviewed
Feb 27, 2024
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Didainius
reviewed
Mar 7, 2024
Signed-off-by: abarreiro <abarreiro@vmware.com>
Didainius
approved these changes
Mar 8, 2024
Signed-off-by: abarreiro <abarreiro@vmware.com>
dataclouder
approved these changes
Mar 8, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Context
While the generic Runtime Defined Entity approach to create, read, update and delete Kubernetes clusters is completely valid and usable, it causes some challenges to the final users, as the process can be cumbersome at certain stages, and prone to errors.
The idea of this PR is to provide a set of abstractions that simplify the mentioned operations. These abstractions are accomplished by introducing several new public types and methods on these types.
Description
This PR adds some new types:
CseKubernetesCluster
to manage Container Service Extension Kubernetes clusters.CseClusterSettings
,CseControlPlaneSettings
,CseWorkerPoolSettings
,CseDefaultStorageClassSettings
to configure a Container Service Extension Kubernetes cluster.CseClusterEvent
to define an event insideCseKubernetesCluster
CseClusterUpdateInput
,CseControlPlaneUpdateInput
,CseWorkerPoolUpdateInput
to update an existing Container Service Extension Kubernetes cluster.This PR adds some new methods:
Org
type has two new methodsCseCreateKubernetesCluster
andCseCreateKubernetesClusterAsync
to create Kubernetes clusters in a VCD appliance with Container Service Extension installed.VCDClient
type has a new methodCseGetKubernetesClusterById
andOrg
has a new methodCseGetKubernetesClustersByName
, both used to retrieve a Container Service Extension Kubernetes cluster. The first one returns a unique cluster, and theOrg
one returns several clusters, as there can be multiple clusters with the same name.CseKubernetesCluster
has several methods:GetKubeconfig
to retrieve the kubeconfig of a provisioned Container ServiceExtension Kubernetes cluster
Refresh
to refresh the information and properties of an existing Container Service Extension Kubernetes cluster.UpdateWorkerPools
,AddWorkerPools
,UpdateControlPlane
,UpgradeCluster
,SetNodeHealthCheck
andSetAutoRepairOnErrors
. These are like "syntactic sugar" of the more generic/wideUpdate
method that can do several updates in one place.GetSupportedUpgrades
to retrieve all the valid TKGm OVAs that a given ContainerService Extension Kubernetes cluster can use to be upgraded
Delete
to delete a clusterFile layout
cse.go
contains the main public CRUD operations described above. The goal of this file is to be concise, to have a clear documentation and provide an instant view of the available operations to the consumers of the SDK.cse_util.go
contains private methods used by the CRUD operations, that may be too complex or reused several times. These are all private and users should not worry about them.cse_internal.go
contains private methods that transform the "public facing types" (described above) to "internal private ones", and manage/consume Go templates with them.cse_yaml.go
contains private methods that manipulate the CAPI YAML that describes a cluster. Essentially, they are used on updates, as this operation is the one that manipulates YAML.cse_type.go
contains all the types used by all the CSE methods, public and private ones.Extra changes
VCDClient
, to have also a friendly private version that can take any genericClient
object.Testing
Testing CSE methods
To run the CSE tests, one must set the
TEST_VCD_CSE
environment variable to any non-empty value. The reason is that CSE requires a very unique environment, and the tests take a long time to be executed.The tests also require a special
govcd_test_config.yaml
file that is almost empty and contains the newcse
section:The one can run:
Testing other minor changes
To test other minor changes, like refactors and RDE minor improvements, the usual procedure can be used.