├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yaml └── workflows │ └── go-coverage.yml ├── .gitignore ├── .golangci.yml ├── ATTRIBUTION.txt ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── Makefile ├── OWNERS ├── PROJECT ├── README.md ├── SECURITY_CONTACTS ├── api ├── v1beta1 │ ├── cloudstackaffinitygroup_conversion.go │ ├── cloudstackaffinitygroup_types.go │ ├── cloudstackcluster_conversion.go │ ├── cloudstackcluster_types.go │ ├── cloudstackisolatednetwork_conversion.go │ ├── cloudstackisolatednetwork_types.go │ ├── cloudstackmachine_conversion.go │ ├── cloudstackmachine_types.go │ ├── cloudstackmachine_types_test.go │ ├── cloudstackmachinestatechecker_conversion.go │ ├── cloudstackmachinestatechecker_types.go │ ├── cloudstackmachinetemplate_conversion.go │ ├── cloudstackmachinetemplate_types.go │ ├── cloudstackzone_types.go │ ├── conversion.go │ ├── conversion_test.go │ ├── doc.go │ ├── groupversion_info.go │ ├── zz_generated.conversion.go │ └── zz_generated.deepcopy.go ├── v1beta2 │ ├── cloudstackaffinitygroup_conversion.go │ ├── cloudstackaffinitygroup_types.go │ ├── cloudstackcluster_conversion.go │ ├── cloudstackcluster_types.go │ ├── cloudstackfailuredomain_conversion.go │ ├── cloudstackfailuredomain_types.go │ ├── cloudstackisolatednetwork_conversion.go │ ├── cloudstackisolatednetwork_types.go │ ├── cloudstackmachine_conversion.go │ ├── cloudstackmachine_types.go │ ├── cloudstackmachine_types_test.go │ ├── cloudstackmachinestatechecker_conversion.go │ ├── cloudstackmachinestatechecker_types.go │ ├── cloudstackmachinetemplate_conversion.go │ ├── cloudstackmachinetemplate_types.go │ ├── conversion.go │ ├── doc.go │ ├── groupversion_info.go │ ├── zz_generated.conversion.go │ └── zz_generated.deepcopy.go └── v1beta3 │ ├── cloudstackaffinitygroup_types.go │ ├── cloudstackcluster_types.go │ ├── cloudstackcluster_webhook.go │ ├── cloudstackcluster_webhook_test.go │ ├── cloudstackfailuredomain_types.go │ ├── cloudstackisolatednetwork_types.go │ ├── cloudstackmachine_types.go │ ├── cloudstackmachine_webhook.go │ ├── cloudstackmachine_webhook_test.go │ ├── cloudstackmachinestatechecker_types.go │ ├── cloudstackmachinetemplate_types.go │ ├── cloudstackmachinetemplate_webhook.go │ ├── cloudstackmachinetemplate_webhook_test.go │ ├── conversion.go │ ├── doc.go │ ├── groupversion_info.go │ ├── webhook_suite_test.go │ └── zz_generated.deepcopy.go ├── cloudbuild.yaml ├── common.mk ├── config ├── certmanager │ ├── certificate.yaml │ ├── kustomization.yaml │ └── kustomizeconfig.yaml ├── crd │ ├── bases │ │ ├── fakes.infrastructure.cluster.x-k8s.io_cloudstackmachineowners.yaml │ │ ├── infrastructure.cluster.x-k8s.io_cloudstackaffinitygroups.yaml │ │ ├── infrastructure.cluster.x-k8s.io_cloudstackclusters.yaml │ │ ├── infrastructure.cluster.x-k8s.io_cloudstackfailuredomains.yaml │ │ ├── infrastructure.cluster.x-k8s.io_cloudstackisolatednetworks.yaml │ │ ├── infrastructure.cluster.x-k8s.io_cloudstackmachines.yaml │ │ ├── infrastructure.cluster.x-k8s.io_cloudstackmachinestatecheckers.yaml │ │ ├── infrastructure.cluster.x-k8s.io_cloudstackmachinetemplates.yaml │ │ └── infrastructure.cluster.x-k8s.io_cloudstackzones.yaml │ ├── kustomization.yaml │ ├── kustomizeconfig.yaml │ └── patches │ │ ├── cainjection_in_cloudstackaffinitygroups.yaml │ │ ├── cainjection_in_cloudstackclusters.yaml │ │ ├── cainjection_in_cloudstackfailuredomains.yaml │ │ ├── cainjection_in_cloudstackisolatednetworks.yaml │ │ ├── cainjection_in_cloudstackmachines.yaml │ │ ├── cainjection_in_cloudstackmachinestatecheckers.yaml │ │ ├── cainjection_in_cloudstackmachinetemplates.yaml │ │ ├── cainjection_in_cloudstackzones.yaml │ │ ├── webhook_in_cloudstackaffinitygroups.yaml │ │ ├── webhook_in_cloudstackclusters.yaml │ │ ├── webhook_in_cloudstackfailuredomains.yaml │ │ ├── webhook_in_cloudstackisolatednetworks.yaml │ │ ├── webhook_in_cloudstackmachines.yaml │ │ ├── webhook_in_cloudstackmachinestatecheckers.yaml │ │ ├── webhook_in_cloudstackmachinetemplates.yaml │ │ └── webhook_in_cloudstackzones.yaml ├── default-with-metrics-port │ ├── auth_proxy_client_clusterrole.yaml │ ├── auth_proxy_role.yaml │ ├── auth_proxy_role_binding.yaml │ ├── auth_proxy_service.yaml │ ├── kustomization.yaml │ └── manager_auth_proxy_patch.yaml ├── default │ ├── kustomization.yaml │ ├── kustomizeconfig.yaml │ ├── manager_config_patch.yaml │ ├── manager_image_patch.yaml │ ├── manager_webhook_patch.yaml │ ├── namespace.yaml │ └── webhookcainjection_patch.yaml ├── develop │ ├── insecure_manager.yaml │ ├── kustomization.yaml │ └── manager_open_debug_port.yaml ├── insecure_manager.yaml ├── kustomization.yaml ├── manager │ ├── controller_manager_config.yaml │ ├── kustomization.yaml │ └── manager.yaml ├── rbac │ ├── auth_proxy_client_clusterrole.yaml │ ├── cloudstackaffinitygroup_editor_role.yaml │ ├── cloudstackaffinitygroup_viewer_role.yaml │ ├── cloudstackcluster_editor_role.yaml │ ├── cloudstackcluster_viewer_role.yaml │ ├── cloudstackfailuredomain_editor_role.yaml │ ├── cloudstackfailuredomain_viewer_role.yaml │ ├── cloudstackisolatednetwork_editor_role.yaml │ ├── cloudstackisolatednetwork_viewer_role.yaml │ ├── cloudstackmachine_editor_role.yaml │ ├── cloudstackmachine_viewer_role.yaml │ ├── cloudstackmachinestatechecker_editor_role.yaml │ ├── cloudstackmachinestatechecker_viewer_role.yaml │ ├── cloudstackmachinetemplate_editor_role.yaml │ ├── cloudstackmachinetemplate_viewer_role.yaml │ ├── cloudstackzone_editor_role.yaml │ ├── cloudstackzone_viewer_role.yaml │ ├── kustomization.yaml │ ├── leader_election_role.yaml │ ├── leader_election_role_binding.yaml │ ├── role.yaml │ ├── role_binding.yaml │ └── service_account.yaml ├── samples │ ├── infrastructure_v1beta1_cloudstackaffinitygroup.yaml │ ├── infrastructure_v1beta1_cloudstackfailuredomain.yaml │ ├── infrastructure_v1beta1_cloudstackisolatednetwork.yaml │ ├── infrastructure_v1beta1_cloudstackmachinestatechecker.yaml │ ├── infrastructure_v1beta1_cloudstackzone.yaml │ └── infrastructure_v1beta2_cloudstackfailuredomain.yaml └── webhook │ ├── kustomization.yaml │ ├── kustomizeconfig.yaml │ ├── manifests.yaml │ └── service.yaml ├── controllers ├── cks_cluster_controller.go ├── cks_cluster_controller_test.go ├── cks_machine_controller.go ├── cks_machine_controller_test.go ├── cloudstackaffinitygroup_controller.go ├── cloudstackaffinitygroup_controller_test.go ├── cloudstackcluster_controller.go ├── cloudstackcluster_controller_test.go ├── cloudstackfailuredomain_controller.go ├── cloudstackfailuredomain_controller_test.go ├── cloudstackisolatednetwork_controller.go ├── cloudstackisolatednetwork_controller_test.go ├── cloudstackmachine_controller.go ├── cloudstackmachine_controller_test.go ├── cloudstackmachinestatechecker_controller.go ├── controllers_suite_test.go └── utils │ ├── affinity_group.go │ ├── base_reconciler.go │ ├── base_reconciler_test.go │ ├── constants.go │ ├── failuredomains.go │ ├── isolated_network.go │ ├── utils.go │ └── utils_suite_test.go ├── docs └── book │ ├── .gitignore │ ├── Makefile │ ├── book.toml │ ├── src │ ├── SUMMARY.md │ ├── clustercloudstack │ │ └── configuration.md │ ├── development │ │ ├── building.md │ │ ├── common.md │ │ ├── e2e.md │ │ ├── index.md │ │ ├── releasing.md │ │ └── tilt.md │ ├── getting-started.md │ ├── images │ │ ├── capc.png │ │ ├── ssh-step-1-public-ip-vpc.png │ │ ├── ssh-step-1-public-ip.png │ │ ├── ssh-step-2-firewall.png │ │ ├── ssh-step-3-firewall.png │ │ ├── ssh-step-4-portforwarding.png │ │ ├── ssh-step-5-portforwarding.png │ │ └── ssh-step-6-portforwarding.png │ ├── introduction.md │ └── topics │ │ ├── cloudstack-permissions.md │ │ ├── custom-images.md │ │ ├── index.md │ │ ├── mover.md │ │ ├── ssh-access.md │ │ ├── troubleshooting.md │ │ └── unstacked-etcd.md │ └── theme │ ├── css │ └── general.css │ ├── favicon.png │ └── head.hbs ├── go.mod ├── go.sum ├── hack ├── add_addresses.sh ├── boilerplate.go.txt ├── cleanup-affinity-groups.sh ├── debugging │ ├── README.md │ ├── debugWebhookServiceTemplate.yaml │ └── prepForDebugging.sh ├── ensure-cloud-config-yaml.sh ├── ensure-kind.sh ├── nginx.conf ├── setup_for_dev.sh ├── testing_ginkgo_recover_statements.sh ├── tilt-settings.json ├── tools │ ├── Makefile │ ├── go.mod │ ├── go.sum │ └── tools.go └── update_route_53.sh ├── main.go ├── metadata.yaml ├── netlify.toml ├── pkg ├── cloud │ ├── affinity_groups.go │ ├── affinity_groups_test.go │ ├── cks_cluster.go │ ├── client.go │ ├── client_test.go │ ├── cloud_suite_test.go │ ├── helpers.go │ ├── helpers_test.go │ ├── instance.go │ ├── instance_test.go │ ├── isolated_network.go │ ├── isolated_network_test.go │ ├── network.go │ ├── network_test.go │ ├── tags.go │ ├── tags_test.go │ ├── user_credentials.go │ ├── user_credentials_test.go │ ├── vpc.go │ ├── vpc_test.go │ ├── zone.go │ └── zone_test.go ├── metrics │ └── metrics.go ├── mocks │ └── .keep └── webhookutil │ └── webhook_validators.go ├── releases ├── v0.1.0 │ ├── ATTRIBUTION.txt │ ├── EVALUATION_DEPLOYMENT.md │ ├── README_INTERNAL_ONLY │ ├── RELEASE_NOTES.md │ ├── cluster-api.zip │ ├── security_findings.csv │ └── sha1sums.txt ├── v0.2.0 │ ├── ATTRIBUTION.txt │ ├── EVALUATION_DEPLOYMENT.md │ ├── RELEASE_NOTES.md │ ├── cluster-api.zip │ ├── security_findings.csv │ └── sha1sums.txt ├── v0.2.1 │ ├── ATTRIBUTION.txt │ ├── EVALUATION_DEPLOYMENT.md │ ├── RELEASE_NOTES.md │ ├── cluster-api.zip │ ├── security_findings.csv │ ├── sha1sums.txt │ └── shasum.txt ├── v0.3.0 │ ├── EVALUATION_DEPLOYMENT.md │ ├── RELEASE_NOTES.md │ ├── clusterApi.zip │ ├── security_findings.csv │ └── sha1sum.txt ├── v0.4.0 │ ├── EVALUATION_DEPLOYMENT.md │ ├── RELEASE_NOTES.md │ ├── clusterApi.zip │ ├── security_findings.csv │ └── sha1sum.txt ├── v0.4.1 │ ├── EVALUATION_DEPLOYMENT.md │ ├── RELEASE_NOTES.md │ ├── clusterApi.zip │ ├── security_findings.csv │ └── sha1sum.txt ├── v0.4.2 │ ├── EVALUATION_DEPLOYMENT.md │ ├── RELEASE_NOTES.md │ ├── clusterApi.zip │ ├── security_findings.txt │ └── shasum.txt ├── v0.4.3 │ ├── EVALUATION_DEPLOYMENT.md │ ├── RELEASE_NOTES.md │ ├── clusterApi.zip │ ├── security_findings.csv │ └── sha1sum.txt ├── v0.4.4 │ ├── EVALUATION_DEPLOYMENT.md │ ├── RELEASE_NOTES.md │ ├── clusterApi.zip │ ├── security_findings.csv │ └── sha1sum.txt └── v0.4.8 │ ├── RELEASE_NOTES.md │ └── security_findings.csv ├── templates ├── cluster-template-managed-ssh.yaml ├── cluster-template-ssh-material.yaml ├── cluster-template-with-disk-offering.yaml ├── cluster-template-with-existing-vpc-network.yaml ├── cluster-template-with-kube-vip.yaml ├── cluster-template.yaml ├── controlPlaneMachineHealthCheck.yaml └── workerMachineHealthCheck.yaml ├── test ├── dummies │ ├── v1beta1 │ │ └── vars.go │ ├── v1beta2 │ │ └── vars.go │ └── v1beta3 │ │ └── vars.go ├── e2e │ ├── .gitignore │ ├── README.md │ ├── affinity_group.go │ ├── affinity_group_test.go │ ├── common.go │ ├── config │ │ └── cloudstack.yaml │ ├── custom_assertions.go │ ├── custom_disk_offering.go │ ├── custom_disk_offering_test.go │ ├── data │ │ ├── ci-artifacts-platform-kustomization.yaml │ │ ├── cni │ │ │ └── kindnet.yaml │ │ ├── fixture │ │ │ ├── expected-webpage.html │ │ │ └── sample-application.yaml │ │ ├── infrastructure-cloudstack │ │ │ ├── v1beta1 │ │ │ │ ├── bases │ │ │ │ │ ├── cluster-with-kcp.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-affinity-group-anti │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-affinity-group-pro │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-custom-disk-offering │ │ │ │ │ ├── cluster-with-custom-disk-offering.yaml │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-disk-offering │ │ │ │ │ ├── cluster-with-disk-offering.yaml │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-insufficient-compute-resources-for-upgrade │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── upgrade.yaml │ │ │ │ ├── cluster-template-insufficient-compute-resources │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-invalid-account │ │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-invalid-cp-offering │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-invalid-disk-offering-size-for-customized │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-invalid-disk-offering-size-for-non-customized │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-invalid-disk-offering │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-invalid-domain │ │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-invalid-template │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-invalid-zone │ │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-machine-remediation │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ ├── md.yaml │ │ │ │ │ └── mhc.yaml │ │ │ │ ├── cluster-template-node-drain │ │ │ │ │ ├── cluster-with-kcp.yaml │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-resource-cleanup │ │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-second-cluster │ │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-shared-network-kubevip │ │ │ │ │ ├── cluster-with-shared-network-and-kubevip.yaml │ │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-subdomain │ │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ └── cluster-template │ │ │ │ │ └── kustomization.yaml │ │ │ ├── v1beta2 │ │ │ │ ├── bases │ │ │ │ │ ├── cluster-with-kcp.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-affinity-group-anti │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-affinity-group-pro │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-custom-disk-offering │ │ │ │ │ ├── cluster-with-custom-disk-offering.yaml │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-disk-offering │ │ │ │ │ ├── cluster-with-disk-offering.yaml │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-insufficient-compute-resources-for-upgrade │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── upgrade.yaml │ │ │ │ ├── cluster-template-insufficient-compute-resources │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-invalid-account │ │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-invalid-cp-offering │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-invalid-disk-offering-size-for-customized │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-invalid-disk-offering-size-for-non-customized │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-invalid-disk-offering │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-invalid-domain │ │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-invalid-ip │ │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-invalid-template │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-invalid-zone │ │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-kubernetes-version-upgrade-after │ │ │ │ │ ├── cluster.yaml │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ ├── upgrade-cp.yaml │ │ │ │ │ └── upgrade-md.yaml │ │ │ │ ├── cluster-template-kubernetes-version-upgrade-before │ │ │ │ │ ├── before.yaml │ │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-machine-remediation │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ ├── md.yaml │ │ │ │ │ └── mhc.yaml │ │ │ │ ├── cluster-template-node-drain │ │ │ │ │ ├── cluster-with-kcp.yaml │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-resource-cleanup │ │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-second-cluster │ │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-shared-network-kubevip │ │ │ │ │ ├── cluster-with-shared-network-and-kubevip.yaml │ │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-subdomain │ │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── md.yaml │ │ │ │ └── cluster-template │ │ │ │ │ └── kustomization.yaml │ │ │ └── v1beta3 │ │ │ │ ├── bases │ │ │ │ ├── cluster-with-kcp.yaml │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-affinity-group-anti │ │ │ │ ├── kustomization.yaml │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-affinity-group-pro │ │ │ │ ├── kustomization.yaml │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-custom-disk-offering │ │ │ │ ├── cluster-with-custom-disk-offering.yaml │ │ │ │ ├── kustomization.yaml │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-custom-vpc-offering │ │ │ │ ├── cluster-with-custom-vpc-offering.yaml │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-disk-offering │ │ │ │ ├── cluster-with-disk-offering.yaml │ │ │ │ ├── kustomization.yaml │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-insufficient-compute-resources-for-upgrade │ │ │ │ ├── kustomization.yaml │ │ │ │ └── upgrade.yaml │ │ │ │ ├── cluster-template-insufficient-compute-resources │ │ │ │ ├── kustomization.yaml │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-invalid-account │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-invalid-cp-offering │ │ │ │ ├── kustomization.yaml │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-invalid-disk-offering-size-for-customized │ │ │ │ ├── kustomization.yaml │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-invalid-disk-offering-size-for-non-customized │ │ │ │ ├── kustomization.yaml │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-invalid-disk-offering │ │ │ │ ├── kustomization.yaml │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-invalid-domain │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-invalid-ip │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-invalid-template │ │ │ │ ├── kustomization.yaml │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-invalid-zone │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-k8s-cks │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-kubernetes-version-upgrade-after │ │ │ │ ├── cluster.yaml │ │ │ │ ├── kustomization.yaml │ │ │ │ ├── upgrade-cp.yaml │ │ │ │ └── upgrade-md.yaml │ │ │ │ ├── cluster-template-kubernetes-version-upgrade-before │ │ │ │ ├── before.yaml │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-machine-remediation │ │ │ │ ├── kustomization.yaml │ │ │ │ ├── md.yaml │ │ │ │ └── mhc.yaml │ │ │ │ ├── cluster-template-network-with-custom-offering │ │ │ │ ├── cluster-with-network-with-custom-offering.yaml │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-node-drain │ │ │ │ ├── cluster-with-kcp.yaml │ │ │ │ ├── kustomization.yaml │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-project │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ ├── kustomization.yaml │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-resource-cleanup │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-second-cluster │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-shared-network-kubevip │ │ │ │ ├── cluster-with-shared-network-and-kubevip.yaml │ │ │ │ └── kustomization.yaml │ │ │ │ ├── cluster-template-subdomain │ │ │ │ ├── cloudstack-cluster.yaml │ │ │ │ ├── kustomization.yaml │ │ │ │ └── md.yaml │ │ │ │ ├── cluster-template-vpc-network │ │ │ │ ├── cluster-with-vpc-network.yaml │ │ │ │ └── kustomization.yaml │ │ │ │ └── cluster-template │ │ │ │ └── kustomization.yaml │ │ ├── kubetest │ │ │ ├── conformance-fast.yaml │ │ │ └── conformance.yaml │ │ └── shared │ │ │ ├── v1beta1 │ │ │ └── metadata.yaml │ │ │ └── v1beta1_provider │ │ │ └── metadata.yaml │ ├── deploy_app.go │ ├── deploy_app_test.go │ ├── deploy_app_toxi.go │ ├── deploy_app_toxi_test.go │ ├── disk_offering.go │ ├── disk_offering_test.go │ ├── doc.go │ ├── e2e_suite_test.go │ ├── go.mod │ ├── go.sum │ ├── helpers │ │ └── utilities.go │ ├── horizontal_scale.go │ ├── horizontal_scale_test.go │ ├── invalid_resource.go │ ├── invalid_resource_test.go │ ├── k8s_conformance.go │ ├── k8s_conformance_test.go │ ├── kubeconfig_helper │ │ ├── data │ │ │ ├── README │ │ │ └── kubeconfig │ │ ├── kubeconfig.go │ │ ├── kubeconfig_test.go │ │ └── suite_test.go │ ├── kubernetes_cks_cluster.go │ ├── kubernetes_cks_cluster_test.go │ ├── kubernetes_version_upgrade.go │ ├── kubernetes_version_upgrade_test.go │ ├── machine_remediation.go │ ├── machine_remediation_test.go │ ├── md_rollout.go │ ├── md_rollout_test.go │ ├── network_interruption_toxi.go │ ├── network_interruption_toxi_test.go │ ├── network_with_custom_offering.go │ ├── network_with_custom_offering_test.go │ ├── node_drain_timeout.go │ ├── node_drain_timeout_test.go │ ├── project.go │ ├── project_test.go │ ├── resource_cleanup.go │ ├── resource_cleanup_test.go │ ├── shared_network_kubevip.go │ ├── shared_network_kubevip_test.go │ ├── subdomain.go │ ├── subdomain_test.go │ ├── toxiproxy │ │ └── toxiProxy.go │ ├── two_clusters.go │ ├── two_clusters_test.go │ ├── vpc_network.go │ └── vpc_network_test.go ├── fakes │ ├── CloudStackMachineOwner_types.go │ ├── fakes.infrastructure.cluster.x-k8s.io_cloudstackmachineowners.yaml │ ├── groupversion_info.go │ └── zz_generated.deepcopy.go ├── fixtures │ └── cloud-config-files │ │ ├── cloud-config-good │ │ └── cloud-config-no-global └── helpers │ ├── client.go │ ├── suite_test.go │ ├── user.go │ └── user_test.go ├── tilt-provider.json └── versions.mk /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Tell us about a problem you are experiencing 4 | 5 | --- 6 | 7 | /kind bug 8 | 9 | **What steps did you take and what happened:** 10 | [A clear and concise description of what the bug is.] 11 | 12 | 13 | **What did you expect to happen:** 14 | 15 | 16 | **Anything else you would like to add:** 17 | [Miscellaneous information that will assist in solving the issue.] 18 | 19 | 20 | **Environment:** 21 | 22 | - Cluster-api-provider-cloudstack version: 23 | - Kubernetes version: (use `kubectl version`): 24 | - OS (e.g. from `/etc/os-release`): 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature enhancement request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | /kind feature 8 | 9 | **Describe the solution you'd like** 10 | [A clear and concise description of what you want to happen.] 11 | 12 | 13 | **Anything else you would like to add:** 14 | [Miscellaneous information that will assist in solving the issue.] 15 | 16 | 17 | **Environment:** 18 | 19 | - Cluster-api-provider-cloudstack version: 20 | - Kubernetes version: (use `kubectl version`): 21 | - OS (e.g. from `/etc/os-release`): 22 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | *Issue #, if available:* 2 | 3 | *Description of changes:* 4 | 5 | *Testing performed:* 6 | 7 | 8 | By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. 9 | 10 | -------------------------------------------------------------------------------- /.github/workflows/go-coverage.yml: -------------------------------------------------------------------------------- 1 | name: Test coverage 2 | on: 3 | push: 4 | tags: 5 | - v* 6 | branches: 7 | - main 8 | pull_request: 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v4 15 | - uses: actions/setup-go@v5 16 | with: 17 | go-version: 1.23 18 | - name: Run go test with coverage 19 | run: COVER_PROFILE=coverage.txt make test 20 | - name: Codecov upload 21 | uses: codecov/codecov-action@v5.4.0 22 | with: 23 | files: ./cover.out 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | bin 8 | testbin/* 9 | 10 | nginx.conf 11 | nginx.conf.bak 12 | 13 | pkg/mocks/* 14 | pkg/cloud/gomock_reflect_* 15 | !pkg/mocks/.keep 16 | 17 | # Various build/test artifacts. 18 | .tiltbuild 19 | *log 20 | *flag.mk 21 | out 22 | .build 23 | .DS_Store 24 | _artifacts 25 | 26 | # CAPI used with Tilt. 27 | cluster-api 28 | 29 | # Ignore output of Makefile sed operations created when generating manifests. 30 | config/default/manager_image_patch_edited.yaml 31 | 32 | # Ignore output of e2e kustomization of templates. 33 | test/e2e/data/infrastructure-cloudstack/v1beta*/*yaml 34 | 35 | # Test binary, build with `go test -c` 36 | *.test 37 | 38 | # Output of the go coverage tool, specifically when used with LiteIDE 39 | *.out 40 | 41 | # ACS Credentials file. 42 | cloud-config 43 | cloud-config.yaml 44 | 45 | # Editor and IDE paraphernalia 46 | .idea 47 | *.swp 48 | *.swo 49 | *~ 50 | examples/* 51 | hack/tools/share/* 52 | -------------------------------------------------------------------------------- /.golangci.yml: -------------------------------------------------------------------------------- 1 | linters-settings: 2 | goheader: 3 | values: 4 | const: 5 | AUTHOR: The Kubernetes Authors 6 | regexp: 7 | YR: '\d\d\d\d' 8 | template: |- 9 | Copyright {{ YR }} {{ AUTHOR }}. 10 | 11 | Licensed under the Apache License, Version 2.0 (the "License"); 12 | you may not use this file except in compliance with the License. 13 | You may obtain a copy of the License at 14 | 15 | http://www.apache.org/licenses/LICENSE-2.0 16 | 17 | Unless required by applicable law or agreed to in writing, software 18 | distributed under the License is distributed on an "AS IS" BASIS, 19 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | See the License for the specific language governing permissions and 21 | limitations under the License. 22 | gocyclo: 23 | min-complexity: 15 24 | 25 | linters: 26 | enable: 27 | - gosec 28 | - goheader 29 | - revive 30 | - gocyclo 31 | - misspell 32 | 33 | run: 34 | issues-exit-code: 1 35 | tests: false 36 | 37 | issues: 38 | # Excluding configuration per-path, per-linter, per-text and per-source 39 | exclude-rules: 40 | # Exclude some linters from running on tests files. 41 | - path: _test\.go 42 | linters: 43 | - gosec 44 | exclude-dirs: 45 | - pkg/mocks 46 | - test 47 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Kubernetes Community Code of Conduct 2 | 3 | Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) 4 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Use distroless as minimal base image to package the manager binary 2 | # Refer to https://github.com/GoogleContainerTools/distroless for more details 3 | FROM gcr.io/distroless/static:nonroot 4 | WORKDIR / 5 | COPY bin/manager-linux-amd64 ./manager 6 | USER 65532:65532 7 | 8 | ENTRYPOINT ["/manager"] 9 | -------------------------------------------------------------------------------- /OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - rohityadavcloud 3 | - davidjumani 4 | - jweite-amazon 5 | - dims 6 | - g-gaston 7 | - chrisdoherty4 8 | - weizhouapache 9 | - vishesh92 10 | -------------------------------------------------------------------------------- /SECURITY_CONTACTS: -------------------------------------------------------------------------------- 1 | # Defined below are the security contacts for this repo. 2 | # 3 | # They are the contact point for the Product Security Committee to reach out 4 | # to for triaging and handling of incoming issues. 5 | # 6 | # The below names agree to abide by the 7 | # [Embargo Policy](https://git.k8s.io/security/private-distributors-list.md#embargo-policy) 8 | # and will be removed and replaced if they violate that agreement. 9 | # 10 | # DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE 11 | # INSTRUCTIONS AT https://kubernetes.io/security/ 12 | 13 | pmotyka 14 | jweite-amazon -------------------------------------------------------------------------------- /api/v1beta1/cloudstackcluster_conversion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2023 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package v1beta1 18 | 19 | import ( 20 | "sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta3" 21 | "sigs.k8s.io/controller-runtime/pkg/conversion" 22 | ) 23 | 24 | func (src *CloudStackCluster) ConvertTo(dstRaw conversion.Hub) error { // nolint 25 | dst := dstRaw.(*v1beta3.CloudStackCluster) 26 | return Convert_v1beta1_CloudStackCluster_To_v1beta3_CloudStackCluster(src, dst, nil) 27 | } 28 | 29 | func (dst *CloudStackCluster) ConvertFrom(srcRaw conversion.Hub) error { // nolint 30 | src := srcRaw.(*v1beta3.CloudStackCluster) 31 | return Convert_v1beta3_CloudStackCluster_To_v1beta1_CloudStackCluster(src, dst, nil) 32 | } 33 | -------------------------------------------------------------------------------- /api/v1beta1/cloudstackmachinestatechecker_conversion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package v1beta1 18 | 19 | import ( 20 | "sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta3" 21 | "sigs.k8s.io/controller-runtime/pkg/conversion" 22 | ) 23 | 24 | func (src *CloudStackMachineStateChecker) ConvertTo(dstRaw conversion.Hub) error { // nolint 25 | dst := dstRaw.(*v1beta3.CloudStackMachineStateChecker) 26 | return Convert_v1beta1_CloudStackMachineStateChecker_To_v1beta3_CloudStackMachineStateChecker(src, dst, nil) 27 | } 28 | 29 | func (dst *CloudStackMachineStateChecker) ConvertFrom(srcRaw conversion.Hub) error { // nolint 30 | src := srcRaw.(*v1beta3.CloudStackMachineStateChecker) 31 | return Convert_v1beta3_CloudStackMachineStateChecker_To_v1beta1_CloudStackMachineStateChecker(src, dst, nil) 32 | } 33 | -------------------------------------------------------------------------------- /api/v1beta1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Package v1beta1 contains API Schema definitions for the infrastructure v1beta1 API group 18 | // +kubebuilder:object:generate=true 19 | // +groupName=infrastructure.cluster.x-k8s.io 20 | // +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta3 21 | package v1beta1 22 | -------------------------------------------------------------------------------- /api/v1beta2/cloudstackaffinitygroup_conversion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package v1beta2 18 | 19 | import ( 20 | "sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta3" 21 | "sigs.k8s.io/controller-runtime/pkg/conversion" 22 | ) 23 | 24 | func (src *CloudStackAffinityGroup) ConvertTo(dstRaw conversion.Hub) error { // nolint 25 | dst := dstRaw.(*v1beta3.CloudStackAffinityGroup) 26 | return Convert_v1beta2_CloudStackAffinityGroup_To_v1beta3_CloudStackAffinityGroup(src, dst, nil) 27 | } 28 | 29 | func (dst *CloudStackAffinityGroup) ConvertFrom(srcRaw conversion.Hub) error { // nolint 30 | src := srcRaw.(*v1beta3.CloudStackAffinityGroup) 31 | return Convert_v1beta3_CloudStackAffinityGroup_To_v1beta2_CloudStackAffinityGroup(src, dst, nil) 32 | } 33 | -------------------------------------------------------------------------------- /api/v1beta2/cloudstackisolatednetwork_conversion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2023 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package v1beta2 18 | 19 | import ( 20 | "sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta3" 21 | "sigs.k8s.io/controller-runtime/pkg/conversion" 22 | ) 23 | 24 | func (src *CloudStackIsolatedNetwork) ConvertTo(dstRaw conversion.Hub) error { // nolint 25 | dst := dstRaw.(*v1beta3.CloudStackIsolatedNetwork) 26 | return Convert_v1beta2_CloudStackIsolatedNetwork_To_v1beta3_CloudStackIsolatedNetwork(src, dst, nil) 27 | } 28 | 29 | func (dst *CloudStackIsolatedNetwork) ConvertFrom(srcRaw conversion.Hub) error { // nolint 30 | src := srcRaw.(*v1beta3.CloudStackIsolatedNetwork) 31 | return Convert_v1beta3_CloudStackIsolatedNetwork_To_v1beta2_CloudStackIsolatedNetwork(src, dst, nil) 32 | } 33 | -------------------------------------------------------------------------------- /api/v1beta2/cloudstackmachine_conversion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2023 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package v1beta2 18 | 19 | import ( 20 | "sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta3" 21 | "sigs.k8s.io/controller-runtime/pkg/conversion" 22 | ) 23 | 24 | func (src *CloudStackMachine) ConvertTo(dstRaw conversion.Hub) error { // nolint 25 | dst := dstRaw.(*v1beta3.CloudStackMachine) 26 | return Convert_v1beta2_CloudStackMachine_To_v1beta3_CloudStackMachine(src, dst, nil) 27 | } 28 | 29 | func (dst *CloudStackMachine) ConvertFrom(srcRaw conversion.Hub) error { // nolint 30 | src := srcRaw.(*v1beta3.CloudStackMachine) 31 | return Convert_v1beta3_CloudStackMachine_To_v1beta2_CloudStackMachine(src, dst, nil) 32 | } 33 | -------------------------------------------------------------------------------- /api/v1beta2/cloudstackmachinestatechecker_conversion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2023 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package v1beta2 18 | 19 | import ( 20 | "sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta3" 21 | "sigs.k8s.io/controller-runtime/pkg/conversion" 22 | ) 23 | 24 | func (src *CloudStackMachineStateChecker) ConvertTo(dstRaw conversion.Hub) error { // nolint 25 | dst := dstRaw.(*v1beta3.CloudStackMachineStateChecker) 26 | return Convert_v1beta2_CloudStackMachineStateChecker_To_v1beta3_CloudStackMachineStateChecker(src, dst, nil) 27 | } 28 | 29 | func (dst *CloudStackMachineStateChecker) ConvertFrom(srcRaw conversion.Hub) error { // nolint 30 | src := srcRaw.(*v1beta3.CloudStackMachineStateChecker) 31 | return Convert_v1beta3_CloudStackMachineStateChecker_To_v1beta2_CloudStackMachineStateChecker(src, dst, nil) 32 | } 33 | -------------------------------------------------------------------------------- /api/v1beta2/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Package v1beta2 contains API Schema definitions for the infrastructure v1beta2 API group 18 | // +kubebuilder:object:generate=true 19 | // +groupName=infrastructure.cluster.x-k8s.io 20 | // +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta3 21 | package v1beta2 22 | -------------------------------------------------------------------------------- /api/v1beta3/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Package v1beta3 contains API Schema definitions for the infrastructure v1beta3 API group 18 | // +kubebuilder:object:generate=true 19 | // +groupName=infrastructure.cluster.x-k8s.io 20 | package v1beta3 21 | -------------------------------------------------------------------------------- /cloudbuild.yaml: -------------------------------------------------------------------------------- 1 | # See https://cloud.google.com/cloud-build/docs/build-config 2 | timeout: 1800s 3 | options: 4 | substitution_option: ALLOW_LOOSE 5 | machineType: 'N1_HIGHCPU_8' 6 | steps: 7 | - name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20220609-2e4c91eb7e' 8 | entrypoint: make 9 | env: 10 | - DOCKER_CLI_EXPERIMENTAL=enabled 11 | - TAG=$_GIT_TAG 12 | - PULL_BASE_REF=$_PULL_BASE_REF 13 | - DOCKER_BUILDKIT=1 14 | args: 15 | - release-staging 16 | substitutions: 17 | # _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and 18 | # can be used as a substitution 19 | _GIT_TAG: '12345' 20 | _PULL_BASE_REF: 'main' 21 | -------------------------------------------------------------------------------- /config/certmanager/certificate.yaml: -------------------------------------------------------------------------------- 1 | # The following manifests contain a self-signed issuer CR and a certificate CR. 2 | # More document can be found at https://docs.cert-manager.io 3 | # WARNING: Targets CertManager v1.0. Check https://cert-manager.io/docs/installation/upgrading/ for breaking changes. 4 | apiVersion: cert-manager.io/v1 5 | kind: Issuer 6 | metadata: 7 | name: selfsigned-issuer 8 | namespace: system 9 | spec: 10 | selfSigned: {} 11 | --- 12 | apiVersion: cert-manager.io/v1 13 | kind: Certificate 14 | metadata: 15 | name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml 16 | namespace: system 17 | spec: 18 | # $(SERVICE_NAME) and $(SERVICE_NAMESPACE) will be substituted by kustomize 19 | dnsNames: 20 | - $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc 21 | - $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc.cluster.local 22 | issuerRef: 23 | kind: Issuer 24 | name: selfsigned-issuer 25 | secretName: webhook-server-cert # this secret will not be prefixed, since it's not managed by kustomize 26 | -------------------------------------------------------------------------------- /config/certmanager/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - certificate.yaml 5 | configurations: 6 | - kustomizeconfig.yaml 7 | -------------------------------------------------------------------------------- /config/certmanager/kustomizeconfig.yaml: -------------------------------------------------------------------------------- 1 | # This configuration is for teaching kustomize how to update name ref and var substitution 2 | nameReference: 3 | - kind: Issuer 4 | group: cert-manager.io 5 | fieldSpecs: 6 | - kind: Certificate 7 | group: cert-manager.io 8 | path: spec/issuerRef/name 9 | 10 | varReference: 11 | - kind: Certificate 12 | group: cert-manager.io 13 | path: spec/commonName 14 | - kind: Certificate 15 | group: cert-manager.io 16 | path: spec/dnsNames 17 | -------------------------------------------------------------------------------- /config/crd/kustomizeconfig.yaml: -------------------------------------------------------------------------------- 1 | # This file is for teaching kustomize how to substitute name and namespace reference in CRD 2 | nameReference: 3 | - kind: Service 4 | version: v1 5 | fieldSpecs: 6 | - kind: CustomResourceDefinition 7 | version: v1 8 | group: apiextensions.k8s.io 9 | path: spec/conversion/webhook/clientConfig/service/name 10 | 11 | namespace: 12 | - kind: CustomResourceDefinition 13 | version: v1 14 | group: apiextensions.k8s.io 15 | path: spec/conversion/webhook/clientConfig/service/namespace 16 | create: false 17 | 18 | varReference: 19 | - path: metadata/annotations 20 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_cloudstackaffinitygroups.yaml: -------------------------------------------------------------------------------- 1 | # The following patch adds a directive for certmanager to inject CA into the CRD 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | annotations: 6 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 7 | name: cloudstackaffinitygroups.infrastructure.cluster.x-k8s.io 8 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_cloudstackclusters.yaml: -------------------------------------------------------------------------------- 1 | # The following patch adds a directive for certmanager to inject CA into the CRD 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | annotations: 6 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 7 | name: cloudstackclusters.infrastructure.cluster.x-k8s.io -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_cloudstackfailuredomains.yaml: -------------------------------------------------------------------------------- 1 | # The following patch adds a directive for certmanager to inject CA into the CRD 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | annotations: 6 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 7 | name: cloudstackfailuredomains.infrastructure.cluster.x-k8s.io 8 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_cloudstackisolatednetworks.yaml: -------------------------------------------------------------------------------- 1 | # The following patch adds a directive for certmanager to inject CA into the CRD 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | annotations: 6 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 7 | name: cloudstackisolatednetworks.infrastructure.cluster.x-k8s.io 8 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_cloudstackmachines.yaml: -------------------------------------------------------------------------------- 1 | # The following patch adds a directive for certmanager to inject CA into the CRD 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | annotations: 6 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 7 | name: cloudstackmachines.infrastructure.cluster.x-k8s.io 8 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_cloudstackmachinestatecheckers.yaml: -------------------------------------------------------------------------------- 1 | # The following patch adds a directive for certmanager to inject CA into the CRD 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | annotations: 6 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 7 | name: cloudstackmachinestatecheckers.infrastructure.cluster.x-k8s.io 8 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_cloudstackmachinetemplates.yaml: -------------------------------------------------------------------------------- 1 | # The following patch adds a directive for certmanager to inject CA into the CRD 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | annotations: 6 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 7 | name: cloudstackmachinetemplates.infrastructure.cluster.x-k8s.io 8 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_cloudstackzones.yaml: -------------------------------------------------------------------------------- 1 | # The following patch adds a directive for certmanager to inject CA into the CRD 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | annotations: 6 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 7 | name: cloudstackzones.infrastructure.cluster.x-k8s.io 8 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_cloudstackaffinitygroups.yaml: -------------------------------------------------------------------------------- 1 | # The following patch enables a conversion webhook for the CRD 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | name: cloudstackaffinitygroups.infrastructure.cluster.x-k8s.io 6 | spec: 7 | conversion: 8 | strategy: Webhook 9 | webhook: 10 | clientConfig: 11 | service: 12 | namespace: system 13 | name: webhook-service 14 | path: /convert 15 | conversionReviewVersions: 16 | - v1 17 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_cloudstackclusters.yaml: -------------------------------------------------------------------------------- 1 | # The following patch enables a conversion webhook for the CRD 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | name: cloudstackclusters.infrastructure.cluster.x-k8s.io 6 | spec: 7 | conversion: 8 | strategy: Webhook 9 | webhook: 10 | clientConfig: 11 | service: 12 | namespace: system 13 | name: webhook-service 14 | path: /convert 15 | conversionReviewVersions: 16 | - v1 17 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_cloudstackfailuredomains.yaml: -------------------------------------------------------------------------------- 1 | # The following patch enables a conversion webhook for the CRD 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | name: cloudstackfailuredomains.infrastructure.cluster.x-k8s.io 6 | spec: 7 | conversion: 8 | strategy: Webhook 9 | webhook: 10 | clientConfig: 11 | service: 12 | namespace: system 13 | name: webhook-service 14 | path: /convert 15 | conversionReviewVersions: 16 | - v1 17 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_cloudstackisolatednetworks.yaml: -------------------------------------------------------------------------------- 1 | # The following patch enables a conversion webhook for the CRD 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | name: cloudstackisolatednetworks.infrastructure.cluster.x-k8s.io 6 | spec: 7 | conversion: 8 | strategy: Webhook 9 | webhook: 10 | clientConfig: 11 | service: 12 | namespace: system 13 | name: webhook-service 14 | path: /convert 15 | conversionReviewVersions: 16 | - v1 17 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_cloudstackmachines.yaml: -------------------------------------------------------------------------------- 1 | # The following patch enables a conversion webhook for the CRD 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | name: cloudstackmachines.infrastructure.cluster.x-k8s.io 6 | spec: 7 | conversion: 8 | strategy: Webhook 9 | webhook: 10 | clientConfig: 11 | service: 12 | namespace: system 13 | name: webhook-service 14 | path: /convert 15 | conversionReviewVersions: 16 | - v1 17 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_cloudstackmachinestatecheckers.yaml: -------------------------------------------------------------------------------- 1 | # The following patch enables a conversion webhook for the CRD 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | name: cloudstackmachinestatecheckers.infrastructure.cluster.x-k8s.io 6 | spec: 7 | conversion: 8 | strategy: Webhook 9 | webhook: 10 | clientConfig: 11 | service: 12 | namespace: system 13 | name: webhook-service 14 | path: /convert 15 | conversionReviewVersions: 16 | - v1 17 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_cloudstackmachinetemplates.yaml: -------------------------------------------------------------------------------- 1 | # The following patch enables a conversion webhook for the CRD 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | name: cloudstackmachinetemplates.infrastructure.cluster.x-k8s.io 6 | spec: 7 | conversion: 8 | strategy: Webhook 9 | webhook: 10 | clientConfig: 11 | service: 12 | namespace: system 13 | name: webhook-service 14 | path: /convert 15 | conversionReviewVersions: 16 | - v1 17 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_cloudstackzones.yaml: -------------------------------------------------------------------------------- 1 | # The following patch enables a conversion webhook for the CRD 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | name: cloudstackzones.infrastructure.cluster.x-k8s.io 6 | spec: 7 | conversion: 8 | strategy: Webhook 9 | webhook: 10 | clientConfig: 11 | service: 12 | namespace: system 13 | name: webhook-service 14 | path: /convert 15 | conversionReviewVersions: 16 | - v1 17 | -------------------------------------------------------------------------------- /config/default-with-metrics-port/auth_proxy_client_clusterrole.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: 4 | name: metrics-reader 5 | rules: 6 | - nonResourceURLs: 7 | - "/metrics" 8 | verbs: 9 | - get 10 | -------------------------------------------------------------------------------- /config/default-with-metrics-port/auth_proxy_role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: 4 | name: proxy-role 5 | rules: 6 | - apiGroups: 7 | - authentication.k8s.io 8 | resources: 9 | - tokenreviews 10 | verbs: 11 | - create 12 | - apiGroups: 13 | - authorization.k8s.io 14 | resources: 15 | - subjectaccessreviews 16 | verbs: 17 | - create 18 | -------------------------------------------------------------------------------- /config/default-with-metrics-port/auth_proxy_role_binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: proxy-rolebinding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: proxy-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: controller-manager 12 | namespace: system 13 | -------------------------------------------------------------------------------- /config/default-with-metrics-port/auth_proxy_service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | control-plane: controller-manager 6 | name: controller-manager-metrics-service 7 | namespace: system 8 | spec: 9 | ports: 10 | - name: https 11 | port: 8443 12 | protocol: TCP 13 | targetPort: https 14 | selector: 15 | control-plane: capc-controller-manager 16 | -------------------------------------------------------------------------------- /config/default-with-metrics-port/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | bases: 5 | - ../default 6 | 7 | resources: 8 | - auth_proxy_client_clusterrole.yaml 9 | - auth_proxy_role.yaml 10 | - auth_proxy_role_binding.yaml 11 | - auth_proxy_service.yaml 12 | 13 | patchesStrategicMerge: 14 | - manager_auth_proxy_patch.yaml -------------------------------------------------------------------------------- /config/default-with-metrics-port/manager_auth_proxy_patch.yaml: -------------------------------------------------------------------------------- 1 | # This patch inject a sidecar container which is a HTTP proxy for the 2 | # controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews. 3 | apiVersion: apps/v1 4 | kind: Deployment 5 | metadata: 6 | name: controller-manager 7 | namespace: system 8 | spec: 9 | template: 10 | spec: 11 | containers: 12 | - name: kube-rbac-proxy 13 | image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0 14 | args: 15 | - "--secure-listen-address=0.0.0.0:8443" 16 | - "--upstream=http://127.0.0.1:8080/" 17 | - "--logtostderr=true" 18 | - "--v=10" 19 | ports: 20 | - containerPort: 8443 21 | protocol: TCP 22 | name: https 23 | -------------------------------------------------------------------------------- /config/default/kustomizeconfig.yaml: -------------------------------------------------------------------------------- 1 | # This configuration is for teaching kustomize how to update name ref and var substitution 2 | varReference: 3 | - kind: Deployment 4 | path: spec/template/spec/volumes/secret/secretName 5 | -------------------------------------------------------------------------------- /config/default/manager_config_patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: controller-manager 5 | namespace: system 6 | spec: 7 | template: 8 | spec: 9 | containers: 10 | - name: manager 11 | args: 12 | - "--config=controller_manager_config.yaml" 13 | volumeMounts: 14 | - name: manager-config 15 | mountPath: /controller_manager_config.yaml 16 | subPath: controller_manager_config.yaml 17 | volumes: 18 | - name: manager-config 19 | configMap: 20 | name: manager-config 21 | -------------------------------------------------------------------------------- /config/default/manager_image_patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: controller-manager 5 | namespace: system 6 | spec: 7 | template: 8 | spec: 9 | containers: 10 | # Change the value of image field below to your controller image URL 11 | - image: localhost:5000/cluster-api-provider-cloudstack:latest 12 | name: manager 13 | -------------------------------------------------------------------------------- /config/default/manager_webhook_patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: controller-manager 5 | namespace: system 6 | spec: 7 | template: 8 | spec: 9 | containers: 10 | - name: manager 11 | ports: 12 | - containerPort: 9443 13 | name: webhook-server 14 | protocol: TCP 15 | volumeMounts: 16 | - mountPath: /tmp/k8s-webhook-server/serving-certs 17 | name: cert 18 | readOnly: true 19 | volumes: 20 | - name: cert 21 | secret: 22 | defaultMode: 420 23 | secretName: webhook-server-cert 24 | -------------------------------------------------------------------------------- /config/default/namespace.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: system 5 | -------------------------------------------------------------------------------- /config/default/webhookcainjection_patch.yaml: -------------------------------------------------------------------------------- 1 | # This patch add annotation to admission webhook config and 2 | # the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize. 3 | apiVersion: admissionregistration.k8s.io/v1 4 | kind: MutatingWebhookConfiguration 5 | metadata: 6 | name: mutating-webhook-configuration 7 | annotations: 8 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 9 | --- 10 | apiVersion: admissionregistration.k8s.io/v1 11 | kind: ValidatingWebhookConfiguration 12 | metadata: 13 | name: validating-webhook-configuration 14 | annotations: 15 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 16 | -------------------------------------------------------------------------------- /config/develop/insecure_manager.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: controller-manager 5 | namespace: system 6 | labels: 7 | control-plane: capc-controller-manager 8 | spec: 9 | template: 10 | metadata: 11 | labels: 12 | control-plane: capc-controller-manager 13 | spec: 14 | securityContext: # Tilt image build and runs as root. 15 | runAsNonRoot: false 16 | -------------------------------------------------------------------------------- /config/develop/kustomization.yaml: -------------------------------------------------------------------------------- 1 | namespace: capc-system 2 | bases: 3 | - ../default 4 | patchesStrategicMerge: 5 | - insecure_manager.yaml 6 | 7 | patches: 8 | - path: manager_open_debug_port.yaml 9 | target: 10 | kind: Deployment 11 | name: controller-manager 12 | namespace: system 13 | -------------------------------------------------------------------------------- /config/develop/manager_open_debug_port.yaml: -------------------------------------------------------------------------------- 1 | - op: add 2 | path: /spec/template/spec/containers/0/ports/- 3 | value: 4 | containerPort: 40000 # Delve debugging port. 5 | -------------------------------------------------------------------------------- /config/insecure_manager.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: controller-manager 5 | namespace: system 6 | labels: 7 | control-plane: capc-controller-manager 8 | spec: 9 | template: 10 | metadata: 11 | labels: 12 | control-plane: capc-controller-manager 13 | spec: 14 | securityContext: 15 | runAsNonRoot: false 16 | -------------------------------------------------------------------------------- /config/kustomization.yaml: -------------------------------------------------------------------------------- 1 | namespace: capc-system 2 | bases: 3 | - default 4 | patchesStrategicMerge: 5 | - insecure_manager.yaml 6 | -------------------------------------------------------------------------------- /config/manager/controller_manager_config.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: controller-runtime.sigs.k8s.io/v1alpha1 2 | kind: ControllerManagerConfig 3 | health: 4 | healthProbeBindAddress: :8081 5 | metrics: 6 | bindAddress: 127.0.0.1:8080 7 | webhook: 8 | port: 9443 9 | leaderElection: 10 | leaderElect: true 11 | resourceName: d0f00250.cluster.x-k8s.io 12 | -------------------------------------------------------------------------------- /config/manager/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - manager.yaml 3 | 4 | generatorOptions: 5 | disableNameSuffixHash: true 6 | 7 | configMapGenerator: 8 | - files: 9 | - controller_manager_config.yaml 10 | name: manager-config 11 | apiVersion: kustomize.config.k8s.io/v1beta1 12 | kind: Kustomization 13 | images: 14 | - name: controller 15 | newName: localhost:5000/cluster-api-provider-cloudstack 16 | newTag: latest 17 | -------------------------------------------------------------------------------- /config/rbac/auth_proxy_client_clusterrole.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: 4 | name: metrics-reader 5 | rules: 6 | - nonResourceURLs: 7 | - "/metrics" 8 | verbs: 9 | - get 10 | -------------------------------------------------------------------------------- /config/rbac/cloudstackaffinitygroup_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions for end users to edit cloudstackaffinitygroups. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: cloudstackaffinitygroup-editor-role 6 | rules: 7 | - apiGroups: 8 | - infrastructure.cluster.x-k8s.io 9 | resources: 10 | - cloudstackaffinitygroups 11 | verbs: 12 | - create 13 | - delete 14 | - get 15 | - list 16 | - patch 17 | - update 18 | - watch 19 | - apiGroups: 20 | - infrastructure.cluster.x-k8s.io 21 | resources: 22 | - cloudstackaffinitygroups/status 23 | verbs: 24 | - get 25 | -------------------------------------------------------------------------------- /config/rbac/cloudstackaffinitygroup_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions for end users to view cloudstackaffinitygroups. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: cloudstackaffinitygroup-viewer-role 6 | rules: 7 | - apiGroups: 8 | - infrastructure.cluster.x-k8s.io 9 | resources: 10 | - cloudstackaffinitygroups 11 | verbs: 12 | - get 13 | - list 14 | - watch 15 | - apiGroups: 16 | - infrastructure.cluster.x-k8s.io 17 | resources: 18 | - cloudstackaffinitygroups/status 19 | verbs: 20 | - get 21 | -------------------------------------------------------------------------------- /config/rbac/cloudstackcluster_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions for end users to edit cloudstackclusters. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: cloudstackcluster-editor-role 6 | rules: 7 | - apiGroups: 8 | - infrastructure.cluster.x-k8s.io 9 | resources: 10 | - cloudstackclusters 11 | verbs: 12 | - create 13 | - delete 14 | - get 15 | - list 16 | - patch 17 | - update 18 | - watch 19 | - apiGroups: 20 | - infrastructure.cluster.x-k8s.io 21 | resources: 22 | - cloudstackclusters/status 23 | verbs: 24 | - get 25 | -------------------------------------------------------------------------------- /config/rbac/cloudstackcluster_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions for end users to view cloudstackclusters. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: cloudstackcluster-viewer-role 6 | rules: 7 | - apiGroups: 8 | - infrastructure.cluster.x-k8s.io 9 | resources: 10 | - cloudstackclusters 11 | verbs: 12 | - get 13 | - list 14 | - watch 15 | - apiGroups: 16 | - infrastructure.cluster.x-k8s.io 17 | resources: 18 | - cloudstackclusters/status 19 | verbs: 20 | - get 21 | -------------------------------------------------------------------------------- /config/rbac/cloudstackfailuredomain_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions for end users to edit cloudstackfailuredomains. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: cloudstackfailuredomain-editor-role 6 | rules: 7 | - apiGroups: 8 | - infrastructure.cluster.x-k8s.io 9 | resources: 10 | - cloudstackfailuredomains 11 | verbs: 12 | - create 13 | - delete 14 | - get 15 | - list 16 | - patch 17 | - update 18 | - watch 19 | - apiGroups: 20 | - infrastructure.cluster.x-k8s.io 21 | resources: 22 | - cloudstackfailuredomains/status 23 | verbs: 24 | - get 25 | -------------------------------------------------------------------------------- /config/rbac/cloudstackfailuredomain_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions for end users to view cloudstackfailuredomains. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: cloudstackfailuredomain-viewer-role 6 | rules: 7 | - apiGroups: 8 | - infrastructure.cluster.x-k8s.io 9 | resources: 10 | - cloudstackfailuredomains 11 | verbs: 12 | - get 13 | - list 14 | - watch 15 | - apiGroups: 16 | - infrastructure.cluster.x-k8s.io 17 | resources: 18 | - cloudstackfailuredomains/status 19 | verbs: 20 | - get 21 | -------------------------------------------------------------------------------- /config/rbac/cloudstackisolatednetwork_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions for end users to edit cloudstackisolatednetworks. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: cloudstackisolatednetwork-editor-role 6 | rules: 7 | - apiGroups: 8 | - infrastructure.cluster.x-k8s.io 9 | resources: 10 | - cloudstackisolatednetworks 11 | verbs: 12 | - create 13 | - delete 14 | - get 15 | - list 16 | - patch 17 | - update 18 | - watch 19 | - apiGroups: 20 | - infrastructure.cluster.x-k8s.io 21 | resources: 22 | - cloudstackisolatednetworks/status 23 | verbs: 24 | - get 25 | -------------------------------------------------------------------------------- /config/rbac/cloudstackisolatednetwork_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions for end users to view cloudstackisolatednetworks. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: cloudstackisolatednetwork-viewer-role 6 | rules: 7 | - apiGroups: 8 | - infrastructure.cluster.x-k8s.io 9 | resources: 10 | - cloudstackisolatednetworks 11 | verbs: 12 | - get 13 | - list 14 | - watch 15 | - apiGroups: 16 | - infrastructure.cluster.x-k8s.io 17 | resources: 18 | - cloudstackisolatednetworks/status 19 | verbs: 20 | - get 21 | -------------------------------------------------------------------------------- /config/rbac/cloudstackmachine_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions for end users to edit cloudstackmachines. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: cloudstackmachine-editor-role 6 | rules: 7 | - apiGroups: 8 | - infrastructure.cluster.x-k8s.io 9 | resources: 10 | - cloudstackmachines 11 | verbs: 12 | - create 13 | - delete 14 | - get 15 | - list 16 | - patch 17 | - update 18 | - watch 19 | - apiGroups: 20 | - infrastructure.cluster.x-k8s.io 21 | resources: 22 | - cloudstackmachines/status 23 | verbs: 24 | - get 25 | -------------------------------------------------------------------------------- /config/rbac/cloudstackmachine_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions for end users to view cloudstackmachines. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: cloudstackmachine-viewer-role 6 | rules: 7 | - apiGroups: 8 | - infrastructure.cluster.x-k8s.io 9 | resources: 10 | - cloudstackmachines 11 | verbs: 12 | - get 13 | - list 14 | - watch 15 | - apiGroups: 16 | - infrastructure.cluster.x-k8s.io 17 | resources: 18 | - cloudstackmachines/status 19 | verbs: 20 | - get 21 | -------------------------------------------------------------------------------- /config/rbac/cloudstackmachinestatechecker_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions for end users to edit cloudstackmachinestatecheckers. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: cloudstackmachinestatechecker-editor-role 6 | rules: 7 | - apiGroups: 8 | - infrastructure.cluster.x-k8s.io 9 | resources: 10 | - cloudstackmachinestatecheckers 11 | verbs: 12 | - create 13 | - delete 14 | - get 15 | - list 16 | - patch 17 | - update 18 | - watch 19 | - apiGroups: 20 | - infrastructure.cluster.x-k8s.io 21 | resources: 22 | - cloudstackmachinestatecheckers/status 23 | verbs: 24 | - get 25 | -------------------------------------------------------------------------------- /config/rbac/cloudstackmachinestatechecker_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions for end users to view cloudstackmachinestatecheckers. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: cloudstackmachinestatechecker-viewer-role 6 | rules: 7 | - apiGroups: 8 | - infrastructure.cluster.x-k8s.io 9 | resources: 10 | - cloudstackmachinestatecheckers 11 | verbs: 12 | - get 13 | - list 14 | - watch 15 | - apiGroups: 16 | - infrastructure.cluster.x-k8s.io 17 | resources: 18 | - cloudstackmachinestatecheckers/status 19 | verbs: 20 | - get 21 | -------------------------------------------------------------------------------- /config/rbac/cloudstackmachinetemplate_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions for end users to edit cloudstackmachinetemplates. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: cloudstackmachinetemplate-editor-role 6 | rules: 7 | - apiGroups: 8 | - infrastructure.cluster.x-k8s.io 9 | resources: 10 | - cloudstackmachinetemplates 11 | verbs: 12 | - create 13 | - delete 14 | - get 15 | - list 16 | - patch 17 | - update 18 | - watch 19 | - apiGroups: 20 | - infrastructure.cluster.x-k8s.io 21 | resources: 22 | - cloudstackmachinetemplates/status 23 | verbs: 24 | - get 25 | -------------------------------------------------------------------------------- /config/rbac/cloudstackmachinetemplate_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions for end users to view cloudstackmachinetemplates. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: cloudstackmachinetemplate-viewer-role 6 | rules: 7 | - apiGroups: 8 | - infrastructure.cluster.x-k8s.io 9 | resources: 10 | - cloudstackmachinetemplates 11 | verbs: 12 | - get 13 | - list 14 | - watch 15 | - apiGroups: 16 | - infrastructure.cluster.x-k8s.io 17 | resources: 18 | - cloudstackmachinetemplates/status 19 | verbs: 20 | - get 21 | -------------------------------------------------------------------------------- /config/rbac/cloudstackzone_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions for end users to edit cloudstackzones. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: cloudstackzone-editor-role 6 | rules: 7 | - apiGroups: 8 | - infrastructure.cluster.x-k8s.io 9 | resources: 10 | - cloudstackzones 11 | verbs: 12 | - create 13 | - delete 14 | - get 15 | - list 16 | - patch 17 | - update 18 | - watch 19 | - apiGroups: 20 | - infrastructure.cluster.x-k8s.io 21 | resources: 22 | - cloudstackzones/status 23 | verbs: 24 | - get 25 | -------------------------------------------------------------------------------- /config/rbac/cloudstackzone_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions for end users to view cloudstackzones. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: cloudstackzone-viewer-role 6 | rules: 7 | - apiGroups: 8 | - infrastructure.cluster.x-k8s.io 9 | resources: 10 | - cloudstackzones 11 | verbs: 12 | - get 13 | - list 14 | - watch 15 | - apiGroups: 16 | - infrastructure.cluster.x-k8s.io 17 | resources: 18 | - cloudstackzones/status 19 | verbs: 20 | - get 21 | -------------------------------------------------------------------------------- /config/rbac/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - role_binding.yaml 5 | - role.yaml 6 | - service_account.yaml 7 | - leader_election_role.yaml 8 | - leader_election_role_binding.yaml 9 | -------------------------------------------------------------------------------- /config/rbac/leader_election_role.yaml: -------------------------------------------------------------------------------- 1 | # permissions to do leader election. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: Role 4 | metadata: 5 | name: leader-election-role 6 | rules: 7 | - apiGroups: 8 | - "" 9 | resources: 10 | - configmaps 11 | verbs: 12 | - get 13 | - list 14 | - watch 15 | - create 16 | - update 17 | - patch 18 | - delete 19 | - apiGroups: 20 | - "" 21 | resources: 22 | - configmaps/status 23 | verbs: 24 | - get 25 | - update 26 | - patch 27 | - apiGroups: 28 | - "" 29 | resources: 30 | - events 31 | verbs: 32 | - create 33 | - apiGroups: 34 | - "coordination.k8s.io" 35 | resources: 36 | - leases 37 | verbs: 38 | - get 39 | - list 40 | - watch 41 | - create 42 | - update 43 | - patch 44 | - delete 45 | -------------------------------------------------------------------------------- /config/rbac/leader_election_role_binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | name: leader-election-rolebinding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: leader-election-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: controller-manager 12 | namespace: system 13 | -------------------------------------------------------------------------------- /config/rbac/role_binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: manager-rolebinding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: manager-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: controller-manager 12 | namespace: system 13 | -------------------------------------------------------------------------------- /config/rbac/service_account.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: controller-manager 5 | namespace: system 6 | -------------------------------------------------------------------------------- /config/samples/infrastructure_v1beta1_cloudstackaffinitygroup.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 2 | kind: CloudStackAffinityGroup 3 | metadata: 4 | name: cloudstackaffinitygroup-sample 5 | spec: 6 | # TODO(user): Add fields here 7 | -------------------------------------------------------------------------------- /config/samples/infrastructure_v1beta1_cloudstackfailuredomain.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 2 | kind: CloudStackFailureDomain 3 | metadata: 4 | name: cloudstackfailuredomain-sample 5 | spec: 6 | # TODO(user): Add fields here 7 | -------------------------------------------------------------------------------- /config/samples/infrastructure_v1beta1_cloudstackisolatednetwork.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 2 | kind: CloudStackIsolatedNetwork 3 | metadata: 4 | name: cloudstackisolatednetwork-sample 5 | spec: 6 | # TODO(user): Add fields here 7 | -------------------------------------------------------------------------------- /config/samples/infrastructure_v1beta1_cloudstackmachinestatechecker.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 2 | kind: CloudStackMachineStateChecker 3 | metadata: 4 | name: cloudstackmachinestatechecker-sample 5 | spec: 6 | # TODO(user): Add fields here 7 | -------------------------------------------------------------------------------- /config/samples/infrastructure_v1beta1_cloudstackzone.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 2 | kind: CloudStackZone 3 | metadata: 4 | name: cloudstackzone-sample 5 | spec: 6 | # TODO(user): Add fields here 7 | -------------------------------------------------------------------------------- /config/samples/infrastructure_v1beta2_cloudstackfailuredomain.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 2 | kind: CloudStackFailureDomain 3 | metadata: 4 | name: cloudstackfailuredomain-sample 5 | spec: 6 | # TODO(user): Add fields here 7 | -------------------------------------------------------------------------------- /config/webhook/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - manifests.yaml 3 | - service.yaml 4 | 5 | configurations: 6 | - kustomizeconfig.yaml 7 | -------------------------------------------------------------------------------- /config/webhook/kustomizeconfig.yaml: -------------------------------------------------------------------------------- 1 | # the following config is for teaching kustomize where to look at when substituting vars. 2 | # It requires kustomize v2.1.0 or newer to work properly. 3 | nameReference: 4 | - kind: Service 5 | version: v1 6 | fieldSpecs: 7 | - kind: MutatingWebhookConfiguration 8 | group: admissionregistration.k8s.io 9 | path: webhooks/clientConfig/service/name 10 | - kind: ValidatingWebhookConfiguration 11 | group: admissionregistration.k8s.io 12 | path: webhooks/clientConfig/service/name 13 | 14 | namespace: 15 | - kind: MutatingWebhookConfiguration 16 | group: admissionregistration.k8s.io 17 | path: webhooks/clientConfig/service/namespace 18 | create: true 19 | - kind: ValidatingWebhookConfiguration 20 | group: admissionregistration.k8s.io 21 | path: webhooks/clientConfig/service/namespace 22 | create: true 23 | 24 | varReference: 25 | - path: metadata/annotations 26 | -------------------------------------------------------------------------------- /config/webhook/service.yaml: -------------------------------------------------------------------------------- 1 | 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: webhook-service 6 | namespace: system 7 | spec: 8 | ports: 9 | - port: 443 10 | protocol: TCP 11 | targetPort: 9443 12 | selector: 13 | control-plane: capc-controller-manager 14 | -------------------------------------------------------------------------------- /controllers/utils/constants.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package utils 18 | 19 | import "time" 20 | 21 | const RequeueTimeout = 5 * time.Second 22 | const DestoryVMRequeueInterval = 10 * time.Second 23 | -------------------------------------------------------------------------------- /controllers/utils/utils_suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package utils_test 18 | 19 | import ( 20 | "testing" 21 | 22 | "github.com/onsi/ginkgo/v2" 23 | "github.com/onsi/gomega" 24 | ) 25 | 26 | func TestUtils(t *testing.T) { 27 | gomega.RegisterFailHandler(ginkgo.Fail) 28 | ginkgo.RunSpecs(t, "Utils Suite") 29 | } 30 | -------------------------------------------------------------------------------- /docs/book/.gitignore: -------------------------------------------------------------------------------- 1 | # book file 2 | book 3 | -------------------------------------------------------------------------------- /docs/book/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2020 The Kubernetes Authors. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | export REPO_ROOT := $(shell git rev-parse --show-toplevel) 16 | 17 | include $(REPO_ROOT)/common.mk 18 | 19 | # Directories. 20 | MDBOOK := $(TOOLS_BIN_DIR)/mdbook 21 | MDBOOK_EMBED := $(TOOLS_BIN_DIR)/mdbook-embed 22 | MDBOOK_RELEASELINK := $(TOOLS_BIN_DIR)/mdbook-releaselink 23 | MDBOOK_TABULATE := $(TOOLS_BIN_DIR)/mdbook-tabulate 24 | BOOK_SRCS := $(call rwildcard,.,*.*) 25 | 26 | OS := $(shell go env GOOS) 27 | ARCH := $(shell go env GOARCH) 28 | PATH := $(abspath $(TOOLS_BIN_DIR)):$(PATH) 29 | export PATH 30 | 31 | .PHONY: build 32 | build: $(BOOK_SRCS) $(MDBOOK) $(MDBOOK_EMBED) $(MDBOOK_RELEASELINK) $(MDBOOK_TABULATE) ## Build the book 33 | $(MDBOOK) build 34 | 35 | .PHONY: serve 36 | serve: $(MDBOOK) $(MDBOOK_EMBED) $(MDBOOK_RELEASELINK) $(MDBOOK_TABULATE) ## Run a local webserver with the compiled book 37 | $(MDBOOK) serve 38 | 39 | .PHONY: clean 40 | clean: 41 | rm -rf book 42 | -------------------------------------------------------------------------------- /docs/book/book.toml: -------------------------------------------------------------------------------- 1 | [book] 2 | authors = ["The Cluster API Provider CloudStack Maintainers"] 3 | language = "en" 4 | multilingual = false 5 | src = "src" 6 | title = "The Cluster API Provider CloudStack Book" 7 | 8 | [output.html] 9 | curly-quotes = true 10 | git-repository-url = "https://sigs.k8s.io/cluster-api-provider-cloudstack" 11 | no-section-label = true 12 | 13 | [preprocessor.tabulate] 14 | command = "mdbook-tabulate" 15 | 16 | [preprocessor.embed] 17 | command = "mdbook-embed" 18 | 19 | [preprocessor.releaselink] 20 | command = "mdbook-releaselink" 21 | -------------------------------------------------------------------------------- /docs/book/src/SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | - [Introduction](introduction.md) 4 | - [Getting Started](getting-started.md) 5 | - [Configuration](clustercloudstack/configuration.md) 6 | - [Topics](topics/index.md) 7 | - [Move From Bootstrap](topics/mover.md) 8 | - [TroubleShooting](topics/troubleshooting.md) 9 | - [Custom Images](topics/custom-images.md) 10 | - [SSH Access To Nodes](topics/ssh-access.md) 11 | - [Unstacked etcd](topics/unstacked-etcd.md) 12 | - [CloudStack Permissions](topics/cloudstack-permissions.md) 13 | - [Developer Guide](development/index.md) 14 | - [Development With Tilt](development/tilt.md) 15 | - [Building CAPC](development/building.md) 16 | - [E2E Tests](development/e2e.md) 17 | - [Releasing](development/releasing.md) -------------------------------------------------------------------------------- /docs/book/src/development/e2e.md: -------------------------------------------------------------------------------- 1 | {{#include ../../../../test/e2e/README.md:2:}} 2 | -------------------------------------------------------------------------------- /docs/book/src/images/capc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/docs/book/src/images/capc.png -------------------------------------------------------------------------------- /docs/book/src/images/ssh-step-1-public-ip-vpc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/docs/book/src/images/ssh-step-1-public-ip-vpc.png -------------------------------------------------------------------------------- /docs/book/src/images/ssh-step-1-public-ip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/docs/book/src/images/ssh-step-1-public-ip.png -------------------------------------------------------------------------------- /docs/book/src/images/ssh-step-2-firewall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/docs/book/src/images/ssh-step-2-firewall.png -------------------------------------------------------------------------------- /docs/book/src/images/ssh-step-3-firewall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/docs/book/src/images/ssh-step-3-firewall.png -------------------------------------------------------------------------------- /docs/book/src/images/ssh-step-4-portforwarding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/docs/book/src/images/ssh-step-4-portforwarding.png -------------------------------------------------------------------------------- /docs/book/src/images/ssh-step-5-portforwarding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/docs/book/src/images/ssh-step-5-portforwarding.png -------------------------------------------------------------------------------- /docs/book/src/images/ssh-step-6-portforwarding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/docs/book/src/images/ssh-step-6-portforwarding.png -------------------------------------------------------------------------------- /docs/book/src/introduction.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{#include ../../../README.md}} 4 | -------------------------------------------------------------------------------- /docs/book/src/topics/cloudstack-permissions.md: -------------------------------------------------------------------------------- 1 | # CloudStack Permissions for CAPC 2 | 3 | The account that CAPC runs under must minimally be a User type account with a role offering the following permissions 4 | 5 | * assignToLoadBalancerRule 6 | * associateIpAddress 7 | * createAffinityGroup 8 | * createEgressFirewallRule 9 | * createLoadBalancerRule 10 | * createNetwork 11 | * createTags 12 | * deleteAffinityGroup 13 | * deleteNetwork 14 | * deleteTags 15 | * deployVirtualMachine 16 | * destroyVirtualMachine 17 | * disassociateIpAddress 18 | * getUserKeys 19 | * listAccounts 20 | * listAffinityGroups 21 | * listDiskOfferings 22 | * listLoadBalancerRuleInstances 23 | * listLoadBalancerRules 24 | * listNetworkOfferings 25 | * listNetworks 26 | * listPublicIpAddresses 27 | * listServiceOfferings 28 | * listSSHKeyPairs 29 | * listTags 30 | * listTemplates 31 | * listUsers 32 | * listVirtualMachines 33 | * listVirtualMachinesMetrics 34 | * listVolumes 35 | * listZones 36 | * queryAsyncJobResult 37 | * startVirtualMachine 38 | * stopVirtualMachine 39 | * updateVMAffinityGroup 40 | 41 | > Note: If the user doesn't have permissions to expunge the VM, it will be left in a destroyed state. The user will need to manually expunge the VM. 42 | 43 | This permission set has been verified to successfully run the CAPC E2E test suite (Oct 11, 2022). -------------------------------------------------------------------------------- /docs/book/src/topics/index.md: -------------------------------------------------------------------------------- 1 | # Topics 2 | 3 | - [Move From Bootstrap](mover.md) 4 | - [TroubleShooting](troubleshooting.md) 5 | - [Custom Images](custom-images.md) 6 | - [SSH Access To Nodes](ssh-access.md) 7 | - [Unstacked etcd](unstacked-etcd.md) 8 | - [CloudStack Permissions](cloudstack-permissions.md) 9 | 10 | 11 | ## TODO : 12 | - Data Disks 13 | - Diff between CKS and CAPC 14 | - E2E Tests 15 | -------------------------------------------------------------------------------- /docs/book/theme/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/docs/book/theme/favicon.png -------------------------------------------------------------------------------- /docs/book/theme/head.hbs: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /hack/add_addresses.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This is a very simple script that can be used to launch a load balancer and add addresses to it. 4 | 5 | # It does so by querying kubernetes and parsing the output via jq. 6 | 7 | while true; do 8 | ADDRESSES=$(kubectl get machine -o json | jq -r '.items[] | select(.metadata.labels."cluster.x-k8s.io/control-plane" != null) | .status | select(.addresses!=null) | .addresses[].address') 9 | if [[ $ADDRESSES != $OLD_ADDRESSES ]]; then 10 | cp hack/nginx.conf ./nginx.conf 11 | echo $ADDRESSES 12 | for ADDRESS in $ADDRESSES; do 13 | sleep 5 14 | echo $ADDRESS 15 | sed -i.bak '/upstream kubeendpoints/a\'$'\n'$'\t''server '$ADDRESS':6443 max_fails=3 fail_timeout=10s;'$'\n' nginx.conf 16 | done 17 | docker stop nginx-container &> /dev/null || echo 18 | docker rm nginx-container &> /dev/null || echo 19 | docker run --name=nginx-container --rm -p 6443:6443 -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf nginx & 20 | fi 21 | OLD_ADDRESSES=$ADDRESSES 22 | sleep 5 23 | done 24 | 25 | 26 | -------------------------------------------------------------------------------- /hack/boilerplate.go.txt: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ -------------------------------------------------------------------------------- /hack/debugging/README.md: -------------------------------------------------------------------------------- 1 | ## Debugging the CAPC Controller Outside of the Cluster 2 | 3 | The CAPC controller can be run outside of the cluster, including in a debugger. To do so one must: 4 | - Have all the CAPI resources established in your bootstrap cluster except the CAPC controller 5 | - The CAPC controller webhook certs exported to the local filesystem 6 | - A modified CAPC webhook service that points to the externally running CAPC controller 7 | 8 | Script prepForDebugging.sh sets that up for a CAPC bootstrap cluster. It assumes: 9 | - The following programs are available for use: kubectl, jq, envsubst, pcregrep (pcre) 10 | - That the bootstrap cluster has been created and initialized (clusterctl init --infrastructure cloudstack) 11 | - That your local workstation's IP address can be obtained from network device en0 (or another device that can be specified as an argument on the prepForDebugging.sh command line) 12 | - That CAPC is the v1alpha3 version. (Things change for v1alpha4) 13 | 14 | How to: 15 | - Establish your bootstrap kind cluster 16 | - Deploy CAPC to bootstrap cluster: clusterctl init --infrastructure cloudstack 17 | - cd to your CAPC project directory 18 | - Make sure you've got a correct cloud-config file in your CAPC project directory 19 | - run hack/debugging/prepForDebugging.sh 20 | - Verify that the displayed k8s service endpoint is for your local workstation address. 21 | - Run CAPC bin/manager in your debugger with parameters --cert-dir=/tmp/k8s-webhook-server/serving-certs --cloud-config-file=cloud-config 22 | -------------------------------------------------------------------------------- /hack/debugging/debugWebhookServiceTemplate.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | apiVersion: v1 4 | metadata: 5 | name: capc-webhook-service 6 | spec: 7 | selector: {} 8 | ports: 9 | - 10 | name: webhooks 11 | protocol: TCP 12 | port: 443 13 | targetPort: 9443 14 | --- 15 | kind: Endpoints 16 | apiVersion: v1 17 | metadata: 18 | name: capc-webhook-service 19 | subsets: 20 | - 21 | addresses: 22 | - 23 | ip: ${MY_IP} 24 | ports: 25 | - 26 | port: 9443 27 | name: webhooks 28 | -------------------------------------------------------------------------------- /hack/ensure-cloud-config-yaml.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2019 The Kubernetes Authors. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | set -o errexit 18 | set -o nounset 19 | set -o pipefail 20 | 21 | # This ensures that cloud-config.yaml exists which is required for e2e smoke test 22 | if [ ! -f "cloud-config.yaml" ];then 23 | echo "cloud-config.yaml is not found, creating" 24 | cat >cloud-config.yaml < 0 { 36 | setFn(strArray) 37 | } 38 | } 39 | 40 | func setIntIfPositive(num int64, setFn setInt) { 41 | if num > 0 { 42 | setFn(num) 43 | } 44 | } 45 | 46 | func compress(str string) (string, error) { 47 | var buf bytes.Buffer 48 | w := cgzip.NewWriter(&buf) 49 | if _, err := w.Write([]byte(str)); err != nil { 50 | return "", err 51 | } 52 | if err := w.Close(); err != nil { 53 | return "", err 54 | } 55 | return buf.String(), nil 56 | } 57 | -------------------------------------------------------------------------------- /pkg/mocks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/pkg/mocks/.keep -------------------------------------------------------------------------------- /releases/v0.1.0/README_INTERNAL_ONLY: -------------------------------------------------------------------------------- 1 | This release was manually prepared, and has a few relevant differences from that built from 2 | main with Makefile targets. 3 | 4 | 1) An image archive named localhost:5000/cluster-api-provider-cloudstack:v0.1.0 was prepared. 5 | This is a re-tag of the public.ecr.aws/a4z9h2b1/cluster-api-provider-capc:latest, as 6 | built by make docker-image. 7 | 8 | 2) A set of cluster-api config files were placed in cluster-api.zip for easy deployment. 9 | - The image reference in infrastructure-components.yaml was adjusted to match the above. 10 | - A new cluster-config-ssh.yaml was created, identical to the current cluster-config.yaml 11 | - cluster-config.yaml was modified to remove any sshKey attributes. 12 | 13 | -------------------------------------------------------------------------------- /releases/v0.1.0/cluster-api.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/releases/v0.1.0/cluster-api.zip -------------------------------------------------------------------------------- /releases/v0.1.0/sha1sums.txt: -------------------------------------------------------------------------------- 1 | aef07ca6d6f7ee1f073533555e7829d64dbcad49 cluster-api-provider-cloudstack-v0.1.0.tar.gz 2 | 6bd334d0baf228d21dfb2cdfc6021fda0dd278a0 cluster-api.zip 3 | -------------------------------------------------------------------------------- /releases/v0.2.0/cluster-api.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/releases/v0.2.0/cluster-api.zip -------------------------------------------------------------------------------- /releases/v0.2.0/sha1sums.txt: -------------------------------------------------------------------------------- 1 | 68fab9bfb15a13e62963b8267cb8e3ca8e45ed68 cluster-api-provider-cloudstack-v0.2.0.tar.gz 2 | -------------------------------------------------------------------------------- /releases/v0.2.1/cluster-api.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/releases/v0.2.1/cluster-api.zip -------------------------------------------------------------------------------- /releases/v0.2.1/sha1sums.txt: -------------------------------------------------------------------------------- 1 | 68fab9bfb15a13e62963b8267cb8e3ca8e45ed68 cluster-api-provider-cloudstack-v0.2.0.tar.gz 2 | -------------------------------------------------------------------------------- /releases/v0.2.1/shasum.txt: -------------------------------------------------------------------------------- 1 | 37391baaba13da982dc8601675dfc6cd20c1fc9a cluster-api-provider-cloudstack-v0.2.1.tar.gz 2 | -------------------------------------------------------------------------------- /releases/v0.3.0/clusterApi.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/releases/v0.3.0/clusterApi.zip -------------------------------------------------------------------------------- /releases/v0.3.0/sha1sum.txt: -------------------------------------------------------------------------------- 1 | 798157ee495591e08bdd70a546ce37625d3e3f6c cluster-api-provider-cloudstack-v0.3.0.tar.gz 2 | -------------------------------------------------------------------------------- /releases/v0.4.0/clusterApi.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/releases/v0.4.0/clusterApi.zip -------------------------------------------------------------------------------- /releases/v0.4.0/sha1sum.txt: -------------------------------------------------------------------------------- 1 | 3ec165162ccd259ffcc6ff83bceeb64cc047a173 cluster-api-provider-cloudstack-v0.4.0.tar.gz 2 | -------------------------------------------------------------------------------- /releases/v0.4.1/clusterApi.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/releases/v0.4.1/clusterApi.zip -------------------------------------------------------------------------------- /releases/v0.4.1/sha1sum.txt: -------------------------------------------------------------------------------- 1 | a6cfd64bc5f7099cd4ab22797c573e6b880e016b cluster-api-provider-cloudstack-v0.4.1.tar.gz 2 | -------------------------------------------------------------------------------- /releases/v0.4.2/clusterApi.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/releases/v0.4.2/clusterApi.zip -------------------------------------------------------------------------------- /releases/v0.4.2/security_findings.txt: -------------------------------------------------------------------------------- 1 | No changes to go.mod since v0.4.1. Please refer to security_findings.csv for release v0.4.1 for details. 2 | 3 | -------------------------------------------------------------------------------- /releases/v0.4.2/shasum.txt: -------------------------------------------------------------------------------- 1 | 4a61d056085cf929377ff56fe1ceeeb189d43a7d cluster-api-provider-cloudstack-v0.4.2.tar.gz 2 | -------------------------------------------------------------------------------- /releases/v0.4.3/clusterApi.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/releases/v0.4.3/clusterApi.zip -------------------------------------------------------------------------------- /releases/v0.4.3/sha1sum.txt: -------------------------------------------------------------------------------- 1 | 8eaa03732c9c1dc57b2c198a38c110f7a6acdc5c cluster-api-provider-cloudstack-v0.4.3.tar.gz 2 | -------------------------------------------------------------------------------- /releases/v0.4.4/clusterApi.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-cloudstack/312a3c990e610b8bfda61ecd1ed2dd2305fa9e78/releases/v0.4.4/clusterApi.zip -------------------------------------------------------------------------------- /releases/v0.4.4/sha1sum.txt: -------------------------------------------------------------------------------- 1 | 734789e178c47a14eac78ac55dfef03e29b933f0 cluster-api-provider-cloudstack-v0.4.4.tar.gz 2 | -------------------------------------------------------------------------------- /templates/controlPlaneMachineHealthCheck.yaml: -------------------------------------------------------------------------------- 1 | # This custom resource can be optionally be defined for a cluster, enabling CAPI Machine Health Checking 2 | # for its control plane nodes. See https://cluster-api.sigs.k8s.io/tasks/healthcheck.html 3 | # 4 | # This has intentionally been segregated from the cluster-templates, as it introduces a few complexities 5 | # surrounding CNIs: 6 | # - The CNI must be deployed and the cluster nodes become ready within the nodeStartTimeout (or else 7 | # the MachineHealthCheck remediation processes will begin terminating the unready worker nodes). 8 | # - Certain CNIs have been observed to hang the MachineHealthCheck remediation processes's attempts 9 | # to delete the failed node (inability to drain). 10 | # As such, the deployment of this component is left to the discretion of the cluster deployer. 11 | # If deployed independently of cluster-template, be sure to replace the placeholders in the below 12 | # before applying it to your management cluster. 13 | --- 14 | apiVersion: cluster.x-k8s.io/v1beta1 15 | kind: MachineHealthCheck 16 | metadata: 17 | name: ${CLUSTER_NAME}-kcp-unhealthy-2m 18 | spec: 19 | clusterName: ${CLUSTER_NAME} 20 | maxUnhealthy: 100% 21 | # nodeStartupTimeout: 10m 22 | selector: 23 | matchLabels: 24 | cluster.x-k8s.io/control-plane: "" 25 | unhealthyConditions: 26 | - type: Ready 27 | status: Unknown 28 | timeout: 120s 29 | - type: Ready 30 | status: "False" 31 | timeout: 120s 32 | -------------------------------------------------------------------------------- /templates/workerMachineHealthCheck.yaml: -------------------------------------------------------------------------------- 1 | # This custom resource can be optionally be defined for a cluster, enabling CAPI Machine Health Checking 2 | # for its worker nodes. See https://cluster-api.sigs.k8s.io/tasks/healthcheck.html 3 | # 4 | # This has intentionally been segregated from the cluster-templates, as it introduces a few complexities 5 | # surrounding CNIs: 6 | # - The CNI must be deployed and the cluster nodes become ready within the nodeStartTimeout (or else 7 | # the MachineHealthCheck remediation processes will begin terminating the unready worker nodes). 8 | # - Certain CNIs have been observed to hang the MachineHealthCheck remediation processes's attempts 9 | # to delete the failed node (inability to drain). 10 | # As such, the deployment of this component is left to the discretion of the cluster deployer. 11 | # If deployed independently of cluster-template, be sure to replace the placeholders in the below 12 | # before applying it to your management cluster. 13 | --- 14 | apiVersion: cluster.x-k8s.io/v1beta1 15 | kind: MachineHealthCheck 16 | metadata: 17 | name: ${CLUSTER_NAME}-workers-unhealthy-2m 18 | spec: 19 | clusterName: ${CLUSTER_NAME} 20 | maxUnhealthy: 100% 21 | nodeStartupTimeout: 10m 22 | selector: 23 | matchLabels: 24 | cluster.x-k8s.io/deployment-name: ${CLUSTER_NAME}-md-0 25 | unhealthyConditions: 26 | - type: Ready 27 | status: Unknown 28 | timeout: 120s 29 | - type: Ready 30 | status: "False" 31 | timeout: 120s 32 | -------------------------------------------------------------------------------- /test/e2e/.gitignore: -------------------------------------------------------------------------------- 1 | kind-install-for-capd.sh 2 | data/infrastructure-cloudstack/v1beta1/*.yaml -------------------------------------------------------------------------------- /test/e2e/affinity_group_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2020 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | "context" 24 | 25 | . "github.com/onsi/ginkgo/v2" 26 | ) 27 | 28 | var _ = Describe("When testing affinity group", func() { 29 | AffinityGroupSpec(context.TODO(), func() CommonSpecInput { 30 | return CommonSpecInput{ 31 | E2EConfig: e2eConfig, 32 | ClusterctlConfigPath: clusterctlConfigPath, 33 | BootstrapClusterProxy: bootstrapClusterProxy, 34 | ArtifactFolder: artifactFolder, 35 | SkipCleanup: skipCleanup, 36 | } 37 | }) 38 | 39 | }) 40 | -------------------------------------------------------------------------------- /test/e2e/custom_disk_offering_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2021 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | "context" 24 | 25 | . "github.com/onsi/ginkgo/v2" 26 | ) 27 | 28 | var _ = Describe("When testing with custom disk offering", func() { 29 | 30 | CustomDiskOfferingSpec(context.TODO(), func() CommonSpecInput { 31 | return CommonSpecInput{ 32 | E2EConfig: e2eConfig, 33 | ClusterctlConfigPath: clusterctlConfigPath, 34 | BootstrapClusterProxy: bootstrapClusterProxy, 35 | ArtifactFolder: artifactFolder, 36 | SkipCleanup: skipCleanup, 37 | } 38 | }) 39 | 40 | }) 41 | -------------------------------------------------------------------------------- /test/e2e/data/ci-artifacts-platform-kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Can be used to modify the resources when use-ci-artifacts is enabled. 2 | # Be careful arrays are completely overwritten with 'patchesStrategicMerge'. 3 | # We currently don't need to patch anything, but the shared util func (GenerateCIArtifactsInjectedTemplateForDebian) 4 | # which is using this does not allow an empty patch 5 | --- 6 | apiVersion: controlplane.cluster.x-k8s.io/v1beta1 7 | kind: KubeadmControlPlane 8 | metadata: 9 | name: ${CLUSTER_NAME}-control-plane 10 | spec: 11 | version: ${KUBERNETES_VERSION} 12 | -------------------------------------------------------------------------------- /test/e2e/data/fixture/expected-webpage.html: -------------------------------------------------------------------------------- 1 |

It works!

2 | -------------------------------------------------------------------------------- /test/e2e/data/fixture/sample-application.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: httpd 5 | spec: 6 | ports: 7 | - port: 8080 8 | targetPort: 80 9 | selector: 10 | app: httpd 11 | --- 12 | apiVersion: apps/v1 13 | kind: Deployment 14 | metadata: 15 | name: httpd 16 | spec: 17 | replicas: 1 18 | selector: 19 | matchLabels: 20 | app: httpd 21 | template: 22 | metadata: 23 | labels: 24 | app: httpd 25 | spec: 26 | containers: 27 | - image: httpd 28 | name: httpd 29 | ports: 30 | - containerPort: 80 31 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/bases/md.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: cluster.x-k8s.io/v1beta1 3 | kind: MachineDeployment 4 | metadata: 5 | name: "${CLUSTER_NAME}-md-0" 6 | spec: 7 | clusterName: "${CLUSTER_NAME}" 8 | replicas: ${WORKER_MACHINE_COUNT} 9 | selector: 10 | matchLabels: null 11 | template: 12 | spec: 13 | clusterName: "${CLUSTER_NAME}" 14 | version: ${KUBERNETES_VERSION} 15 | bootstrap: 16 | configRef: 17 | name: "${CLUSTER_NAME}-md-0" 18 | apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 19 | kind: KubeadmConfigTemplate 20 | infrastructureRef: 21 | name: "${CLUSTER_NAME}-md-0" 22 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 23 | kind: CloudStackMachineTemplate 24 | --- 25 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 26 | kind: CloudStackMachineTemplate 27 | metadata: 28 | name: ${CLUSTER_NAME}-md-0 29 | spec: 30 | template: 31 | spec: 32 | offering: 33 | name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} 34 | template: 35 | name: ${CLOUDSTACK_TEMPLATE_NAME} 36 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 37 | --- 38 | apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 39 | kind: KubeadmConfigTemplate 40 | metadata: 41 | name: ${CLUSTER_NAME}-md-0 42 | spec: 43 | template: 44 | spec: 45 | joinConfiguration: 46 | nodeRegistration: 47 | name: '{{ local_hostname }}' 48 | kubeletExtraArgs: 49 | provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' 50 | preKubeadmCommands: 51 | - swapoff -a -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-affinity-group-anti/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-affinity-group-anti/md.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 3 | kind: CloudStackMachineTemplate 4 | metadata: 5 | name: ${CLUSTER_NAME}-control-plane 6 | spec: 7 | template: 8 | spec: 9 | offering: 10 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 11 | template: 12 | name: ${CLOUDSTACK_TEMPLATE_NAME} 13 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 14 | affinity: anti 15 | --- 16 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 17 | kind: CloudStackMachineTemplate 18 | metadata: 19 | name: ${CLUSTER_NAME}-md-0 20 | spec: 21 | template: 22 | spec: 23 | offering: 24 | name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} 25 | template: 26 | name: ${CLOUDSTACK_TEMPLATE_NAME} 27 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 28 | affinity: anti 29 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-affinity-group-pro/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-affinity-group-pro/md.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 3 | kind: CloudStackMachineTemplate 4 | metadata: 5 | name: ${CLUSTER_NAME}-control-plane 6 | spec: 7 | template: 8 | spec: 9 | offering: 10 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 11 | template: 12 | name: ${CLOUDSTACK_TEMPLATE_NAME} 13 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 14 | affinity: pro 15 | --- 16 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 17 | kind: CloudStackMachineTemplate 18 | metadata: 19 | name: ${CLUSTER_NAME}-md-0 20 | spec: 21 | template: 22 | spec: 23 | offering: 24 | name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} 25 | template: 26 | name: ${CLOUDSTACK_TEMPLATE_NAME} 27 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 28 | affinity: pro 29 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-custom-disk-offering/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cluster-with-custom-disk-offering.yaml 7 | - ./md.yaml 8 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-disk-offering/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cluster-with-disk-offering.yaml 7 | - ./md.yaml 8 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-insufficient-compute-resources-for-upgrade/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | - upgrade.yaml 5 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-insufficient-compute-resources-for-upgrade/upgrade.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-upgrade-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_IMPOSSIBLE_CONTROL_PLANE_MACHINE_OFFERING} 10 | template: 11 | name: ${CLOUDSTACK_TEMPLATE_NAME} 12 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 13 | --- 14 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 15 | kind: CloudStackMachineTemplate 16 | metadata: 17 | name: ${CLUSTER_NAME}-upgrade-md-0 18 | spec: 19 | template: 20 | spec: 21 | offering: 22 | name: ${CLOUDSTACK_IMPOSSIBLE_WORKER_MACHINE_OFFERING} 23 | template: 24 | name: ${CLOUDSTACK_TEMPLATE_NAME} 25 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 26 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-insufficient-compute-resources/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-insufficient-compute-resources/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_IMPOSSIBLE_CONTROL_PLANE_MACHINE_OFFERING} 10 | template: 11 | name: ${CLOUDSTACK_TEMPLATE_NAME} 12 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-invalid-account/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | zones: 7 | - name : ${CLOUDSTACK_ZONE_NAME} 8 | network: 9 | name: ${CLOUDSTACK_NETWORK_NAME} 10 | account: ${CLOUDSTACK_INVALID_ACCOUNT_NAME} 11 | domain: ${CLOUDSTACK_DOMAIN_NAME} 12 | controlPlaneEndpoint: 13 | host: "" 14 | port: 6443 15 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-invalid-account/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-invalid-cp-offering/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-invalid-cp-offering/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_INVALID_CONTROL_PLANE_MACHINE_OFFERING} 10 | template: 11 | name: ${CLOUDSTACK_TEMPLATE_NAME} 12 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-invalid-disk-offering-size-for-customized/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-invalid-disk-offering-size-for-customized/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 10 | diskOffering: 11 | name: ${CLOUDSTACK_CUSTOM_DISK_OFFERING_NAME} 12 | mountPath: /disk 13 | device: /dev/vdb 14 | filesystem: ext4 15 | label: my_disk 16 | template: 17 | name: ${CLOUDSTACK_TEMPLATE_NAME} 18 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-invalid-disk-offering-size-for-non-customized/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-invalid-disk-offering-size-for-non-customized/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 10 | diskOffering: 11 | name: ${CLOUDSTACK_DISK_OFFERING_NAME} 12 | customSizeInGB: 1 13 | mountPath: /disk 14 | device: /dev/vdb 15 | filesystem: ext4 16 | label: my_disk 17 | template: 18 | name: ${CLOUDSTACK_TEMPLATE_NAME} 19 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-invalid-disk-offering/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-invalid-disk-offering/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 10 | diskOffering: 11 | name: ${CLOUDSTACK_INVALID_DISK_OFFERING_NAME} 12 | mountPath: /disk 13 | device: /dev/vdb 14 | filesystem: ext4 15 | label: my_disk 16 | template: 17 | name: ${CLOUDSTACK_TEMPLATE_NAME} 18 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-invalid-domain/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | zones: 7 | - name : ${CLOUDSTACK_ZONE_NAME} 8 | network: 9 | name: ${CLOUDSTACK_NETWORK_NAME} 10 | account: ${CLOUDSTACK_ACCOUNT_NAME} 11 | domain: ${CLOUDSTACK_INVALID_DOMAIN_NAME} 12 | controlPlaneEndpoint: 13 | host: "" 14 | port: 6443 15 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-invalid-domain/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-invalid-template/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-invalid-template/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 10 | template: 11 | name: ${CLOUDSTACK_INVALID_TEMPLATE_NAME} 12 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-invalid-zone/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | zones: 7 | - name : ${CLOUDSTACK_INVALID_ZONE_NAME} 8 | network: 9 | name: ${CLOUDSTACK_NETWORK_NAME} 10 | controlPlaneEndpoint: 11 | host: "" 12 | port: 6443 -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-invalid-zone/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-machine-remediation/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | - mhc.yaml 5 | 6 | patchesStrategicMerge: 7 | - ./md.yaml 8 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-machine-remediation/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: cluster.x-k8s.io/v1beta1 2 | kind: MachineDeployment 3 | metadata: 4 | name: "${CLUSTER_NAME}-md-0" 5 | spec: 6 | template: 7 | metadata: 8 | labels: 9 | "e2e.mhc.label": "" 10 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-machine-remediation/mhc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: cluster.x-k8s.io/v1beta1 3 | kind: MachineHealthCheck 4 | metadata: 5 | name: "${CLUSTER_NAME}-mhc-md-0" 6 | spec: 7 | clusterName: "${CLUSTER_NAME}" 8 | maxUnhealthy: 100% 9 | selector: 10 | matchLabels: 11 | e2e.mhc.label: "" 12 | unhealthyConditions: 13 | - type: Ready 14 | status: Unknown 15 | timeout: 60s 16 | - type: Ready 17 | status: "False" 18 | timeout: 60s 19 | --- 20 | apiVersion: cluster.x-k8s.io/v1beta1 21 | kind: MachineHealthCheck 22 | metadata: 23 | name: "${CLUSTER_NAME}-mhc-control-plane-0" 24 | spec: 25 | clusterName: "${CLUSTER_NAME}" 26 | maxUnhealthy: 100% 27 | selector: 28 | matchLabels: 29 | cluster.x-k8s.io/control-plane: "" 30 | unhealthyConditions: 31 | - type: Ready 32 | status: Unknown 33 | timeout: 60s 34 | - type: Ready 35 | status: "False" 36 | timeout: 60s -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-node-drain/cluster-with-kcp.yaml: -------------------------------------------------------------------------------- 1 | # KubeadmControlPlane referenced by the Cluster object with 2 | # - the label kcp-adoption.step2, because it should be created in the second step of the kcp-adoption test. 3 | kind: KubeadmControlPlane 4 | apiVersion: controlplane.cluster.x-k8s.io/v1beta1 5 | metadata: 6 | name: "${CLUSTER_NAME}-control-plane" 7 | spec: 8 | machineTemplate: 9 | nodeDrainTimeout: ${NODE_DRAIN_TIMEOUT} 10 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-node-drain/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/md.yaml 3 | - ../bases/cluster-with-kcp.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | - ./cluster-with-kcp.yaml 8 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-node-drain/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: cluster.x-k8s.io/v1beta1 2 | kind: MachineDeployment 3 | metadata: 4 | name: "${CLUSTER_NAME}-md-0" 5 | spec: 6 | template: 7 | spec: 8 | nodeDrainTimeout: "${NODE_DRAIN_TIMEOUT}" 9 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-resource-cleanup/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | zones: 7 | - name : ${CLOUDSTACK_ZONE_NAME} 8 | network: 9 | name: ${CLOUDSTACK_NEW_NETWORK_NAME} 10 | controlPlaneEndpoint: 11 | host: "" 12 | port: 6443 13 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-resource-cleanup/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-second-cluster/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | zones: 7 | - name: ${CLOUDSTACK_ZONE_NAME} 8 | network: 9 | name: ${CLOUDSTACK_NETWORK_NAME} 10 | account: ${CLOUDSTACK_ACCOUNT_NAME} 11 | domain: ${CLOUDSTACK_DOMAIN_NAME} 12 | controlPlaneEndpoint: 13 | host: ${CLUSTER_ENDPOINT_IP_2} 14 | port: 6443 15 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-second-cluster/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-shared-network-kubevip/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ./cluster-with-shared-network-and-kubevip.yaml 3 | - ../bases/md.yaml 4 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-subdomain/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | zones: 7 | - name : ${CLOUDSTACK_ZONE_NAME} 8 | network: 9 | name: ${CLOUDSTACK_NETWORK_NAME} 10 | account: ${CLOUDSTACK_SUBDOMAIN_ACCOUNT_NAME} 11 | domain: ${CLOUDSTACK_SUBDOMAIN_PATH} 12 | controlPlaneEndpoint: 13 | host: "" 14 | port: 6443 15 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-subdomain/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | - ./md.yaml 8 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template-subdomain/md.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 3 | kind: CloudStackMachineTemplate 4 | metadata: 5 | name: ${CLUSTER_NAME}-control-plane 6 | spec: 7 | template: 8 | spec: 9 | offering: 10 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 11 | template: 12 | name: ${CLOUDSTACK_TEMPLATE_NAME} 13 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 14 | affinity: pro 15 | --- 16 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 17 | kind: CloudStackMachineTemplate 18 | metadata: 19 | name: ${CLUSTER_NAME}-md-0 20 | spec: 21 | template: 22 | spec: 23 | offering: 24 | name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} 25 | template: 26 | name: ${CLOUDSTACK_TEMPLATE_NAME} 27 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 28 | affinity: pro 29 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta1/cluster-template/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/bases/md.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: cluster.x-k8s.io/v1beta1 3 | kind: MachineDeployment 4 | metadata: 5 | name: "${CLUSTER_NAME}-md-0" 6 | spec: 7 | clusterName: "${CLUSTER_NAME}" 8 | replicas: ${WORKER_MACHINE_COUNT} 9 | selector: 10 | matchLabels: null 11 | template: 12 | spec: 13 | clusterName: "${CLUSTER_NAME}" 14 | version: ${KUBERNETES_VERSION} 15 | bootstrap: 16 | configRef: 17 | name: "${CLUSTER_NAME}-md-0" 18 | apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 19 | kind: KubeadmConfigTemplate 20 | infrastructureRef: 21 | name: "${CLUSTER_NAME}-md-0" 22 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 23 | kind: CloudStackMachineTemplate 24 | --- 25 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 26 | kind: CloudStackMachineTemplate 27 | metadata: 28 | name: ${CLUSTER_NAME}-md-0 29 | spec: 30 | template: 31 | spec: 32 | offering: 33 | name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} 34 | template: 35 | name: ${CLOUDSTACK_TEMPLATE_NAME} 36 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 37 | --- 38 | apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 39 | kind: KubeadmConfigTemplate 40 | metadata: 41 | name: ${CLUSTER_NAME}-md-0 42 | spec: 43 | template: 44 | spec: 45 | joinConfiguration: 46 | nodeRegistration: 47 | name: '{{ local_hostname }}' 48 | kubeletExtraArgs: 49 | provider-id: "cloudstack:///'{{ ds.meta_data.instance_id }}'" 50 | preKubeadmCommands: 51 | - swapoff -a 52 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-affinity-group-anti/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-affinity-group-anti/md.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 3 | kind: CloudStackMachineTemplate 4 | metadata: 5 | name: ${CLUSTER_NAME}-control-plane 6 | spec: 7 | template: 8 | spec: 9 | offering: 10 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 11 | template: 12 | name: ${CLOUDSTACK_TEMPLATE_NAME} 13 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 14 | affinity: anti 15 | --- 16 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 17 | kind: CloudStackMachineTemplate 18 | metadata: 19 | name: ${CLUSTER_NAME}-md-0 20 | spec: 21 | template: 22 | spec: 23 | offering: 24 | name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} 25 | template: 26 | name: ${CLOUDSTACK_TEMPLATE_NAME} 27 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 28 | affinity: anti 29 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-affinity-group-pro/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-affinity-group-pro/md.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 3 | kind: CloudStackMachineTemplate 4 | metadata: 5 | name: ${CLUSTER_NAME}-control-plane 6 | spec: 7 | template: 8 | spec: 9 | offering: 10 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 11 | template: 12 | name: ${CLOUDSTACK_TEMPLATE_NAME} 13 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 14 | affinity: pro 15 | --- 16 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 17 | kind: CloudStackMachineTemplate 18 | metadata: 19 | name: ${CLUSTER_NAME}-md-0 20 | spec: 21 | template: 22 | spec: 23 | offering: 24 | name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} 25 | template: 26 | name: ${CLOUDSTACK_TEMPLATE_NAME} 27 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 28 | affinity: pro 29 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-custom-disk-offering/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cluster-with-custom-disk-offering.yaml 7 | - ./md.yaml 8 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-disk-offering/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cluster-with-disk-offering.yaml 7 | - ./md.yaml 8 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-insufficient-compute-resources-for-upgrade/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | - upgrade.yaml 5 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-insufficient-compute-resources-for-upgrade/upgrade.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-upgrade-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_IMPOSSIBLE_CONTROL_PLANE_MACHINE_OFFERING} 10 | template: 11 | name: ${CLOUDSTACK_TEMPLATE_NAME} 12 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 13 | --- 14 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 15 | kind: CloudStackMachineTemplate 16 | metadata: 17 | name: ${CLUSTER_NAME}-upgrade-md-0 18 | spec: 19 | template: 20 | spec: 21 | offering: 22 | name: ${CLOUDSTACK_IMPOSSIBLE_WORKER_MACHINE_OFFERING} 23 | template: 24 | name: ${CLOUDSTACK_TEMPLATE_NAME} 25 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 26 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-insufficient-compute-resources/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-insufficient-compute-resources/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_IMPOSSIBLE_CONTROL_PLANE_MACHINE_OFFERING} 10 | template: 11 | name: ${CLOUDSTACK_TEMPLATE_NAME} 12 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 13 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-account/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | failureDomains: 7 | - name: ${CLOUDSTACK_FD1_NAME} 8 | acsEndpoint: 9 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 10 | namespace: default 11 | zone: 12 | name : ${CLOUDSTACK_ZONE_NAME} 13 | network: 14 | name: ${CLOUDSTACK_NETWORK_NAME} 15 | account: ${CLOUDSTACK_INVALID_ACCOUNT_NAME} 16 | domain: ${CLOUDSTACK_DOMAIN_NAME} 17 | controlPlaneEndpoint: 18 | host: "" 19 | port: 6443 20 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-account/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-cp-offering/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-cp-offering/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_INVALID_CONTROL_PLANE_MACHINE_OFFERING} 10 | template: 11 | name: ${CLOUDSTACK_TEMPLATE_NAME} 12 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 13 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-disk-offering-size-for-customized/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-disk-offering-size-for-customized/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 10 | diskOffering: 11 | name: ${CLOUDSTACK_CUSTOM_DISK_OFFERING_NAME} 12 | mountPath: /disk 13 | device: /dev/vdb 14 | filesystem: ext4 15 | label: my_disk 16 | template: 17 | name: ${CLOUDSTACK_TEMPLATE_NAME} 18 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 19 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-disk-offering-size-for-non-customized/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-disk-offering-size-for-non-customized/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 10 | diskOffering: 11 | name: ${CLOUDSTACK_DISK_OFFERING_NAME} 12 | customSizeInGB: 1 13 | mountPath: /disk 14 | device: /dev/vdb 15 | filesystem: ext4 16 | label: my_disk 17 | template: 18 | name: ${CLOUDSTACK_TEMPLATE_NAME} 19 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 20 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-disk-offering/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-disk-offering/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 10 | diskOffering: 11 | name: ${CLOUDSTACK_INVALID_DISK_OFFERING_NAME} 12 | mountPath: /disk 13 | device: /dev/vdb 14 | filesystem: ext4 15 | label: my_disk 16 | template: 17 | name: ${CLOUDSTACK_TEMPLATE_NAME} 18 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 19 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-domain/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | failureDomains: 7 | - name: ${CLOUDSTACK_FD1_NAME} 8 | acsEndpoint: 9 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 10 | namespace: default 11 | zone: 12 | name: ${CLOUDSTACK_ZONE_NAME} 13 | network: 14 | name: ${CLOUDSTACK_NETWORK_NAME} 15 | account: ${CLOUDSTACK_ACCOUNT_NAME} 16 | domain: ${CLOUDSTACK_INVALID_DOMAIN_NAME} 17 | controlPlaneEndpoint: 18 | host: "" 19 | port: 6443 20 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-domain/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-ip/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | failureDomains: 7 | - name: ${CLOUDSTACK_FD1_NAME} 8 | acsEndpoint: 9 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 10 | namespace: default 11 | zone: 12 | name: ${CLOUDSTACK_ZONE_NAME} 13 | network: 14 | name: ${CLOUDSTACK_NETWORK_NAME} 15 | controlPlaneEndpoint: 16 | host: ${CLOUDSTACK_INVALID_IP} 17 | port: 6443 -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-ip/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-template/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-template/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 10 | template: 11 | name: ${CLOUDSTACK_INVALID_TEMPLATE_NAME} 12 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 13 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-zone/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | failureDomains: 7 | - acsEndpoint: 8 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 9 | namespace: default 10 | name: ${CLOUDSTACK_FD1_NAME} 11 | zone: 12 | name: ${CLOUDSTACK_INVALID_ZONE_NAME} 13 | network: 14 | name: ${CLOUDSTACK_NETWORK_NAME} 15 | controlPlaneEndpoint: 16 | host: "" 17 | port: 6443 18 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-invalid-zone/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-kubernetes-version-upgrade-after/cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: cluster.x-k8s.io/v1beta1 2 | kind: Cluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | clusterNetwork: 7 | pods: 8 | cidrBlocks: 9 | - 192.168.0.0/16 10 | serviceDomain: "cluster.local" 11 | infrastructureRef: 12 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 13 | kind: CloudStackCluster 14 | name: ${CLUSTER_NAME} 15 | controlPlaneRef: 16 | kind: KubeadmControlPlane 17 | apiVersion: controlplane.cluster.x-k8s.io/v1beta1 18 | name: ${CLUSTER_NAME}-control-plane 19 | --- 20 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 21 | kind: CloudStackCluster 22 | metadata: 23 | name: ${CLUSTER_NAME} 24 | spec: 25 | failureDomains: 26 | - name: ${CLOUDSTACK_FD1_NAME} 27 | acsEndpoint: 28 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 29 | namespace: default 30 | zone: 31 | name: ${CLOUDSTACK_ZONE_NAME} 32 | network: 33 | name: ${CLOUDSTACK_NETWORK_NAME} 34 | controlPlaneEndpoint: 35 | host: ${CLUSTER_ENDPOINT_IP} 36 | port: 6443 37 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-kubernetes-version-upgrade-after/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ./cluster.yaml 3 | - ./upgrade-md.yaml 4 | - ./upgrade-cp.yaml 5 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-kubernetes-version-upgrade-after/upgrade-cp.yaml: -------------------------------------------------------------------------------- 1 | kind: KubeadmControlPlane 2 | apiVersion: controlplane.cluster.x-k8s.io/v1beta1 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | kubeadmConfigSpec: 7 | initConfiguration: 8 | nodeRegistration: 9 | name: '{{ local_hostname }}' 10 | kubeletExtraArgs: 11 | provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' 12 | clusterConfiguration: 13 | imageRepository: "" 14 | joinConfiguration: 15 | nodeRegistration: 16 | name: '{{ local_hostname }}' 17 | kubeletExtraArgs: 18 | provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' 19 | preKubeadmCommands: 20 | - swapoff -a 21 | machineTemplate: 22 | infrastructureRef: 23 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 24 | kind: CloudStackMachineTemplate 25 | name: ${CLUSTER_NAME}-control-plane-upgraded 26 | replicas: ${CONTROL_PLANE_MACHINE_COUNT} 27 | version: ${KUBERNETES_VERSION_UPGRADE_TO} 28 | --- 29 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 30 | kind: CloudStackMachineTemplate 31 | metadata: 32 | name: ${CLUSTER_NAME}-control-plane-upgraded 33 | spec: 34 | template: 35 | spec: 36 | offering: 37 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 38 | template: 39 | name: ${CLOUDSTACK_UPGRADE_TO_TEMPLATE_NAME} 40 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 41 | --- -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-kubernetes-version-upgrade-after/upgrade-md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: cluster.x-k8s.io/v1beta1 2 | kind: MachineDeployment 3 | metadata: 4 | name: "${CLUSTER_NAME}-md-0" 5 | spec: 6 | clusterName: "${CLUSTER_NAME}" 7 | replicas: ${WORKER_MACHINE_COUNT} 8 | selector: 9 | matchLabels: null 10 | template: 11 | spec: 12 | clusterName: "${CLUSTER_NAME}" 13 | version: ${KUBERNETES_VERSION_UPGRADE_TO} 14 | bootstrap: 15 | configRef: 16 | name: "${CLUSTER_NAME}-md-0" 17 | apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 18 | kind: KubeadmConfigTemplate 19 | infrastructureRef: 20 | name: "${CLUSTER_NAME}-md-1" 21 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 22 | kind: CloudStackMachineTemplate 23 | --- 24 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 25 | kind: CloudStackMachineTemplate 26 | metadata: 27 | name: ${CLUSTER_NAME}-md-1 28 | spec: 29 | template: 30 | spec: 31 | offering: 32 | name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} 33 | template: 34 | name: ${CLOUDSTACK_UPGRADE_TO_TEMPLATE_NAME} 35 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 36 | --- 37 | apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 38 | kind: KubeadmConfigTemplate 39 | metadata: 40 | name: ${CLUSTER_NAME}-md-0 41 | spec: 42 | template: 43 | spec: 44 | joinConfiguration: 45 | nodeRegistration: 46 | name: '{{ local_hostname }}' 47 | kubeletExtraArgs: 48 | provider-id: "cloudstack:///'{{ ds.meta_data.instance_id }}'" 49 | preKubeadmCommands: 50 | - swapoff -a 51 | 52 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-kubernetes-version-upgrade-before/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | failureDomains: 7 | - name: ${CLOUDSTACK_FD1_NAME} 8 | acsEndpoint: 9 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 10 | namespace: default 11 | zone: 12 | name: ${CLOUDSTACK_ZONE_NAME} 13 | network: 14 | name: ${CLOUDSTACK_NETWORK_NAME} 15 | controlPlaneEndpoint: 16 | host: ${CLUSTER_ENDPOINT_IP} 17 | port: 6443 18 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-kubernetes-version-upgrade-before/kustomization.yaml: -------------------------------------------------------------------------------- 1 | 2 | bases: 3 | - ../bases/cluster-with-kcp.yaml 4 | - ../bases/md.yaml 5 | 6 | patchesStrategicMerge: 7 | - ./cloudstack-cluster.yaml 8 | - ./before.yaml 9 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-machine-remediation/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | - mhc.yaml 5 | 6 | patchesStrategicMerge: 7 | - ./md.yaml 8 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-machine-remediation/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: cluster.x-k8s.io/v1beta1 2 | kind: MachineDeployment 3 | metadata: 4 | name: "${CLUSTER_NAME}-md-0" 5 | spec: 6 | template: 7 | metadata: 8 | labels: 9 | "e2e.mhc.label": "" 10 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-machine-remediation/mhc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: cluster.x-k8s.io/v1beta1 3 | kind: MachineHealthCheck 4 | metadata: 5 | name: "${CLUSTER_NAME}-mhc-md-0" 6 | spec: 7 | clusterName: "${CLUSTER_NAME}" 8 | maxUnhealthy: 100% 9 | selector: 10 | matchLabels: 11 | e2e.mhc.label: "" 12 | unhealthyConditions: 13 | - type: Ready 14 | status: Unknown 15 | timeout: 60s 16 | - type: Ready 17 | status: "False" 18 | timeout: 60s 19 | --- 20 | apiVersion: cluster.x-k8s.io/v1beta1 21 | kind: MachineHealthCheck 22 | metadata: 23 | name: "${CLUSTER_NAME}-mhc-control-plane-0" 24 | spec: 25 | clusterName: "${CLUSTER_NAME}" 26 | maxUnhealthy: 100% 27 | selector: 28 | matchLabels: 29 | cluster.x-k8s.io/control-plane: "" 30 | unhealthyConditions: 31 | - type: Ready 32 | status: Unknown 33 | timeout: 60s 34 | - type: Ready 35 | status: "False" 36 | timeout: 60s -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-node-drain/cluster-with-kcp.yaml: -------------------------------------------------------------------------------- 1 | # KubeadmControlPlane referenced by the Cluster object with 2 | # - the label kcp-adoption.step2, because it should be created in the second step of the kcp-adoption test. 3 | kind: KubeadmControlPlane 4 | apiVersion: controlplane.cluster.x-k8s.io/v1beta1 5 | metadata: 6 | name: "${CLUSTER_NAME}-control-plane" 7 | spec: 8 | machineTemplate: 9 | nodeDrainTimeout: ${NODE_DRAIN_TIMEOUT} 10 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-node-drain/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/md.yaml 3 | - ../bases/cluster-with-kcp.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | - ./cluster-with-kcp.yaml 8 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-node-drain/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: cluster.x-k8s.io/v1beta1 2 | kind: MachineDeployment 3 | metadata: 4 | name: "${CLUSTER_NAME}-md-0" 5 | spec: 6 | template: 7 | spec: 8 | nodeDrainTimeout: "${NODE_DRAIN_TIMEOUT}" 9 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-resource-cleanup/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | failureDomains: 7 | - acsEndpoint: 8 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 9 | namespace: default 10 | name: ${CLOUDSTACK_FD1_NAME} 11 | zone: 12 | name: ${CLOUDSTACK_ZONE_NAME} 13 | network: 14 | name: ${CLOUDSTACK_NEW_NETWORK_NAME} 15 | controlPlaneEndpoint: 16 | host: "" 17 | port: 6443 18 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-resource-cleanup/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-second-cluster/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | failureDomains: 7 | - name: ${CLOUDSTACK_FD1_NAME} 8 | acsEndpoint: 9 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 10 | namespace: default 11 | zone: 12 | name : ${CLOUDSTACK_ZONE_NAME} 13 | network: 14 | name: ${CLOUDSTACK_NETWORK_NAME} 15 | account: ${CLOUDSTACK_ACCOUNT_NAME} 16 | domain: ${CLOUDSTACK_DOMAIN_NAME} 17 | controlPlaneEndpoint: 18 | host: ${CLUSTER_ENDPOINT_IP_2} 19 | port: 6443 20 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-second-cluster/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-shared-network-kubevip/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ./cluster-with-shared-network-and-kubevip.yaml 3 | - ../bases/md.yaml 4 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-subdomain/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | failureDomains: 7 | - name: ${CLOUDSTACK_FD1_NAME} 8 | acsEndpoint: 9 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 10 | namespace: default 11 | zone: 12 | name : ${CLOUDSTACK_ZONE_NAME} 13 | network: 14 | name: ${CLOUDSTACK_NETWORK_NAME} 15 | account: ${CLOUDSTACK_SUBDOMAIN_ACCOUNT_NAME} 16 | domain: ${CLOUDSTACK_SUBDOMAIN_PATH} 17 | controlPlaneEndpoint: 18 | host: "" 19 | port: 6443 20 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-subdomain/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | - ./md.yaml 8 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-subdomain/md.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 3 | kind: CloudStackMachineTemplate 4 | metadata: 5 | name: ${CLUSTER_NAME}-control-plane 6 | spec: 7 | template: 8 | spec: 9 | offering: 10 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 11 | template: 12 | name: ${CLOUDSTACK_TEMPLATE_NAME} 13 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 14 | affinity: pro 15 | --- 16 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 17 | kind: CloudStackMachineTemplate 18 | metadata: 19 | name: ${CLUSTER_NAME}-md-0 20 | spec: 21 | template: 22 | spec: 23 | offering: 24 | name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} 25 | template: 26 | name: ${CLOUDSTACK_TEMPLATE_NAME} 27 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 28 | affinity: pro 29 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/bases/md.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: cluster.x-k8s.io/v1beta1 3 | kind: MachineDeployment 4 | metadata: 5 | name: "${CLUSTER_NAME}-md-0" 6 | spec: 7 | clusterName: "${CLUSTER_NAME}" 8 | replicas: ${WORKER_MACHINE_COUNT} 9 | selector: 10 | matchLabels: null 11 | template: 12 | spec: 13 | clusterName: "${CLUSTER_NAME}" 14 | version: ${KUBERNETES_VERSION} 15 | bootstrap: 16 | configRef: 17 | name: "${CLUSTER_NAME}-md-0" 18 | apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 19 | kind: KubeadmConfigTemplate 20 | infrastructureRef: 21 | name: "${CLUSTER_NAME}-md-0" 22 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 23 | kind: CloudStackMachineTemplate 24 | --- 25 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 26 | kind: CloudStackMachineTemplate 27 | metadata: 28 | name: ${CLUSTER_NAME}-md-0 29 | spec: 30 | template: 31 | spec: 32 | offering: 33 | name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} 34 | template: 35 | name: ${CLOUDSTACK_TEMPLATE_NAME} 36 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 37 | --- 38 | apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 39 | kind: KubeadmConfigTemplate 40 | metadata: 41 | name: ${CLUSTER_NAME}-md-0 42 | spec: 43 | template: 44 | spec: 45 | joinConfiguration: 46 | nodeRegistration: 47 | name: '{{ local_hostname }}' 48 | kubeletExtraArgs: 49 | provider-id: "cloudstack:///'{{ ds.meta_data.instance_id }}'" 50 | preKubeadmCommands: 51 | - swapoff -a 52 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-affinity-group-anti/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-affinity-group-anti/md.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 3 | kind: CloudStackMachineTemplate 4 | metadata: 5 | name: ${CLUSTER_NAME}-control-plane 6 | spec: 7 | template: 8 | spec: 9 | offering: 10 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 11 | template: 12 | name: ${CLOUDSTACK_TEMPLATE_NAME} 13 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 14 | affinity: anti 15 | --- 16 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 17 | kind: CloudStackMachineTemplate 18 | metadata: 19 | name: ${CLUSTER_NAME}-md-0 20 | spec: 21 | template: 22 | spec: 23 | offering: 24 | name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} 25 | template: 26 | name: ${CLOUDSTACK_TEMPLATE_NAME} 27 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 28 | affinity: anti 29 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-affinity-group-pro/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-affinity-group-pro/md.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 3 | kind: CloudStackMachineTemplate 4 | metadata: 5 | name: ${CLUSTER_NAME}-control-plane 6 | spec: 7 | template: 8 | spec: 9 | offering: 10 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 11 | template: 12 | name: ${CLOUDSTACK_TEMPLATE_NAME} 13 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 14 | affinity: pro 15 | --- 16 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 17 | kind: CloudStackMachineTemplate 18 | metadata: 19 | name: ${CLUSTER_NAME}-md-0 20 | spec: 21 | template: 22 | spec: 23 | offering: 24 | name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} 25 | template: 26 | name: ${CLOUDSTACK_TEMPLATE_NAME} 27 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 28 | affinity: pro 29 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-custom-disk-offering/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cluster-with-custom-disk-offering.yaml 7 | - ./md.yaml 8 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-custom-vpc-offering/cluster-with-custom-vpc-offering.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 3 | kind: CloudStackCluster 4 | metadata: 5 | name: ${CLUSTER_NAME} 6 | spec: 7 | failureDomains: 8 | - name: ${CLOUDSTACK_FD1_NAME} 9 | acsEndpoint: 10 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 11 | namespace: default 12 | zone: 13 | name: ${CLOUDSTACK_ZONE_NAME} 14 | network: 15 | name: ${CLOUDSTACK_VPC_NETWORK_NAME_WITH_CUSTOM_OFFERING} 16 | gateway: ${CLOUDSTACK_GATEWAY} 17 | netmask: ${CLOUDSTACK_NETMASK} 18 | offering: ${CLOUDSTACK_CUSTOM_VPC_NETWORK_OFFERING_NAME} 19 | vpc: 20 | name: ${CLOUDSTACK_VPC_NAME_WITH_CUSTOM_OFFERING} 21 | cidr: ${CLOUDSTACK_VPC_CIDR} 22 | offering: ${CLOUDSTACK_CUSTOM_VPC_OFFERING_NAME} 23 | controlPlaneEndpoint: 24 | host: "" 25 | port: 6443 26 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-custom-vpc-offering/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cluster-with-custom-vpc-offering.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-disk-offering/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cluster-with-disk-offering.yaml 7 | - ./md.yaml 8 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-insufficient-compute-resources-for-upgrade/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | - upgrade.yaml 5 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-insufficient-compute-resources-for-upgrade/upgrade.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-upgrade-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_IMPOSSIBLE_CONTROL_PLANE_MACHINE_OFFERING} 10 | template: 11 | name: ${CLOUDSTACK_TEMPLATE_NAME} 12 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 13 | --- 14 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 15 | kind: CloudStackMachineTemplate 16 | metadata: 17 | name: ${CLUSTER_NAME}-upgrade-md-0 18 | spec: 19 | template: 20 | spec: 21 | offering: 22 | name: ${CLOUDSTACK_IMPOSSIBLE_WORKER_MACHINE_OFFERING} 23 | template: 24 | name: ${CLOUDSTACK_TEMPLATE_NAME} 25 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 26 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-insufficient-compute-resources/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-insufficient-compute-resources/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_IMPOSSIBLE_CONTROL_PLANE_MACHINE_OFFERING} 10 | template: 11 | name: ${CLOUDSTACK_TEMPLATE_NAME} 12 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 13 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-invalid-account/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | failureDomains: 7 | - name: ${CLOUDSTACK_FD1_NAME} 8 | acsEndpoint: 9 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 10 | namespace: default 11 | zone: 12 | name : ${CLOUDSTACK_ZONE_NAME} 13 | network: 14 | name: ${CLOUDSTACK_NETWORK_NAME} 15 | account: ${CLOUDSTACK_INVALID_ACCOUNT_NAME} 16 | domain: ${CLOUDSTACK_DOMAIN_NAME} 17 | controlPlaneEndpoint: 18 | host: "" 19 | port: 6443 20 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-invalid-account/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-invalid-cp-offering/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-invalid-cp-offering/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_INVALID_CONTROL_PLANE_MACHINE_OFFERING} 10 | template: 11 | name: ${CLOUDSTACK_TEMPLATE_NAME} 12 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 13 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-invalid-disk-offering-size-for-customized/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-invalid-disk-offering-size-for-customized/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 10 | diskOffering: 11 | name: ${CLOUDSTACK_CUSTOM_DISK_OFFERING_NAME} 12 | mountPath: /disk 13 | device: /dev/vdb 14 | filesystem: ext4 15 | label: my_disk 16 | template: 17 | name: ${CLOUDSTACK_TEMPLATE_NAME} 18 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 19 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-invalid-disk-offering-size-for-non-customized/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-invalid-disk-offering-size-for-non-customized/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 10 | diskOffering: 11 | name: ${CLOUDSTACK_DISK_OFFERING_NAME} 12 | customSizeInGB: 1 13 | mountPath: /disk 14 | device: /dev/vdb 15 | filesystem: ext4 16 | label: my_disk 17 | template: 18 | name: ${CLOUDSTACK_TEMPLATE_NAME} 19 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 20 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-invalid-disk-offering/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-invalid-disk-offering/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 10 | diskOffering: 11 | name: ${CLOUDSTACK_INVALID_DISK_OFFERING_NAME} 12 | mountPath: /disk 13 | device: /dev/vdb 14 | filesystem: ext4 15 | label: my_disk 16 | template: 17 | name: ${CLOUDSTACK_TEMPLATE_NAME} 18 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 19 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-invalid-domain/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | failureDomains: 7 | - name: ${CLOUDSTACK_FD1_NAME} 8 | acsEndpoint: 9 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 10 | namespace: default 11 | zone: 12 | name: ${CLOUDSTACK_ZONE_NAME} 13 | network: 14 | name: ${CLOUDSTACK_NETWORK_NAME} 15 | account: ${CLOUDSTACK_ACCOUNT_NAME} 16 | domain: ${CLOUDSTACK_INVALID_DOMAIN_NAME} 17 | controlPlaneEndpoint: 18 | host: "" 19 | port: 6443 20 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-invalid-domain/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-invalid-ip/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | failureDomains: 7 | - name: ${CLOUDSTACK_FD1_NAME} 8 | acsEndpoint: 9 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 10 | namespace: default 11 | zone: 12 | name: ${CLOUDSTACK_ZONE_NAME} 13 | network: 14 | name: ${CLOUDSTACK_NETWORK_NAME} 15 | controlPlaneEndpoint: 16 | host: ${CLOUDSTACK_INVALID_IP} 17 | port: 6443 -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-invalid-ip/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-invalid-template/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-invalid-template/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 2 | kind: CloudStackMachineTemplate 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | template: 7 | spec: 8 | offering: 9 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 10 | template: 11 | name: ${CLOUDSTACK_INVALID_TEMPLATE_NAME} 12 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 13 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-invalid-zone/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | failureDomains: 7 | - acsEndpoint: 8 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 9 | namespace: default 10 | name: ${CLOUDSTACK_FD1_NAME} 11 | zone: 12 | name: ${CLOUDSTACK_INVALID_ZONE_NAME} 13 | network: 14 | name: ${CLOUDSTACK_NETWORK_NAME} 15 | controlPlaneEndpoint: 16 | host: "" 17 | port: 6443 18 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-invalid-zone/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-k8s-cks/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 3 | kind: CloudStackCluster 4 | metadata: 5 | name: ${CLUSTER_NAME} 6 | spec: 7 | controlPlaneEndpoint: 8 | host: "" 9 | port: 6443 10 | failureDomains: 11 | - name: ${CLOUDSTACK_FD1_NAME} 12 | acsEndpoint: 13 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 14 | namespace: default 15 | zone: 16 | name : ${CLOUDSTACK_ZONE_NAME} 17 | network: 18 | name: ${CLOUDSTACK_NETWORK_NAME} 19 | syncWithACS: true 20 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-k8s-cks/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-kubernetes-version-upgrade-after/cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: cluster.x-k8s.io/v1beta1 2 | kind: Cluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | clusterNetwork: 7 | pods: 8 | cidrBlocks: 9 | - 192.168.0.0/16 10 | serviceDomain: "cluster.local" 11 | infrastructureRef: 12 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 13 | kind: CloudStackCluster 14 | name: ${CLUSTER_NAME} 15 | controlPlaneRef: 16 | kind: KubeadmControlPlane 17 | apiVersion: controlplane.cluster.x-k8s.io/v1beta1 18 | name: ${CLUSTER_NAME}-control-plane 19 | --- 20 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 21 | kind: CloudStackCluster 22 | metadata: 23 | name: ${CLUSTER_NAME} 24 | spec: 25 | failureDomains: 26 | - name: ${CLOUDSTACK_FD1_NAME} 27 | acsEndpoint: 28 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 29 | namespace: default 30 | zone: 31 | name: ${CLOUDSTACK_ZONE_NAME} 32 | network: 33 | name: ${CLOUDSTACK_NETWORK_NAME} 34 | controlPlaneEndpoint: 35 | host: ${CLUSTER_ENDPOINT_IP} 36 | port: 6443 37 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-kubernetes-version-upgrade-after/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ./cluster.yaml 3 | - ./upgrade-md.yaml 4 | - ./upgrade-cp.yaml 5 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-kubernetes-version-upgrade-after/upgrade-cp.yaml: -------------------------------------------------------------------------------- 1 | kind: KubeadmControlPlane 2 | apiVersion: controlplane.cluster.x-k8s.io/v1beta1 3 | metadata: 4 | name: ${CLUSTER_NAME}-control-plane 5 | spec: 6 | kubeadmConfigSpec: 7 | initConfiguration: 8 | nodeRegistration: 9 | name: '{{ local_hostname }}' 10 | kubeletExtraArgs: 11 | provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' 12 | clusterConfiguration: 13 | imageRepository: "" 14 | joinConfiguration: 15 | nodeRegistration: 16 | name: '{{ local_hostname }}' 17 | kubeletExtraArgs: 18 | provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}' 19 | preKubeadmCommands: 20 | - swapoff -a 21 | machineTemplate: 22 | infrastructureRef: 23 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 24 | kind: CloudStackMachineTemplate 25 | name: ${CLUSTER_NAME}-control-plane-upgraded 26 | replicas: ${CONTROL_PLANE_MACHINE_COUNT} 27 | version: ${KUBERNETES_VERSION_UPGRADE_TO} 28 | --- 29 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 30 | kind: CloudStackMachineTemplate 31 | metadata: 32 | name: ${CLUSTER_NAME}-control-plane-upgraded 33 | spec: 34 | template: 35 | spec: 36 | offering: 37 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 38 | template: 39 | name: ${CLOUDSTACK_UPGRADE_TO_TEMPLATE_NAME} 40 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 41 | --- -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-kubernetes-version-upgrade-before/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | failureDomains: 7 | - name: ${CLOUDSTACK_FD1_NAME} 8 | acsEndpoint: 9 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 10 | namespace: default 11 | zone: 12 | name: ${CLOUDSTACK_ZONE_NAME} 13 | network: 14 | name: ${CLOUDSTACK_NETWORK_NAME} 15 | controlPlaneEndpoint: 16 | host: ${CLUSTER_ENDPOINT_IP} 17 | port: 6443 18 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-kubernetes-version-upgrade-before/kustomization.yaml: -------------------------------------------------------------------------------- 1 | 2 | bases: 3 | - ../bases/cluster-with-kcp.yaml 4 | - ../bases/md.yaml 5 | 6 | patchesStrategicMerge: 7 | - ./cloudstack-cluster.yaml 8 | - ./before.yaml 9 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-machine-remediation/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | - mhc.yaml 5 | 6 | patchesStrategicMerge: 7 | - ./md.yaml 8 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-machine-remediation/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: cluster.x-k8s.io/v1beta1 2 | kind: MachineDeployment 3 | metadata: 4 | name: "${CLUSTER_NAME}-md-0" 5 | spec: 6 | template: 7 | metadata: 8 | labels: 9 | "e2e.mhc.label": "" 10 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-machine-remediation/mhc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: cluster.x-k8s.io/v1beta1 3 | kind: MachineHealthCheck 4 | metadata: 5 | name: "${CLUSTER_NAME}-mhc-md-0" 6 | spec: 7 | clusterName: "${CLUSTER_NAME}" 8 | maxUnhealthy: 100% 9 | selector: 10 | matchLabels: 11 | e2e.mhc.label: "" 12 | unhealthyConditions: 13 | - type: Ready 14 | status: Unknown 15 | timeout: 60s 16 | - type: Ready 17 | status: "False" 18 | timeout: 60s 19 | --- 20 | apiVersion: cluster.x-k8s.io/v1beta1 21 | kind: MachineHealthCheck 22 | metadata: 23 | name: "${CLUSTER_NAME}-mhc-control-plane-0" 24 | spec: 25 | clusterName: "${CLUSTER_NAME}" 26 | maxUnhealthy: 100% 27 | selector: 28 | matchLabels: 29 | cluster.x-k8s.io/control-plane: "" 30 | unhealthyConditions: 31 | - type: Ready 32 | status: Unknown 33 | timeout: 60s 34 | - type: Ready 35 | status: "False" 36 | timeout: 60s -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-network-with-custom-offering/cluster-with-network-with-custom-offering.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 3 | kind: CloudStackCluster 4 | metadata: 5 | name: ${CLUSTER_NAME} 6 | spec: 7 | failureDomains: 8 | - name: ${CLOUDSTACK_FD1_NAME} 9 | acsEndpoint: 10 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 11 | namespace: default 12 | zone: 13 | name: ${CLOUDSTACK_ZONE_NAME} 14 | network: 15 | name: ${CLOUDSTACK_NETWORK_NAME_WITH_CUSTOM_OFFERING} 16 | gateway: ${CLOUDSTACK_GATEWAY} 17 | netmask: ${CLOUDSTACK_NETMASK} 18 | offering: ${CLOUDSTACK_NETWORK_CUSTOM_OFFERING_EGRESS_POLICY_TRUE_NAME} 19 | controlPlaneEndpoint: 20 | host: "" 21 | port: 6443 22 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-network-with-custom-offering/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cluster-with-network-with-custom-offering.yaml -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-node-drain/cluster-with-kcp.yaml: -------------------------------------------------------------------------------- 1 | # KubeadmControlPlane referenced by the Cluster object with 2 | # - the label kcp-adoption.step2, because it should be created in the second step of the kcp-adoption test. 3 | kind: KubeadmControlPlane 4 | apiVersion: controlplane.cluster.x-k8s.io/v1beta1 5 | metadata: 6 | name: "${CLUSTER_NAME}-control-plane" 7 | spec: 8 | machineTemplate: 9 | nodeDrainTimeout: ${NODE_DRAIN_TIMEOUT} 10 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-node-drain/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/md.yaml 3 | - ../bases/cluster-with-kcp.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./md.yaml 7 | - ./cluster-with-kcp.yaml 8 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-node-drain/md.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: cluster.x-k8s.io/v1beta1 2 | kind: MachineDeployment 3 | metadata: 4 | name: "${CLUSTER_NAME}-md-0" 5 | spec: 6 | template: 7 | spec: 8 | nodeDrainTimeout: "${NODE_DRAIN_TIMEOUT}" 9 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-project/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | failureDomains: 7 | - name: ${CLOUDSTACK_FD1_NAME} 8 | acsEndpoint: 9 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 10 | namespace: default 11 | zone: 12 | name : ${CLOUDSTACK_ZONE_NAME} 13 | network: 14 | name: ${CLOUDSTACK_PROJECT_NAME}-${CLOUDSTACK_VPC_NETWORK_NAME} 15 | gateway: ${CLOUDSTACK_GATEWAY} 16 | netmask: ${CLOUDSTACK_NETMASK} 17 | vpc: 18 | name: ${CLOUDSTACK_PROJECT_NAME}-${CLOUDSTACK_VPC_NAME} 19 | cidr: ${CLOUDSTACK_VPC_CIDR} 20 | project: ${CLOUDSTACK_PROJECT_NAME} 21 | controlPlaneEndpoint: 22 | host: "" 23 | port: 6443 24 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-project/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | - ./md.yaml 8 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-project/md.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 3 | kind: CloudStackMachineTemplate 4 | metadata: 5 | name: ${CLUSTER_NAME}-control-plane 6 | spec: 7 | template: 8 | spec: 9 | offering: 10 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 11 | template: 12 | name: ${CLOUDSTACK_TEMPLATE_NAME} 13 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 14 | --- 15 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 16 | kind: CloudStackMachineTemplate 17 | metadata: 18 | name: ${CLUSTER_NAME}-md-0 19 | spec: 20 | template: 21 | spec: 22 | offering: 23 | name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} 24 | template: 25 | name: ${CLOUDSTACK_TEMPLATE_NAME} 26 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 27 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-resource-cleanup/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | failureDomains: 7 | - acsEndpoint: 8 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 9 | namespace: default 10 | name: ${CLOUDSTACK_FD1_NAME} 11 | zone: 12 | name: ${CLOUDSTACK_ZONE_NAME} 13 | network: 14 | name: ${CLOUDSTACK_NEW_NETWORK_NAME} 15 | controlPlaneEndpoint: 16 | host: "" 17 | port: 6443 18 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-resource-cleanup/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-second-cluster/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | failureDomains: 7 | - name: ${CLOUDSTACK_FD1_NAME} 8 | acsEndpoint: 9 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 10 | namespace: default 11 | zone: 12 | name : ${CLOUDSTACK_ZONE_NAME} 13 | network: 14 | name: ${CLOUDSTACK_NETWORK_NAME} 15 | account: ${CLOUDSTACK_ACCOUNT_NAME} 16 | domain: ${CLOUDSTACK_DOMAIN_NAME} 17 | controlPlaneEndpoint: 18 | host: ${CLUSTER_ENDPOINT_IP_2} 19 | port: 6443 20 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-second-cluster/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-shared-network-kubevip/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ./cluster-with-shared-network-and-kubevip.yaml 3 | - ../bases/md.yaml 4 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-subdomain/cloudstack-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 2 | kind: CloudStackCluster 3 | metadata: 4 | name: ${CLUSTER_NAME} 5 | spec: 6 | failureDomains: 7 | - name: ${CLOUDSTACK_FD1_NAME} 8 | acsEndpoint: 9 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 10 | namespace: default 11 | zone: 12 | name : ${CLOUDSTACK_ZONE_NAME} 13 | network: 14 | name: ${CLOUDSTACK_NETWORK_NAME} 15 | account: ${CLOUDSTACK_SUBDOMAIN_ACCOUNT_NAME} 16 | domain: ${CLOUDSTACK_SUBDOMAIN_PATH} 17 | controlPlaneEndpoint: 18 | host: "" 19 | port: 6443 20 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-subdomain/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cloudstack-cluster.yaml 7 | - ./md.yaml 8 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-subdomain/md.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 3 | kind: CloudStackMachineTemplate 4 | metadata: 5 | name: ${CLUSTER_NAME}-control-plane 6 | spec: 7 | template: 8 | spec: 9 | offering: 10 | name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING} 11 | template: 12 | name: ${CLOUDSTACK_TEMPLATE_NAME} 13 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 14 | affinity: pro 15 | --- 16 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 17 | kind: CloudStackMachineTemplate 18 | metadata: 19 | name: ${CLUSTER_NAME}-md-0 20 | spec: 21 | template: 22 | spec: 23 | offering: 24 | name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING} 25 | template: 26 | name: ${CLOUDSTACK_TEMPLATE_NAME} 27 | sshKey: ${CLOUDSTACK_SSH_KEY_NAME} 28 | affinity: pro 29 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-vpc-network/cluster-with-vpc-network.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: infrastructure.cluster.x-k8s.io/v1beta3 3 | kind: CloudStackCluster 4 | metadata: 5 | name: ${CLUSTER_NAME} 6 | spec: 7 | failureDomains: 8 | - name: ${CLOUDSTACK_FD1_NAME} 9 | acsEndpoint: 10 | name: ${CLOUDSTACK_FD1_SECRET_NAME} 11 | namespace: default 12 | zone: 13 | name: ${CLOUDSTACK_ZONE_NAME} 14 | network: 15 | name: ${CLOUDSTACK_VPC_NETWORK_NAME} 16 | gateway: ${CLOUDSTACK_GATEWAY} 17 | netmask: ${CLOUDSTACK_NETMASK} 18 | vpc: 19 | name: ${CLOUDSTACK_VPC_NAME} 20 | cidr: ${CLOUDSTACK_VPC_CIDR} 21 | controlPlaneEndpoint: 22 | host: "" 23 | port: 6443 24 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-vpc-network/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | patchesStrategicMerge: 6 | - ./cluster-with-vpc-network.yaml 7 | -------------------------------------------------------------------------------- /test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../bases/cluster-with-kcp.yaml 3 | - ../bases/md.yaml 4 | 5 | -------------------------------------------------------------------------------- /test/e2e/data/kubetest/conformance-fast.yaml: -------------------------------------------------------------------------------- 1 | ginkgo.focus: \[Conformance\] 2 | ginkgo.skip: \[sig-scheduling\].*\[Serial\] 3 | disable-log-dump: true 4 | ginkgo.progress: true 5 | ginkgo.slowSpecThreshold: 120.0 6 | ginkgo.flakeAttempts: 3 7 | ginkgo.trace: true 8 | ginkgo.v: true 9 | -------------------------------------------------------------------------------- /test/e2e/data/kubetest/conformance.yaml: -------------------------------------------------------------------------------- 1 | ginkgo.focus: \[Conformance\] 2 | ginkgo.skip: \[Serial\] 3 | disable-log-dump: true 4 | ginkgo.progress: true 5 | ginkgo.slowSpecThreshold: 120.0 6 | ginkgo.flakeAttempts: 3 7 | ginkgo.trace: true 8 | ginkgo.v: true 9 | -------------------------------------------------------------------------------- /test/e2e/data/shared/v1beta1/metadata.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3 2 | kind: Metadata 3 | releaseSeries: 4 | - major: 1 5 | minor: 9 6 | contract: v1beta1 7 | - major: 1 8 | minor: 8 9 | contract: v1beta1 10 | - major: 1 11 | minor: 7 12 | contract: v1beta1 13 | - major: 1 14 | minor: 6 15 | contract: v1beta1 16 | - major: 1 17 | minor: 5 18 | contract: v1beta1 19 | - major: 1 20 | minor: 4 21 | contract: v1beta1 22 | - major: 1 23 | minor: 3 24 | contract: v1beta1 25 | - major: 1 26 | minor: 2 27 | contract: v1beta1 28 | - major: 1 29 | minor: 1 30 | contract: v1beta1 31 | - major: 1 32 | minor: 0 33 | contract: v1beta1 34 | -------------------------------------------------------------------------------- /test/e2e/data/shared/v1beta1_provider/metadata.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3 2 | kind: Metadata 3 | releaseSeries: 4 | - major: 1 5 | minor: 0 6 | contract: v1beta1 7 | -------------------------------------------------------------------------------- /test/e2e/deploy_app_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2020 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | "context" 24 | 25 | . "github.com/onsi/ginkgo/v2" 26 | ) 27 | 28 | var _ = Describe("When testing app deployment to the workload cluster [TC1][PR-Blocking]", func() { 29 | 30 | DeployAppSpec(context.TODO(), func() CommonSpecInput { 31 | return CommonSpecInput{ 32 | E2EConfig: e2eConfig, 33 | ClusterctlConfigPath: clusterctlConfigPath, 34 | BootstrapClusterProxy: bootstrapClusterProxy, 35 | ArtifactFolder: artifactFolder, 36 | SkipCleanup: skipCleanup, 37 | } 38 | }) 39 | 40 | }) 41 | -------------------------------------------------------------------------------- /test/e2e/deploy_app_toxi_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2020 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | "context" 24 | 25 | . "github.com/onsi/ginkgo/v2" 26 | ) 27 | 28 | var _ = Describe("When testing app deployment to the workload cluster with slow network [ToxiProxy]", func() { 29 | 30 | DeployAppToxiSpec(context.TODO(), func() CommonSpecInput { 31 | return CommonSpecInput{ 32 | E2EConfig: e2eConfig, 33 | ClusterctlConfigPath: clusterctlConfigPath, 34 | BootstrapClusterProxy: bootstrapClusterProxy, 35 | ArtifactFolder: artifactFolder, 36 | SkipCleanup: skipCleanup, 37 | } 38 | }) 39 | 40 | }) 41 | -------------------------------------------------------------------------------- /test/e2e/disk_offering_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2021 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | "context" 24 | 25 | . "github.com/onsi/ginkgo/v2" 26 | ) 27 | 28 | var _ = Describe("When testing with disk offering", func() { 29 | 30 | DiskOfferingSpec(context.TODO(), func() CommonSpecInput { 31 | return CommonSpecInput{ 32 | E2EConfig: e2eConfig, 33 | ClusterctlConfigPath: clusterctlConfigPath, 34 | BootstrapClusterProxy: bootstrapClusterProxy, 35 | ArtifactFolder: artifactFolder, 36 | SkipCleanup: skipCleanup, 37 | } 38 | }) 39 | 40 | }) 41 | -------------------------------------------------------------------------------- /test/e2e/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Package e2e implements end to end testing. 18 | package e2e 19 | -------------------------------------------------------------------------------- /test/e2e/helpers/utilities.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package helpers 18 | 19 | import "time" 20 | 21 | func InterruptibleSleep(sleepDuration time.Duration, resolution time.Duration, interruptionChannel chan bool) bool { 22 | for entryTime := time.Now(); time.Since(entryTime) < sleepDuration; { 23 | select { 24 | case <-interruptionChannel: 25 | return true 26 | default: 27 | time.Sleep(resolution) 28 | break 29 | } 30 | } 31 | return false 32 | } 33 | -------------------------------------------------------------------------------- /test/e2e/horizontal_scale_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2021 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | "context" 24 | 25 | . "github.com/onsi/ginkgo/v2" 26 | ) 27 | 28 | var _ = Describe("When testing horizontal scale out/in [TC17][TC18][TC20][TC21]", func() { 29 | 30 | ControlPlaneScaleSpec(context.TODO(), func() CommonSpecInput { 31 | return CommonSpecInput{ 32 | E2EConfig: e2eConfig, 33 | ClusterctlConfigPath: clusterctlConfigPath, 34 | BootstrapClusterProxy: bootstrapClusterProxy, 35 | ArtifactFolder: artifactFolder, 36 | SkipCleanup: skipCleanup, 37 | } 38 | }) 39 | 40 | }) 41 | -------------------------------------------------------------------------------- /test/e2e/invalid_resource_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2020 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | "context" 24 | 25 | . "github.com/onsi/ginkgo/v2" 26 | ) 27 | 28 | var _ = Describe("When the specified resource does not exist", func() { 29 | InvalidResourceSpec(context.TODO(), func() CommonSpecInput { 30 | return CommonSpecInput{ 31 | E2EConfig: e2eConfig, 32 | ClusterctlConfigPath: clusterctlConfigPath, 33 | BootstrapClusterProxy: bootstrapClusterProxy, 34 | ArtifactFolder: artifactFolder, 35 | SkipCleanup: skipCleanup, 36 | } 37 | }) 38 | }) 39 | -------------------------------------------------------------------------------- /test/e2e/k8s_conformance_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2020 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | . "github.com/onsi/ginkgo/v2" 24 | ) 25 | 26 | var _ = Describe("When testing K8S conformance [Conformance]", func() { 27 | K8SConformanceSpec(ctx, func() CommonSpecInput { 28 | return CommonSpecInput{ 29 | E2EConfig: e2eConfig, 30 | ClusterctlConfigPath: clusterctlConfigPath, 31 | BootstrapClusterProxy: bootstrapClusterProxy, 32 | ArtifactFolder: artifactFolder, 33 | SkipCleanup: skipCleanup, 34 | } 35 | }) 36 | }) 37 | -------------------------------------------------------------------------------- /test/e2e/kubeconfig_helper/data/README: -------------------------------------------------------------------------------- 1 | For simplicity of diffing in the test, the kubeconfig file in this directory has been formatted to match the 2 | whitespacing done by golang's default map[string]interface{} marshaller (which is not they way many actual 3 | kubeconfigs are typically whitespaced). 4 | -------------------------------------------------------------------------------- /test/e2e/kubeconfig_helper/suite_test.go: -------------------------------------------------------------------------------- 1 | package kubeconfig_helper_test 2 | 3 | import ( 4 | "testing" 5 | 6 | . "github.com/onsi/ginkgo/v2" 7 | . "github.com/onsi/gomega" 8 | ) 9 | 10 | func TestHelpers(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Kubeconfig Helpers Suite") 13 | } 14 | -------------------------------------------------------------------------------- /test/e2e/kubernetes_cks_cluster_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2020 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | . "github.com/onsi/ginkgo/v2" 24 | ) 25 | 26 | var _ = Describe("When testing creation of CKS cluster in ACS", func() { 27 | CksK8SSpec(ctx, func() CommonSpecInput { 28 | return CommonSpecInput{ 29 | E2EConfig: e2eConfig, 30 | ClusterctlConfigPath: clusterctlConfigPath, 31 | BootstrapClusterProxy: bootstrapClusterProxy, 32 | ArtifactFolder: artifactFolder, 33 | SkipCleanup: skipCleanup, 34 | } 35 | }) 36 | }) 37 | -------------------------------------------------------------------------------- /test/e2e/kubernetes_version_upgrade_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2020 The Kubernetes Authors. 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package e2e 18 | 19 | import ( 20 | . "github.com/onsi/ginkgo/v2" 21 | ) 22 | 23 | var _ = Describe("When testing Kubernetes version upgrades", func() { 24 | KubernetesVersionUpgradeSpec(ctx, func() CommonSpecInput { 25 | return CommonSpecInput{ 26 | E2EConfig: e2eConfig, 27 | ClusterctlConfigPath: clusterctlConfigPath, 28 | BootstrapClusterProxy: bootstrapClusterProxy, 29 | ArtifactFolder: artifactFolder, 30 | SkipCleanup: skipCleanup, 31 | } 32 | }) 33 | }) 34 | -------------------------------------------------------------------------------- /test/e2e/machine_remediation_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2020 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | "context" 24 | 25 | . "github.com/onsi/ginkgo/v2" 26 | ) 27 | 28 | var _ = Describe("When testing machine remediation", func() { 29 | 30 | MachineRemediationSpec(context.TODO(), func() CommonSpecInput { 31 | return CommonSpecInput{ 32 | E2EConfig: e2eConfig, 33 | ClusterctlConfigPath: clusterctlConfigPath, 34 | BootstrapClusterProxy: bootstrapClusterProxy, 35 | ArtifactFolder: artifactFolder, 36 | SkipCleanup: skipCleanup, 37 | } 38 | }) 39 | 40 | }) 41 | -------------------------------------------------------------------------------- /test/e2e/md_rollout_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2020 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | . "github.com/onsi/ginkgo/v2" 24 | ) 25 | 26 | var _ = Describe("When testing MachineDeployment rolling upgrades", func() { 27 | MachineDeploymentRolloutSpec(ctx, func() CommonSpecInput { 28 | return CommonSpecInput{ 29 | E2EConfig: e2eConfig, 30 | ClusterctlConfigPath: clusterctlConfigPath, 31 | BootstrapClusterProxy: bootstrapClusterProxy, 32 | ArtifactFolder: artifactFolder, 33 | SkipCleanup: skipCleanup, 34 | } 35 | }) 36 | }) 37 | -------------------------------------------------------------------------------- /test/e2e/network_interruption_toxi_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2020 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | "context" 24 | 25 | . "github.com/onsi/ginkgo/v2" 26 | ) 27 | 28 | var _ = Describe("When testing app deployment to the workload cluster with network interruption [ToxiProxy]", func() { 29 | 30 | NetworkInterruptionToxiSpec(context.TODO(), func() CommonSpecInput { 31 | return CommonSpecInput{ 32 | E2EConfig: e2eConfig, 33 | ClusterctlConfigPath: clusterctlConfigPath, 34 | BootstrapClusterProxy: bootstrapClusterProxy, 35 | ArtifactFolder: artifactFolder, 36 | SkipCleanup: skipCleanup, 37 | } 38 | }) 39 | 40 | }) 41 | -------------------------------------------------------------------------------- /test/e2e/network_with_custom_offering_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2020 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | "context" 24 | 25 | . "github.com/onsi/ginkgo/v2" 26 | ) 27 | 28 | var _ = Describe("When testing network with custom offering", func() { 29 | NetworkWithCustomOfferingSpec(context.TODO(), func() CommonSpecInput { 30 | return CommonSpecInput{ 31 | E2EConfig: e2eConfig, 32 | ClusterctlConfigPath: clusterctlConfigPath, 33 | BootstrapClusterProxy: bootstrapClusterProxy, 34 | ArtifactFolder: artifactFolder, 35 | SkipCleanup: skipCleanup, 36 | } 37 | }) 38 | 39 | }) 40 | -------------------------------------------------------------------------------- /test/e2e/node_drain_timeout_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2020 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | . "github.com/onsi/ginkgo/v2" 24 | ) 25 | 26 | var _ = Describe("When testing node drain timeout", func() { 27 | NodeDrainTimeoutSpec(ctx, func() CommonSpecInput { 28 | return CommonSpecInput{ 29 | E2EConfig: e2eConfig, 30 | ClusterctlConfigPath: clusterctlConfigPath, 31 | BootstrapClusterProxy: bootstrapClusterProxy, 32 | ArtifactFolder: artifactFolder, 33 | SkipCleanup: skipCleanup, 34 | } 35 | }) 36 | }) 37 | -------------------------------------------------------------------------------- /test/e2e/project_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2020 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | "context" 24 | 25 | . "github.com/onsi/ginkgo/v2" 26 | ) 27 | 28 | var _ = Describe("When testing project", func() { 29 | ProjectSpec(context.TODO(), func() CommonSpecInput { 30 | return CommonSpecInput{ 31 | E2EConfig: e2eConfig, 32 | ClusterctlConfigPath: clusterctlConfigPath, 33 | BootstrapClusterProxy: bootstrapClusterProxy, 34 | ArtifactFolder: artifactFolder, 35 | SkipCleanup: skipCleanup, 36 | } 37 | }) 38 | 39 | }) 40 | -------------------------------------------------------------------------------- /test/e2e/resource_cleanup_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2020 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | "context" 24 | 25 | . "github.com/onsi/ginkgo/v2" 26 | ) 27 | 28 | var _ = Describe("When testing resource cleanup", func() { 29 | ResourceCleanupSpec(context.TODO(), func() CommonSpecInput { 30 | return CommonSpecInput{ 31 | E2EConfig: e2eConfig, 32 | ClusterctlConfigPath: clusterctlConfigPath, 33 | BootstrapClusterProxy: bootstrapClusterProxy, 34 | ArtifactFolder: artifactFolder, 35 | SkipCleanup: skipCleanup, 36 | } 37 | }) 38 | 39 | }) 40 | -------------------------------------------------------------------------------- /test/e2e/shared_network_kubevip_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2021 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | "context" 24 | 25 | . "github.com/onsi/ginkgo/v2" 26 | ) 27 | 28 | var _ = Describe("When testing multiple CPs in a shared network with kubevip", func() { 29 | 30 | SharedNetworkKubevipSpec(context.TODO(), func() CommonSpecInput { 31 | return CommonSpecInput{ 32 | E2EConfig: e2eConfig, 33 | ClusterctlConfigPath: clusterctlConfigPath, 34 | BootstrapClusterProxy: bootstrapClusterProxy, 35 | ArtifactFolder: artifactFolder, 36 | SkipCleanup: skipCleanup, 37 | } 38 | }) 39 | 40 | }) 41 | -------------------------------------------------------------------------------- /test/e2e/subdomain_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2020 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | "context" 24 | 25 | . "github.com/onsi/ginkgo/v2" 26 | ) 27 | 28 | var _ = Describe("When testing subdomain", func() { 29 | SubdomainSpec(context.TODO(), func() CommonSpecInput { 30 | return CommonSpecInput{ 31 | E2EConfig: e2eConfig, 32 | ClusterctlConfigPath: clusterctlConfigPath, 33 | BootstrapClusterProxy: bootstrapClusterProxy, 34 | ArtifactFolder: artifactFolder, 35 | SkipCleanup: skipCleanup, 36 | } 37 | }) 38 | 39 | }) 40 | -------------------------------------------------------------------------------- /test/e2e/two_clusters_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2021 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | "context" 24 | 25 | . "github.com/onsi/ginkgo/v2" 26 | ) 27 | 28 | var _ = Describe("with two clusters", func() { 29 | 30 | TwoClustersSpec(context.TODO(), func() CommonSpecInput { 31 | return CommonSpecInput{ 32 | E2EConfig: e2eConfig, 33 | ClusterctlConfigPath: clusterctlConfigPath, 34 | BootstrapClusterProxy: bootstrapClusterProxy, 35 | ArtifactFolder: artifactFolder, 36 | SkipCleanup: skipCleanup, 37 | } 38 | }) 39 | 40 | }) 41 | -------------------------------------------------------------------------------- /test/e2e/vpc_network_test.go: -------------------------------------------------------------------------------- 1 | //go:build e2e 2 | // +build e2e 3 | 4 | /* 5 | Copyright 2023 The Kubernetes Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | package e2e 21 | 22 | import ( 23 | "context" 24 | 25 | . "github.com/onsi/ginkgo/v2" 26 | ) 27 | 28 | var _ = Describe("When testing clusters in a VPC network", func() { 29 | 30 | VPCNetworkSpec(context.TODO(), func() CommonSpecInput { 31 | return CommonSpecInput{ 32 | E2EConfig: e2eConfig, 33 | ClusterctlConfigPath: clusterctlConfigPath, 34 | BootstrapClusterProxy: bootstrapClusterProxy, 35 | ArtifactFolder: artifactFolder, 36 | SkipCleanup: skipCleanup, 37 | } 38 | }) 39 | 40 | }) 41 | -------------------------------------------------------------------------------- /test/fakes/groupversion_info.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 The Kubernetes Authors. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | // Package v1beta3 contains API Schema definitions for the infrastructure v1beta3 API group 15 | // +kubebuilder:object:generate=true 16 | // +groupName=fakes.infrastructure.cluster.x-k8s.io 17 | package fakes 18 | 19 | import ( 20 | "k8s.io/apimachinery/pkg/runtime/schema" 21 | "sigs.k8s.io/controller-runtime/pkg/scheme" 22 | ) 23 | 24 | var ( 25 | // GroupVersion is group version used to register these objects 26 | GroupVersion = schema.GroupVersion{Group: "fakes.infrastructure.cluster.x-k8s.io", Version: "fakes"} 27 | 28 | // SchemeBuilder is used to add go types to the GroupVersionKind scheme 29 | SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} 30 | 31 | // AddToScheme adds the types in this group-version to the given scheme. 32 | AddToScheme = SchemeBuilder.AddToScheme 33 | ) 34 | -------------------------------------------------------------------------------- /test/fixtures/cloud-config-files/cloud-config-good: -------------------------------------------------------------------------------- 1 | [Global] 2 | api-key = api-key1 3 | secret-key = secret-key1 4 | api-url = api-url1 5 | 6 | -------------------------------------------------------------------------------- /test/fixtures/cloud-config-files/cloud-config-no-global: -------------------------------------------------------------------------------- 1 | [NonGlobal] 2 | api-key = api-key1 3 | secret-key = secret-key1 4 | api-url = api-url1 5 | 6 | -------------------------------------------------------------------------------- /test/helpers/client.go: -------------------------------------------------------------------------------- 1 | package helpers 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | "os" 7 | 8 | "github.com/apache/cloudstack-go/v2/cloudstack" 9 | "gopkg.in/yaml.v3" 10 | ) 11 | 12 | type CSConf struct { 13 | APIKey string `yaml:"api-key"` 14 | SecretKey string `yaml:"secret-key"` 15 | APIUrl string `yaml:"api-url"` 16 | VerifySSL string `yaml:"verify-ssl"` 17 | } 18 | 19 | type Config struct { 20 | ApiVersion string `yaml:"apiVersion"` 21 | Kind string `yaml:"kind"` 22 | Type string `yaml:"type"` 23 | Metadata map[string]string `yaml:"metadata"` 24 | StringData CSConf `yaml:"stringData"` 25 | } 26 | 27 | func UnmarshalAllConfigs(in []byte, out *[]Config) error { 28 | r := bytes.NewReader(in) 29 | decoder := yaml.NewDecoder(r) 30 | for { 31 | var conf Config 32 | if err := decoder.Decode(&conf); err != nil { 33 | // Break when there are no more documents to decode 34 | if err != io.EOF { 35 | return err 36 | } 37 | break 38 | } 39 | *out = append(*out, conf) 40 | } 41 | return nil 42 | } 43 | 44 | // NewCSClient creates a CloudStack-Go client from the cloud-config file. 45 | func NewCSClient() (*cloudstack.CloudStackClient, error) { 46 | content, err := os.ReadFile(os.Getenv("REPO_ROOT") + "/cloud-config.yaml") 47 | if err != nil { 48 | return nil, err 49 | } 50 | configs := &[]Config{} 51 | if err := UnmarshalAllConfigs(content, configs); err != nil { 52 | return nil, err 53 | } 54 | config := (*configs)[0].StringData 55 | 56 | return cloudstack.NewAsyncClient(config.APIUrl, config.APIKey, config.SecretKey, config.VerifySSL == "true"), nil 57 | } 58 | -------------------------------------------------------------------------------- /test/helpers/suite_test.go: -------------------------------------------------------------------------------- 1 | package helpers_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/onsi/ginkgo/v2" 7 | gomega "github.com/onsi/gomega" 8 | ) 9 | 10 | func TestCloud(t *testing.T) { 11 | gomega.RegisterFailHandler(ginkgo.Fail) 12 | ginkgo.RunSpecs(t, "Cloud Suite") 13 | } 14 | -------------------------------------------------------------------------------- /tilt-provider.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cloudstack", 3 | "config": { 4 | "manager_name": "capc-controller-manager", 5 | "label": "CAPC", 6 | "image": "localhost:5000/cluster-api-provider-cloudstack", 7 | "live_reload_deps": [ 8 | "main.go", 9 | "go.mod", 10 | "go.sum", 11 | "api", 12 | "cmd", 13 | "controllers", 14 | "pkg" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /versions.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2021 The Kubernetes Authors. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | MDBOOK_VERSION := v0.4.5 16 | GOLANG_VERSION := 1.23.2 17 | PLANTUML_VERSION := 1.2020.16 18 | GH_VERSION := 1.2.0 --------------------------------------------------------------------------------