Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Chuck Ha <chuckh@vmware.com>
  • Loading branch information
chuckha committed Jul 5, 2019
1 parent c29fe4e commit ac9fbc4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 12 additions & 3 deletions actuators/actuators.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,18 @@ func kubeconfigToSecret(clusterName, namespace string) (*v1.Secret, error) {
return nil, errors.WithStack(err)
}

// This is necessary so the management cluster in a container can talk to another container.
// They share the same bridged network and the load balancer does respond on 6443 at its docker IP
// however, the *HOST* is listening on some random port (the one returned from the GetLoadBalancerHostAndPort).
// TODO: Clean this up at some point
// The Management cluster, running the NodeRef controller, needs to talk to the child clusters.
// The management cluster and child cluster must communicate over DockerIP address/ports.
// The load balancer listens on <docker_ip>:6443 and exposes a port on the host at some random open port.
// Any traffic directed to the nginx container will get round-robined to a control plane node in the cluster.
// Since the NodeRef controller is running inside a container, it must reference the child cluster load balancer
// host by using the Docker IP address and port 6443, but us, running on the docker host, must use the localhost
// and random port the LB is exposing to our system.
// Right now the secret that contains the kubeconfig will work only for the node ref controller. In order for *us*
// to interact with the child clusters via kubeconfig we must take the secret uploaded,
// rewrite the kube-apiserver-address to be 127.0.0.1:<randomly-assigned-by-docker-port>.
// It's not perfect but it works to at least play with cluster-api v0.1.4
lbip, _, err := actions.GetLoadBalancerHostAndPort(allNodes)
lines := bytes.Split(data, []byte("\n"))
for i, line := range lines {
Expand Down
4 changes: 0 additions & 4 deletions cmd/capd-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package main

import (
"flag"
"fmt"
"time"

Expand All @@ -36,9 +35,6 @@ import (
)

func main() {
flag.Set("v", "0")
flag.Parse()

cfg, err := config.GetConfig()
if err != nil {
panic(err)
Expand Down

0 comments on commit ac9fbc4

Please sign in to comment.