mirror of https://github.com/kubernetes/kops.git
wrestling with the api stuff
This commit is contained in:
parent
cc589ae538
commit
ae327e1e8c
|
|
@ -442,13 +442,14 @@ func (b *KubeAPIServerBuilder) buildPod() (*v1.Pod, error) {
|
|||
func (b *KubeAPIServerBuilder) buildAnnotations() map[string]string {
|
||||
annotations := make(map[string]string)
|
||||
|
||||
// DNS should only be managed for the internal record if a load balancer is not used
|
||||
if b.UseLoadBalancerForInternalAPI() == false {
|
||||
annotations["dns.alpha.kubernetes.io/internal"] = b.Cluster.Spec.MasterInternalName
|
||||
}
|
||||
if b.Cluster.Spec.API != nil {
|
||||
if b.Cluster.Spec.API.LoadBalancer == nil || b.Cluster.Spec.API.LoadBalancer.UseApiInternal != true {
|
||||
annotations["dns.alpha.kubernetes.io/internal"] = b.Cluster.Spec.MasterInternalName
|
||||
}
|
||||
|
||||
if b.Cluster.Spec.API != nil && b.Cluster.Spec.API.DNS != nil {
|
||||
annotations["dns.alpha.kubernetes.io/external"] = b.Cluster.Spec.MasterPublicName
|
||||
if b.Cluster.Spec.API.DNS != nil {
|
||||
annotations["dns.alpha.kubernetes.io/external"] = b.Cluster.Spec.MasterPublicName
|
||||
}
|
||||
}
|
||||
|
||||
return annotations
|
||||
|
|
|
|||
|
|
@ -301,3 +301,11 @@ func Convert_kops_TopologySpec_To_v1alpha1_TopologySpec(in *kops.TopologySpec, o
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_kops_LoadBalancerAccessSpec_To_v1alpha1_LoadBalancerAccessSpec(in *kops.LoadBalancerAccessSpec, out *LoadBalancerAccessSpec, s conversion.Scope) error {
|
||||
out.Type = LoadBalancerType(in.Type)
|
||||
out.IdleTimeoutSeconds = in.IdleTimeoutSeconds
|
||||
out.AdditionalSecurityGroups = in.AdditionalSecurityGroups
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2662,14 +2662,10 @@ func autoConvert_kops_LoadBalancerAccessSpec_To_v1alpha1_LoadBalancerAccessSpec(
|
|||
out.Type = LoadBalancerType(in.Type)
|
||||
out.IdleTimeoutSeconds = in.IdleTimeoutSeconds
|
||||
out.AdditionalSecurityGroups = in.AdditionalSecurityGroups
|
||||
// WARNING: in.UseApiInternal requires manual conversion: does not exist in peer-type
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_kops_LoadBalancerAccessSpec_To_v1alpha1_LoadBalancerAccessSpec is an autogenerated conversion function.
|
||||
func Convert_kops_LoadBalancerAccessSpec_To_v1alpha1_LoadBalancerAccessSpec(in *kops.LoadBalancerAccessSpec, out *LoadBalancerAccessSpec, s conversion.Scope) error {
|
||||
return autoConvert_kops_LoadBalancerAccessSpec_To_v1alpha1_LoadBalancerAccessSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha1_NetworkingSpec_To_kops_NetworkingSpec(in *NetworkingSpec, out *kops.NetworkingSpec, s conversion.Scope) error {
|
||||
if in.Classic != nil {
|
||||
in, out := &in.Classic, &out.Classic
|
||||
|
|
|
|||
|
|
@ -286,6 +286,7 @@ type LoadBalancerAccessSpec struct {
|
|||
Type LoadBalancerType `json:"type,omitempty"`
|
||||
IdleTimeoutSeconds *int64 `json:"idleTimeoutSeconds,omitempty"`
|
||||
AdditionalSecurityGroups []string `json:"additionalSecurityGroups,omitempty"`
|
||||
UseApiInternal bool `json:"useApiInternal,omitempty"`
|
||||
}
|
||||
|
||||
// KubeDNSConfig defines the kube dns configuration
|
||||
|
|
|
|||
|
|
@ -2914,6 +2914,7 @@ func autoConvert_v1alpha2_LoadBalancerAccessSpec_To_kops_LoadBalancerAccessSpec(
|
|||
out.Type = kops.LoadBalancerType(in.Type)
|
||||
out.IdleTimeoutSeconds = in.IdleTimeoutSeconds
|
||||
out.AdditionalSecurityGroups = in.AdditionalSecurityGroups
|
||||
out.UseApiInternal = in.UseApiInternal
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -2926,6 +2927,7 @@ func autoConvert_kops_LoadBalancerAccessSpec_To_v1alpha2_LoadBalancerAccessSpec(
|
|||
out.Type = LoadBalancerType(in.Type)
|
||||
out.IdleTimeoutSeconds = in.IdleTimeoutSeconds
|
||||
out.AdditionalSecurityGroups = in.AdditionalSecurityGroups
|
||||
out.UseApiInternal = in.UseApiInternal
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -289,6 +289,7 @@ func (m *KopsModelContext) UseLoadBalancerForAPI() bool {
|
|||
// connections. The intention here is to make connections to apiserver more
|
||||
// HA - see https://github.com/kubernetes/kops/issues/4252
|
||||
func (m *KopsModelContext) UseLoadBalancerForInternalAPI() bool {
|
||||
glog.Warningf("LB API IS %q", m.Cluster.Spec.API.LoadBalancer.UseApiInternal)
|
||||
return m.UseLoadBalancerForAPI() &&
|
||||
m.Cluster.Spec.API.LoadBalancer.UseApiInternal == true
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue