Skip to content

Commit

Permalink
Merge branch 'devel' into rem_generic_cloud
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Pantelis <[email protected]>
  • Loading branch information
tpantelis authored Oct 25, 2023
2 parents d3b31e7 + 817523b commit f621932
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 40 deletions.
4 changes: 2 additions & 2 deletions cmd/subctl/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ var (
awsCleanupCmd = &cobra.Command{
Use: "aws",
Short: "Clean up an AWS cloud",
Long: "This command cleans up an OpenShift installer-provisioned infrastructure (IPI) on AWS-based" +
" cloud after Submariner uninstallation.",
Long: "This command cleans up an OpenShift installer-provisioned infrastructure (IPI) on " +
"AWS-based cloud after Submariner uninstallation.",
PreRunE: checkAWSFlags,
Run: func(cmd *cobra.Command, args []string) {
exit.OnError(cloudRestConfigProducer.RunOnSelectedContext(
Expand Down
9 changes: 2 additions & 7 deletions cmd/subctl/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ var (
azureCleanupCmd = &cobra.Command{
Use: "azure",
Short: "Clean up an Azure cloud",
Long: "This command cleans up an OpenShift installer-provisioned infrastructure (IPI) on Azure-based" +
" cloud after Submariner uninstallation.",
Long: "This command cleans up an OpenShift installer-provisioned infrastructure (IPI) on " +
"Azure-based cloud after Submariner uninstallation.",
PreRunE: checkAzureFlags,
Run: func(cmd *cobra.Command, args []string) {
exit.OnError(cloudRestConfigProducer.RunOnSelectedContext(
Expand All @@ -78,13 +78,8 @@ func init() {
azurePrepareCmd.Flags().IntVar(&azureConfig.Gateways, "gateways", defaultNumGateways, "Number of gateways to deploy")
// `Standard_F4s_v2` matches the most to `cd5.large` of AWS.
azurePrepareCmd.Flags().StringVar(&azureConfig.GWInstanceType, "gateway-instance", "Standard_F4s_v2", "Type of gateways instance machine")
azurePrepareCmd.Flags().BoolVar(&azureConfig.DedicatedGateway, "dedicated-gateway", true,
"Whether a dedicated gateway node has to be deployed")
cloudPrepareCmd.AddCommand(azurePrepareCmd)

_ = azurePrepareCmd.Flags().MarkDeprecated("dedicated-gateway", "to be removed in 0.16. "+
"To deploy without dedicated gateways, use the Load Balancer mode instead.")

addGeneralAzureFlags(azureCleanupCmd)
cloudCleanupCmd.AddCommand(azureCleanupCmd)
}
Expand Down
5 changes: 0 additions & 5 deletions cmd/subctl/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ func init() {
gcpPrepareCmd.Flags().StringVar(&gcpConfig.GWInstanceType, "gateway-instance", "n1-standard-4", "Type of gateway instance machine")
gcpPrepareCmd.Flags().IntVar(&gcpConfig.Gateways, "gateways", defaultNumGateways,
"Number of gateways to deploy")
gcpPrepareCmd.Flags().BoolVar(&gcpConfig.DedicatedGateway, "dedicated-gateway", true,
"Whether a dedicated gateway node has to be deployed")

_ = gcpPrepareCmd.Flags().MarkDeprecated("dedicated-gateway", "to be removed in 0.16. "+
"To deploy without dedicated gateways, use the Load Balancer mode instead.")

cloudPrepareCmd.AddCommand(gcpPrepareCmd)

Expand Down
5 changes: 0 additions & 5 deletions cmd/subctl/rhos.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ func init() {
"Number of gateways to deploy")
rhosPrepareCmd.Flags().StringVar(&rhosConfig.GWInstanceType, "gateway-instance", "PnTAE.CPU_4_Memory_8192_Disk_50",
"Type of gateway instance machine")
rhosPrepareCmd.Flags().BoolVar(&rhosConfig.DedicatedGateway, "dedicated-gateway", true,
"Whether a dedicated gateway node has to be deployed")

_ = rhosPrepareCmd.Flags().MarkDeprecated("dedicated-gateway", "to be removed in 0.16. "+
"To deploy without dedicated gateways, use the Load Balancer mode instead.")

cloudPrepareCmd.AddCommand(rhosPrepareCmd)

Expand Down
3 changes: 1 addition & 2 deletions pkg/cloud/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (

type Config struct {
AirGappedDeployment bool
DedicatedGateway bool
Gateways int
InfraID string
Region string
Expand Down Expand Up @@ -106,7 +105,7 @@ func RunOn(clusterInfo *cluster.Info, config *Config, status reporter.Interface,

status.End()

gwDeployer, err := azure.NewOcpGatewayDeployer(cloudInfo, azureCloud, msDeployer, config.GWInstanceType, config.DedicatedGateway)
gwDeployer, err := azure.NewOcpGatewayDeployer(cloudInfo, azureCloud, msDeployer, config.GWInstanceType, true)
if err != nil {
return status.Error(err, "Failed to initialize a GatewayDeployer config")
}
Expand Down
17 changes: 8 additions & 9 deletions pkg/cloud/gcp/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@ import (
)

type Config struct {
DedicatedGateway bool
Gateways int
InfraID string
Region string
ProjectID string
CredentialsFile string
OcpMetadataFile string
GWInstanceType string
Gateways int
InfraID string
Region string
ProjectID string
CredentialsFile string
OcpMetadataFile string
GWInstanceType string
}

// RunOn runs the given function on GCP, supplying it with a cloud instance connected to GCP and a reporter that writes to CLI.
Expand Down Expand Up @@ -109,7 +108,7 @@ func RunOn(clusterInfo *cluster.Info, config *Config, status reporter.Interface,
msDeployer := ocp.NewK8sMachinesetDeployer(restMapper, dynamicClient)
// TODO: Ideally we should be able to specify the image for GWNode, but it was seen that
// with certain images, the instance is not coming up. Needs to be investigated further.
gwDeployer := gcp.NewOcpGatewayDeployer(gcpCloudInfo, msDeployer, config.GWInstanceType, "", config.DedicatedGateway, k8sClientSet)
gwDeployer := gcp.NewOcpGatewayDeployer(gcpCloudInfo, msDeployer, config.GWInstanceType, "", true, k8sClientSet)

return function(gcpCloud, gwDeployer, status)
}
Expand Down
18 changes: 8 additions & 10 deletions pkg/cloud/rhos/rhos.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@ import (
)

type Config struct {
DedicatedGateway bool
Gateways int
InfraID string
Region string
ProjectID string
OcpMetadataFile string
CloudEntry string
GWInstanceType string
Gateways int
InfraID string
Region string
ProjectID string
OcpMetadataFile string
CloudEntry string
GWInstanceType string
}

// RunOn runs the given function on RHOS, supplying it with a cloud instance connected to RHOS and a reporter that writes to CLI.
Expand Down Expand Up @@ -101,8 +100,7 @@ func RunOn(clusterInfo *cluster.Info, config *Config, status reporter.Interface,
}
rhosCloud := rhos.NewCloud(cloudInfo)
msDeployer := ocp.NewK8sMachinesetDeployer(restMapper, dynamicClient)
gwDeployer := rhos.NewOcpGatewayDeployer(cloudInfo, msDeployer, config.ProjectID, config.GWInstanceType,
"", config.CloudEntry, config.DedicatedGateway)
gwDeployer := rhos.NewOcpGatewayDeployer(cloudInfo, msDeployer, config.ProjectID, config.GWInstanceType, "", config.CloudEntry, true)

return function(rhosCloud, gwDeployer, status)
}
Expand Down

0 comments on commit f621932

Please sign in to comment.