Skip to content

Commit

Permalink
bootstrapping to cdk on aws, we need to select tcp backend protocol t…
Browse files Browse the repository at this point in the history
…o let elb support websocket
  • Loading branch information
ycliuhw committed Apr 17, 2019
1 parent c1cd652 commit 4eb02b6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
7 changes: 6 additions & 1 deletion caas/kubernetes/provider/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/juju/juju/caas"
"github.com/juju/juju/cloudconfig"
"github.com/juju/juju/cloudconfig/podcfg"
k8sannotations "github.com/juju/juju/core/annotations"
"github.com/juju/juju/environs"
environsbootstrap "github.com/juju/juju/environs/bootstrap"
"github.com/juju/juju/mongo"
Expand Down Expand Up @@ -301,10 +302,14 @@ func (c controllerStack) createControllerService() error {
Name: svcName,
Labels: c.stackLabels,
Namespace: c.broker.GetCurrentNamespace(),
Annotations: k8sannotations.New(nil).
Add("service.beta.kubernetes.io/aws-load-balancer-backend-protocol", "tcp").
ToMap(),
},
Spec: core.ServiceSpec{
Selector: c.stackLabels,
Type: core.ServiceType(c.pcfg.Bootstrap.ControllerServiceType),
// TODO: introduce hostcloudregion from cloud then decide which service type & annotations to use.
Type: core.ServiceType(c.pcfg.Bootstrap.ControllerServiceType),
Ports: []core.ServicePort{
{
Name: "api-server",
Expand Down
1 change: 1 addition & 0 deletions caas/kubernetes/provider/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"k8s.io/apimachinery/pkg/selection"

"github.com/juju/juju/caas"
// k8sannotations "github.com/juju/juju/core/annotations"
)

var preferredControllerServiceTypes = map[string]core.ServiceType{
Expand Down
6 changes: 3 additions & 3 deletions cloud/clouds.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const (
// UserPassAuthType is an authentication type using a username and password.
UserPassAuthType AuthType = "userpass"

// UserPassAuthType is an authentication type using a username and password and a client certificate
// UserPassWithCertAuthType is an authentication type using a username and password and a client certificate
UserPassWithCertAuthType AuthType = "userpasswithcert"

// OAuth1AuthType is an authentication type using oauth1.
Expand All @@ -72,7 +72,7 @@ const (
// https://tools.ietf.org/html/draft-cavage-http-signatures-06
HTTPSigAuthType AuthType = "httpsig"

// interactiveAuthType is a credential auth-type provided as an option to
// InteractiveAuthType is a credential auth-type provided as an option to
// "juju add-credential", which takes the user through the process of
// adding credentials. e.g. for lxd: generating a certificate credential.
// This authType should used in a CredentialSchema, not a CloudSchema.
Expand Down Expand Up @@ -121,7 +121,7 @@ type Cloud struct {
// environs.RegisterProvider.
Type string

// HostCloudRegion represents the k8s host cloud. The format is <cloudName>/<region>.
// HostCloudRegion represents the k8s host cloud. The format is <cloudType>/<region>.
HostCloudRegion string

// Description describes the type of cloud.
Expand Down
2 changes: 1 addition & 1 deletion cmd/juju/common/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func WaitForAgentInitialisation(
errorMessage := errors.Cause(err).Error()
switch {
case errors.Cause(err) == io.EOF,
strings.HasSuffix(errorMessage, "no such host"),
strings.HasSuffix(errorMessage, "no such host"), // wait for dns resolvable, aws elb for example.
strings.HasSuffix(errorMessage, "connection is shut down"),
strings.HasSuffix(errorMessage, "no api connection available"),
strings.Contains(errorMessage, "spaces are still being discovered"):
Expand Down

0 comments on commit 4eb02b6

Please sign in to comment.