Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions pkg/asset/machines/aws/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,21 @@ func tagsFromUserTags(clusterID, clusterName string, usertags map[string]string)
}
return tags, nil
}

// ConfigMasters sets the PublicIP flag and assigns a set of load balancers to the given machines
func ConfigMasters(machines []clusterapi.Machine, clusterName string) {
for _, machine := range machines {
providerConfig := machine.Spec.ProviderConfig.Value.Object.(*awsprovider.AWSMachineProviderConfig)
providerConfig.PublicIP = pointer.BoolPtr(true)
providerConfig.LoadBalancers = []awsprovider.LoadBalancerReference{
{
Name: fmt.Sprintf("%s-ext", clusterName),
Type: awsprovider.NetworkLoadBalancerType,
},
{
Name: fmt.Sprintf("%s-int", clusterName),
Type: awsprovider.NetworkLoadBalancerType,
},
}
}
}
1 change: 1 addition & 0 deletions pkg/asset/machines/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func (m *Master) Generate(dependencies asset.Parents) error {
if err != nil {
return errors.Wrap(err, "failed to create master machine objects")
}
aws.ConfigMasters(machines, ic.ObjectMeta.Name)

list := listFromMachines(machines)
raw, err := yaml.Marshal(list)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.