From 712882f0804fed2b97a7805541d58a62e9a7647a Mon Sep 17 00:00:00 2001 From: Kris Childress Date: Thu, 3 Nov 2016 13:59:02 -0600 Subject: [PATCH] K8s API - Fixing Kubernetes API forwarding in the ELB - Fixing DNS for kubectul - Fixing Suggestions: output for bastion --- cmd/kops/update_cluster.go | 7 ++++++- .../topologies/_topology_private/network.yaml | 18 ++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/cmd/kops/update_cluster.go b/cmd/kops/update_cluster.go index f0eb6fcf9d..5ebaa9479e 100644 --- a/cmd/kops/update_cluster.go +++ b/cmd/kops/update_cluster.go @@ -30,6 +30,7 @@ import ( "k8s.io/kops/upup/pkg/kutil" "os" "strings" + "k8s.io/kops/pkg/apis/kops" ) type UpdateClusterOptions struct { @@ -188,7 +189,11 @@ func RunUpdateCluster(f *util.Factory, cmd *cobra.Command, args []string, out io fmt.Printf("\n") fmt.Printf("Suggestions:\n") fmt.Printf(" * list nodes: kubectl get nodes --show-labels\n") - fmt.Printf(" * ssh to the master: ssh -i ~/.ssh/id_rsa admin@%s\n", cluster.Spec.MasterPublicName) + if cluster.Spec.Topology.Masters == kops.TopologyPublic { + fmt.Printf(" * ssh to the master: ssh -i ~/.ssh/id_rsa admin@%s\n", cluster.Spec.MasterPublicName) + }else { + fmt.Printf(" * ssh to the bastion: ssh -i ~/.ssh/id_rsa admin@%s\n", cluster.Spec.MasterPublicName) + } fmt.Printf(" * read about installing addons: https://github.com/kubernetes/kops/blob/master/docs/addons.md\n") fmt.Printf("\n") } diff --git a/upup/models/cloudup/_aws/topologies/_topology_private/network.yaml b/upup/models/cloudup/_aws/topologies/_topology_private/network.yaml index 204cbc9a76..c1fe962406 100644 --- a/upup/models/cloudup/_aws/topologies/_topology_private/network.yaml +++ b/upup/models/cloudup/_aws/topologies/_topology_private/network.yaml @@ -198,8 +198,7 @@ loadBalancer/api.{{ ClusterName }}: # --------------------------------------------------------------- loadBalancerHealthChecks/api.{{ ClusterName }}: loadBalancer: loadBalancer/api.{{ ClusterName }} - # 10249 Is the default kube-proxy healthz protocol - target: HTTP:10249/healthz + target: TCP:443 healthyThreshold: 2 unhealthyThreshold: 2 interval: 10 @@ -208,8 +207,8 @@ securityGroupRule/kube-proxy-api-elb: securityGroup: securityGroup/masters.{{ ClusterName }} sourceGroup: securityGroup/api-elb.{{ ClusterName }} protocol: tcp - fromPort: 10249 - toPort: 10249 + fromPort: 443 + toPort: 443 # --------------------------------------------------------------- @@ -246,3 +245,14 @@ securityGroupRule/https-api-elb: fromPort: 443 toPort: 443 +# --------------------------------------------------------------- +# DNS - Api +# +# This will point our DNS to the load balancer, and put the pieces +# together for kubectl to be work +# --------------------------------------------------------------- +dnsZone/{{ .DNSZone }}: {} +dnsName/{{ .MasterPublicName }}: + Zone: dnsZone/{{ .DNSZone }} + ResourceType: "A" + TargetLoadBalancer: loadBalancer/api.{{ ClusterName }} \ No newline at end of file