func CloudProviderConfig(infraID, projectID, subnet string) (string, error) {
	file := ini.Empty()
	config := &config{
		Global: global{
			ProjectID: projectID,

			// To make sure k8s cloud provider is looking for instances in all zones.
			Regional:  true,
			Multizone: true,

			// To make sure k8s cloud provide has tags for firewal for load balancer.
			NodeTags: []string{fmt.Sprintf("%s-worker", infraID)},

			// Used for internal load balancers
			SubnetworkName: subnet,
		},
	}
	if err := file.ReflectFrom(config); err != nil {
		return "", errors.Wrap(err, "failed to reflect from config")
	}
	buf := &bytes.Buffer{}
	if _, err := file.WriteTo(buf); err != nil {
		return "", errors.Wrap(err, "failed to write out cloud provider config")
	}
	return buf.String(), nil
}
// CloudProviderConfig generates the cloud provider config for the GCP platform.
CloudProviderConfig generates the cloud provider config for the GCP platform.
// CloudProviderConfig generates the cloud provider config for the GCP platform .
func CloudProviderConfig(infraID, projectID, subnet string) (string, error) {
	file := ini.Empty()
	config := &config{
		Global: global{
			ProjectID: projectID,
			Regional:  true,
			Multizone: true,
			NodeTags: []string{fmt.Sprintf("%s-worker", infraID)},
			SubnetworkName: subnet,
		},
	}
	if err := file.ReflectFrom(config); err != nil {
		return "", errors.Wrap(err, "failed to reflect from config")
	}
	buf := &bytes.Buffer{}
	if _, err := file.WriteTo(buf); err != nil {
		return "", errors.Wrap(err, "failed to write out cloud provider config")
	}
	return buf.String(), nil
}
func CloudProviderConfig ( infraID , projectID , subnet string ) ( string , error ) { file := ini . Empty ( ) config := & config { Global : global { ProjectID : projectID , Regional : true , Multizone : true , NodeTags : [ ] string { fmt . Sprintf ( " " , infraID ) } , SubnetworkName : subnet , } , } if err := file . ReflectFrom ( config ) ; err != nil { return " " , errors . Wrap ( err , " " ) } buf := & bytes . Buffer { } if _ , err := file . WriteTo ( buf ) ; err != nil { return " " , errors . Wrap ( err , " " ) } return buf . String ( ) , nil }
CloudProviderConfig generates the cloud provider config for the GCP platform.
CloudProviderConfig generates the cloud provider config for the GCP platform .
// To make sure k8s cloud provider is looking for instances in all zones. // To make sure k8s cloud provide has tags for firewal for load balancer. // Used for internal load balancers