Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single node infrastructure added #4269

Merged
merged 15 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/IBM-Cloud/bluemix-go v0.0.0-20221026143540-4d6050d2dbc5
github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20220922071204-21813161c36f
github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20230118060037-101bda076037
github.com/IBM-Cloud/power-go-client v1.2.2
github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca
github.com/IBM/appconfiguration-go-admin-sdk v0.3.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ github.com/IBM-Cloud/bluemix-go v0.0.0-20221026143540-4d6050d2dbc5 h1:pIPDTYytM1
github.com/IBM-Cloud/bluemix-go v0.0.0-20221026143540-4d6050d2dbc5/go.mod h1:cO5KCpiop9eP/pM/5W07TprYUkv/kHtajW1FiZgE59k=
github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20220922071204-21813161c36f h1:VMMqaAUXrNQH84ba/EDbfe8lvQJF9FBUnaQbIa1iKZ0=
github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20220922071204-21813161c36f/go.mod h1:xUQL9SGAjoZFd4GNjrjjtEpjpkgU7RFXRyHesbKTjiY=
github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20230118060037-101bda076037 h1:C1gOsj2A5ouRUXrmKHebXjs4FXRE8ApMUC3GBUpd9Co=
github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20230118060037-101bda076037/go.mod h1:xUQL9SGAjoZFd4GNjrjjtEpjpkgU7RFXRyHesbKTjiY=
github.com/IBM-Cloud/ibm-cloud-cli-sdk v0.5.3/go.mod h1:RiUvKuHKTBmBApDMUQzBL14pQUGKcx/IioKQPIcRQjs=
github.com/IBM-Cloud/power-go-client v1.2.2 h1:VNlzizoG2x06c3nL1ZBILF701QcvXcu6nEH3hmEKCkw=
github.com/IBM-Cloud/power-go-client v1.2.2/go.mod h1:Qfx0fNi+9hms+xu9Z6Euhu9088ByW6C/TCMLECTRWNE=
Expand Down
7 changes: 6 additions & 1 deletion ibm/service/satellite/data_source_ibm_satellite_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ func DataSourceIBMSatelliteCluster() *schema.Resource {
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
"infrastructure_topology": {
Type: schema.TypeString,
Computed: true,
Description: "String value for single node cluster option.",
},
},
}
}
Expand Down Expand Up @@ -241,7 +246,7 @@ func dataSourceIBMSatelliteClusterRead(d *schema.ResourceData, meta interface{})
d.Set("state", *clusterFields.State)
d.Set("status", *clusterFields.Status)
d.Set("workers", workers)

d.Set("infrastructure_topology", *clusterFields.InfrastructureTopology)
d.Set("worker_pools", flex.FlattenSatelliteWorkerPools(workerPools))

if clusterFields.ServiceEndpoints != nil {
Expand Down
11 changes: 11 additions & 0 deletions ibm/service/satellite/resource_ibm_satellite_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ func ResourceIBMSatelliteCluster() *schema.Resource {
Computed: true,
Description: "The lifecycle state of the cluster.",
},
"infrastructure_topology": {
Type: schema.TypeString,
Optional: true,
Description: "String value for single node cluster option. Available options: single-replica, highly-available (default: highly-available)",
},
"kube_version": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -338,6 +343,11 @@ func resourceIBMSatelliteClusterCreate(d *schema.ResourceData, meta interface{})
createClusterOptions.OperatingSystem = &operating_system
}

if v, ok := d.GetOk("infrastructure_topology"); ok {
infrastructure_topology := v.(string)
createClusterOptions.InfrastructureTopology = &infrastructure_topology
}

if res, ok := d.GetOk("zones"); ok {
zones := res.(*schema.Set).List()
for _, e := range zones {
Expand Down Expand Up @@ -504,6 +514,7 @@ func resourceIBMSatelliteClusterRead(d *schema.ResourceData, meta interface{}) e
d.Set("name", *cluster.Name)
d.Set("crn", *cluster.Crn)
d.Set("kube_version", *cluster.MasterKubeVersion)
d.Set("infrastructure_topology", *cluster.InfrastructureTopology)
d.Set("state", *cluster.State)
if cluster.Lifecycle != nil {
d.Set("master_status", *cluster.Lifecycle.MasterStatus)
Expand Down
5 changes: 4 additions & 1 deletion ibm/service/satellite/resource_ibm_satellite_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,9 @@ func testAccCheckSatelliteClusterCreate(clusterName, locationName, managed_from,
name = "%s"
location = ibm_satellite_host.assign_host.0.location
enable_config_admin = true
kube_version = "4.9_openshift"
kube_version = "4.11_openshift"
operating_system = "%s"
infrastructure_topology = "single-replica"
wait_for_worker_update = true
dynamic "zones" {
for_each = var.location_zones
Expand All @@ -242,7 +243,9 @@ func testAccCheckSatelliteClusterCreate(clusterName, locationName, managed_from,
"test" = "test-pool1"
"test1" = "test-pool2"
}

}
}

`, locationName, managed_from, resource_group, resource_prefix, resource_prefix, region, resource_prefix, publicKey, resource_prefix, region, resource_prefix, host_provider, clusterName, operatingSystem)
}
1 change: 1 addition & 0 deletions website/docs/d/satellite_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ In addition to all argument references list, you can access the following attrib
- `worker_count` - (String) The number of workers that are attached to the cluster.
- `workers` - (String) The IDs of the workers that are attached to the cluster.
- `worker_pools`- (List) The collection of worker nodes in a cluster.
- `infrastructure_topology` - (String) The infrastructure topology status for this cluster.

Nested scheme for `worker_pools`:
- `name`- (String) The name of the worker pool.
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/satellite_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Review the argument references that you can specify for your resource.
- `default_worker_pool_labels` - (Optional, String) The labels on all the workers in the default worker pool.
- `pull_secret` - (Optional, String) The Red Hat pull secret to create the OpenShift cluster.
- `zone` - (Optional, List) The zone for the worker pool in a multi-zone cluster.
- `infrastructure_topology` - (Optional, String) Specify whether the cluster should run a single worker node or the default number of worker nodes. To create a single-node cluster, specify 'single-replica'. To create a default cluster with multiple worker nodes, specify 'highly-available'. The 'highly-available' option is applied by default. Available options: single-replica, highly-available (default: "highly-available")

Nested scheme for `zone`:
- `id` - The name of the zone.
Expand Down