Skip to content

Commit 9a82bb5

Browse files
PS-week-04-2026 (#772)
* draft * updated golint version * PLT-2056: Addded cluster_timezone support for all spectroclusters. (#760) Signed-off-by: Sivaanand Murugesan <[email protected]> * Fix: Fixed cluster_timezone import support for all clusters Signed-off-by: Sivaanand Murugesan <[email protected]> * PLT-2099: Fixed the issues for is_synchronization field support for Zarf Registry. (#767) * Added the wait_for_status_message support for zarf registry * Added the doc file * Declare empty strings * Return the warning instead of error (#769) * Adding the Maxitem as 1 for the resources field * PLT-2092: Added additional_annotations, rolling_update and override_kubeadm_configuration support in machine_pool for cloudstack (#766) * Fix: Added additional_annotations support in machine_pool in cloudstack Signed-off-by: Sivaanand Murugesan <[email protected]> * Chore: Refresh sdk Signed-off-by: Sivaanand Murugesan <[email protected]> * Fix: Added support rolling update strategy. Signed-off-by: Sivaanand Murugesan <[email protected]> * fix: template docs Signed-off-by: Sivaanand Murugesan <[email protected]> * Fix: Added support override kube adm Signed-off-by: Sivaanand Murugesan <[email protected]> * Chore: updated exampls Signed-off-by: Sivaanand Murugesan <[email protected]> * Fix: Unit test fix Signed-off-by: Sivaanand Murugesan <[email protected]> * removed custome update strategy * Fixed additional_annotations and Kube_adm for all clusters Signed-off-by: Sivaanand Murugesan <[email protected]> * PLT-2100: Fixed overridescaling (#771) * PLT-2100: Fixed overridescaling Signed-off-by: Sivaanand Murugesan <[email protected]> * unit test fix * unit test fixed --------- Signed-off-by: Sivaanand Murugesan <[email protected]> * fixed examples * Fixed override_scaling for all other cloud Signed-off-by: Sivaanand Murugesan <[email protected]> * unit test fis Signed-off-by: Sivaanand Murugesan <[email protected]> --------- Signed-off-by: Sivaanand Murugesan <[email protected]> * example fix Signed-off-by: Sivaanand Murugesan <[email protected]> * Chore: refreshed sdk to main Signed-off-by: Sivaanand Murugesan <[email protected]> * feat: add coverage report analysis tool Signed-off-by: Sivaanand Murugesan <[email protected]> * PLT-2037: Type set migration (#764) * PLT-2058 Migrate to use TypeSet for Resource TF Provider spectrocloud_alert (#728) * Migrate to use TypeSet for Resource TF Provider spectrocloud_alert * Converting list to set for resource alert * Revert "Converting list to set for resource alert" Reverting back to Original changes from typeList to typeSet This reverts commit 581e060. * PLT-2048 Migrate to use TypeSet for Resource TF Provider spectrocloud_alert * PLT-2048 Migrate to use TypeSet for Resource TF Provider spectrocloud_alert * PLT-2048 Migrate to use TypeSet for Resource TF Provider spectrocloud_alert * PLT-2048 Migrate to use TypeSet for Resource TF Provider spectrocloud_alert * PLT-2058 Migrate to use TypeSet for Resource TF Provider spectrocloud_alert * PLT-2058 Migrate to use TypeSet for Resource TF Provider spectrocloud_alert * PLT-2058 Migrate to use TypeSet for Resource TF Provider spectrocloud_alert * PLT-2058 Migrate to use TypeSet for Resource TF Provider spectrocloud_alert * PLT-2058 Migrate to use TypeSet for Resource TF Provider spectrocloud_alert * PLT-2058 Migrate to use TypeSet for Resource TF Provider spectrocloud_alert * PLT-2058: Fixed alert functionality as par with palette UI * fix: updated go version for govul check. --------- Co-authored-by: Sivaanand Murugesan <[email protected]> * PLT-2090 Migrate TypeList to TypeSet for Filters (#763) * Adding the TypeSet changes for Filter * Adding the TypeSet changes for Filter * Fixing the unit tests for the resourceType Filter * Reverting the changes in datasource * Reverting the changes in datasource * Adding the changes in golangci.yaml * Adding the changes in filter_common * Adding the changes in filter_common * Plt 2089-2 Migrate TypeList to TypeSet for Workspace (#762) * Adding the changes for TypeList to TypeSet for workspace * Adding the changes for TypeList to TypeSet for workspace * refreshed docs * Adding the version change * Reverting the changes in datasource --------- Co-authored-by: Sivaanand Murugesan <[email protected]> --------- Co-authored-by: Manimaran <[email protected]> Co-authored-by: Manimaran <[email protected]> * PLT-2094: Allow Day 2 operations on EKS Clusters with Karpenter-Managed NodePools. (#775) Signed-off-by: Sivaanand Murugesan <[email protected]> * chore:refresh sdk * fest: refresh sdk * PLT-2095 Support clusterType for takeover clusters (#770) * Adding Support clusterType for takeover clusters * Adding the Doc changes and fixing the code coverage tests * Fixing the panic issue for AKS or GKE Cluster * Removing the unused function in resource_cluster_custom_cloud * PLT-2067: Added support for persistent in efi for virtual machine (#778) * Adding the document changes for workspaces (#781) * PLT-2115 VMO VM: Fixed EFI bootloader fields drift issue (#782) * Fixing the persistent and secure boot when they are omitted in configuration part * Adding the changes in flatten method for persistent and secure_boot * Adding the changes in flatten method for persistent and secure_boot * PLT-1954: Terraform Resource to Import/Attach Existing Kubernetes Clusters into Palette (#784) * Adding the Support for BrownfieldClusterRegistration * Adding the Support for Brownfield Cluster Registration * Adding the Support for Brownfield Cluster Registration * Adding the default value for fields * adding go.mod and go.tidy * Adding the read changes * Added the new field for delete_cluster * Adding the delete_cluster support for registration * Adding the changes for read_only for import_mode field * draft * PLT-1954:Terraform Resource to Import/Attach Existing Kubernetes Clusters into Palette Signed-off-by: Sivaanand Murugesan <[email protected]> * Adding changes for cluster_brownfield * Adding Support for Brownfield cluster Registration (#785) * Adding the support for all clouds * Adding the support for all clouds * Adding the support for all clouds * incorporated feedback Signed-off-by: Sivaanand Murugesan <[email protected]> * Fixed the timezone and backup update scenario * Adding the update fix for timezone and backup * Adding the doc changes * Adding the fix for basic.tf * Adding the fix for basic.tf * Adding the fix for basic.tf * added import support * Adding the changes as per review comments * Renamed from basif.tf to examples.tf * added import support * fixed update issue Signed-off-by: Sivaanand Murugesan <[email protected]> * Adding the document changes for brownfield cluster * Modified the description * Updating the doc file * Fixing the import_mode changes * Fixing the import_mode changes * Fixing the import_mode changes --------- Signed-off-by: Sivaanand Murugesan <[email protected]> Co-authored-by: Manimaran <[email protected]> * fix: import issue fixed --------- Signed-off-by: Sivaanand Murugesan <[email protected]> Co-authored-by: Manimaran <[email protected]> Co-authored-by: Manimaran <[email protected]>
1 parent 488480d commit 9a82bb5

36 files changed

+3144
-70
lines changed

docs/resources/cluster_aws.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ Refer to the [Import section](/docs#import) to learn more.
158158
- `cluster_rbac_binding` (Block List) The RBAC binding for the cluster. (see [below for nested schema](#nestedblock--cluster_rbac_binding))
159159
- `cluster_template` (Block List, Max: 1) The cluster template of the cluster. (see [below for nested schema](#nestedblock--cluster_template))
160160
- `cluster_timezone` (String) Defines the time zone used by this cluster to interpret scheduled operations. Maintenance tasks like upgrades will follow this time zone to ensure they run at the appropriate local time for the cluster. Must be in IANA timezone format (e.g., 'America/New_York', 'Asia/Kolkata', 'Europe/London').
161+
- `cluster_type` (String) The cluster type. Valid values are `PureManage` and `PureAttach`. This field can only be set during cluster creation and cannot be modified after the cluster is created. If not specified, the cluster will use the default type determined by the system.
161162
- `context` (String) The context of the AWS cluster. Allowed values are `project` or `tenant`. Default is `project`. If the `project` context is specified, the project name will sourced from the provider configuration parameter [`project_name`](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs#schema).
162163
- `description` (String) The description of the cluster. Default value is empty string.
163164
- `force_delete` (Boolean) If set to `true`, the cluster will be force deleted and user has to manually clean up the provisioned cloud resources.

docs/resources/cluster_brownfield.md

Lines changed: 333 additions & 0 deletions
Large diffs are not rendered by default.

docs/resources/cluster_custom_cloud.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ Refer to the [Import section](/docs#import) to learn more.
158158
- `cluster_rbac_binding` (Block List) The RBAC binding for the cluster. (see [below for nested schema](#nestedblock--cluster_rbac_binding))
159159
- `cluster_template` (Block List, Max: 1) The cluster template of the cluster. (see [below for nested schema](#nestedblock--cluster_template))
160160
- `cluster_timezone` (String) Defines the time zone used by this cluster to interpret scheduled operations. Maintenance tasks like upgrades will follow this time zone to ensure they run at the appropriate local time for the cluster. Must be in IANA timezone format (e.g., 'America/New_York', 'Asia/Kolkata', 'Europe/London').
161+
- `cluster_type` (String) The cluster type. Valid values are `PureManage` and `PureAttach`. This field can only be set during cluster creation and cannot be modified after the cluster is created. If not specified, the cluster will use the default type determined by the system.
161162
- `context` (String) The context of the EKS cluster. Allowed values are `project` or `tenant`. Default is `project`. If the `project` context is specified, the project name will sourced from the provider configuration parameter [`project_name`](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs#schema).
162163
- `description` (String) The description of the cluster. Default value is empty string.
163164
- `force_delete` (Boolean) If set to `true`, the cluster will be force deleted and user has to manually clean up the provisioned cloud resources.

docs/resources/cluster_maas.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ Refer to the [Import section](/docs#import) to learn more.
142142
- `cluster_rbac_binding` (Block List) The RBAC binding for the cluster. (see [below for nested schema](#nestedblock--cluster_rbac_binding))
143143
- `cluster_template` (Block List, Max: 1) The cluster template of the cluster. (see [below for nested schema](#nestedblock--cluster_template))
144144
- `cluster_timezone` (String) Defines the time zone used by this cluster to interpret scheduled operations. Maintenance tasks like upgrades will follow this time zone to ensure they run at the appropriate local time for the cluster. Must be in IANA timezone format (e.g., 'America/New_York', 'Asia/Kolkata', 'Europe/London').
145+
- `cluster_type` (String) The cluster type. Valid values are `PureManage` and `PureAttach`. This field can only be set during cluster creation and cannot be modified after the cluster is created. If not specified, the cluster will use the default type determined by the system.
145146
- `context` (String) The context of the MAAS configuration. Allowed values are `project` or `tenant`. Default is `project`. If the `project` context is specified, the project name will sourced from the provider configuration parameter [`project_name`](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs#schema).
146147
- `description` (String) The description of the cluster. Default value is empty string.
147148
- `force_delete` (Boolean) If set to `true`, the cluster will be force deleted and user has to manually clean up the provisioned cloud resources.

docs/resources/filter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Required:
7777
Required:
7878

7979
- `conjunction` (String) Conjunction operation of the filter group. Valid values are 'and' and 'or'.
80-
- `filters` (Block List, Min: 1) List of filters in the filter group. (see [below for nested schema](#nestedblock--spec--filter_group--filters))
80+
- `filters` (Block Set, Min: 1) List of filters in the filter group. (see [below for nested schema](#nestedblock--spec--filter_group--filters))
8181

8282
<a id="nestedblock--spec--filter_group--filters"></a>
8383
### Nested Schema for `spec.filter_group.filters`

docs/resources/workspace.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ data "spectrocloud_backup_storage_location" "bsl" {
111111
- `backup_policy` (Block List, Max: 1) The backup policy for the cluster. If not specified, no backups will be taken. (see [below for nested schema](#nestedblock--backup_policy))
112112
- `cluster_rbac_binding` (Block List) The RBAC binding for the cluster. (see [below for nested schema](#nestedblock--cluster_rbac_binding))
113113
- `description` (String)
114-
- `namespaces` (Block List) The namespaces for the cluster. (see [below for nested schema](#nestedblock--namespaces))
114+
- `namespaces` (Block Set) The namespaces for the cluster. (see [below for nested schema](#nestedblock--namespaces))
115115
- `tags` (Set of String)
116116
- `workspace_quota` (Block List, Max: 1) Workspace quota default limits assigned to the namespace. (see [below for nested schema](#nestedblock--workspace_quota))
117117

@@ -184,19 +184,19 @@ Optional:
184184
Required:
185185

186186
- `name` (String) Name of the namespace. This is the name of the Kubernetes namespace in the cluster.
187-
- `resource_allocation` (Map of String) Resource allocation for the namespace. This is a map containing the resource type and the resource value. For example, `{cpu_cores: '2', memory_MiB: '2048', gpu_limit: '1', gpu_provider: 'nvidia'}`
187+
- `resource_allocation` (Map of String) Resource allocation for the namespace. This is a map containing the resource type and the resource value. Only the following field names are supported for resource configuration: `cpu_cores`, `memory_MiB`, `gpu`, and `gpu_provider`. Any other field names will not be honored by the system. For example, `{cpu_cores: '2', memory_MiB: '2048', gpu: '1', gpu_provider: 'nvidia'}`
188188

189189
Optional:
190190

191-
- `cluster_resource_allocations` (Block List) (see [below for nested schema](#nestedblock--namespaces--cluster_resource_allocations))
191+
- `cluster_resource_allocations` (Block List, Max: 1) (see [below for nested schema](#nestedblock--namespaces--cluster_resource_allocations))
192192
- `images_blacklist` (List of String) List of images to disallow for the namespace. For example, `['nginx:latest', 'redis:latest']`
193193

194194
<a id="nestedblock--namespaces--cluster_resource_allocations"></a>
195195
### Nested Schema for `namespaces.cluster_resource_allocations`
196196

197197
Required:
198198

199-
- `resource_allocation` (Map of String) Resource allocation for the cluster. This is a map containing the resource type and the resource value. For example, `{cpu_cores: '2', memory_MiB: '2048', gpu_limit: '1'}`. Note: gpu_provider is not supported here; use the default resource_allocation for GPU provider configuration.
199+
- `resource_allocation` (Map of String) Resource allocation for the cluster. This is a map containing the resource type and the resource value. Only the following field names are supported for resource configuration: `cpu_cores`, `memory_MiB`, `gpu`. Any other field names will not be honored by the system. For example, `{cpu_cores: '2', memory_MiB: '2048', gpu: '1'}`. Note: gpu_provider is not supported here; use the default resource_allocation for GPU provider configuration.
200200
- `uid` (String)
201201

202202

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
terraform {
2+
required_providers {
3+
spectrocloud = {
4+
version = ">= 0.1"
5+
source = "spectrocloud/spectrocloud"
6+
}
7+
}
8+
}
9+
provider "spectrocloud" {
10+
host = var.sc_host
11+
api_key = var.sc_api_key
12+
project_name = var.sc_project_name
13+
}
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Basic Brownfield Cluster Registration (Day-1)
2+
# This example shows the minimal required fields for registering an existing Kubernetes cluster
3+
4+
resource "spectrocloud_cluster_brownfield" "basic" {
5+
name = "my-existing-cluster"
6+
cloud_type = "generic" # Options: aws, eks-anywhere, azure, gcp, vsphere, openshift, generic, maas, openstack
7+
context = "project" # Optional, defaults to "project"
8+
import_mode = "full"
9+
10+
description = "My existing Kubernetes cluster"
11+
cluster_timezone = "Etc/UTC"
12+
tags = ["environment:production", "team:platform", "managed-by:terraform"]
13+
apply_setting = "DownloadAndInstall"
14+
cluster_profile {
15+
id = "CLUSTER_PROFILE_ID"
16+
}
17+
scan_policy {
18+
configuration_scan_schedule = "0 0 * * SUN"
19+
penetration_scan_schedule = "0 0 * * SUN"
20+
conformance_scan_schedule = "0 0 1 * *"
21+
}
22+
23+
pause_agent_upgrades = "lock"
24+
machine_pool {
25+
name = "worker-pool"
26+
27+
node {
28+
node_name = "cp-dev-worker"
29+
action = "uncordon" # Options: "cordon" or "uncordon"
30+
}
31+
}
32+
33+
machine_pool {
34+
name = "master-pool"
35+
36+
node {
37+
node_name = "cp-dev-control-plane2"
38+
node_id = "NODE_ID"
39+
action = "uncordon" # Options: "cordon" or "uncordon"
40+
}
41+
}
42+
cluster_rbac_binding {
43+
type = "ClusterRoleBinding"
44+
role = {
45+
kind = "ClusterRole"
46+
name = "CLUSTER_ROLE_NAME"
47+
}
48+
subjects {
49+
type = "User"
50+
51+
}
52+
53+
# Subject type: Group
54+
subjects {
55+
type = "Group"
56+
name = "platform-admins"
57+
}
58+
59+
# Subject type: ServiceAccount (requires namespace)
60+
subjects {
61+
type = "ServiceAccount"
62+
name = "cluster-admin-sa"
63+
namespace = "kube-system"
64+
}
65+
}
66+
67+
68+
backup_policy {
69+
schedule = "0 0 * * SUN"
70+
backup_location_id = "BACKUP_LOCATION_ID"
71+
prefix = "test-backup"
72+
expiry_in_hour = 7200
73+
include_disks = true
74+
include_cluster_resources = true
75+
}
76+
77+
# RoleBinding - Namespace-specific permissions
78+
cluster_rbac_binding {
79+
type = "RoleBinding"
80+
namespace = "production"
81+
role = {
82+
kind = "Role"
83+
name = "developer-role"
84+
}
85+
subjects {
86+
type = "User"
87+
88+
}
89+
subjects {
90+
type = "Group"
91+
name = "developers"
92+
}
93+
subjects {
94+
type = "ServiceAccount"
95+
name = "app-service-account"
96+
namespace = "production"
97+
}
98+
}
99+
100+
}
101+
102+
103+
104+
# Output the manifest URL and kubectl command for easy access
105+
output "manifest_url" {
106+
value = spectrocloud_cluster_brownfield.basic.manifest_url
107+
sensitive = false
108+
}
109+
110+
output "kubectl_command" {
111+
value = spectrocloud_cluster_brownfield.basic.kubectl_command
112+
sensitive = false
113+
}
114+
115+
output "cluster_status" {
116+
value = spectrocloud_cluster_brownfield.basic.status
117+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sc_host = "api.spectrocloud.com"
2+
sc_api_key = ""
3+
sc_project_name = "Default"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
variable "sc_host" {
2+
description = "Spectro Cloud Endpoint"
3+
type = string
4+
default = "api.spectrocloud.com"
5+
}
6+
7+
variable "sc_api_key" {
8+
description = "Spectro Cloud API key"
9+
type = string
10+
sensitive = true
11+
}
12+
13+
variable "sc_project_name" {
14+
description = "Spectro Cloud Project (e.g: Default)"
15+
type = string
16+
default = "Default"
17+
}
18+
19+

0 commit comments

Comments
 (0)