mirror of https://github.com/kubernetes/kops.git
Specify storage-backend=etcd2 explicitly
The default may change to etcd3, but we want to stick with etcd2 until upgrade has been fully vetted.
This commit is contained in:
parent
fbbfa98872
commit
09e834849d
|
@ -382,6 +382,8 @@ type KubeAPIServerConfig struct {
|
|||
AnonymousAuth *bool `json:"anonymousAuth,omitempty" flag:"anonymous-auth"`
|
||||
|
||||
KubeletPreferredAddressTypes []string `json:"kubeletPreferredAddressTypes,omitempty" flag:"kubelet-preferred-address-types"`
|
||||
|
||||
StorageBackend *string `json:"storageBackend,omitempty" flag:"storage-backend"`
|
||||
}
|
||||
|
||||
type KubeControllerManagerConfig struct {
|
||||
|
|
|
@ -379,6 +379,8 @@ type KubeAPIServerConfig struct {
|
|||
AnonymousAuth *bool `json:"anonymousAuth,omitempty" flag:"anonymous-auth"`
|
||||
|
||||
KubeletPreferredAddressTypes []string `json:"kubeletPreferredAddressTypes,omitempty" flag:"kubelet-preferred-address-types"`
|
||||
|
||||
StorageBackend *string `json:"storageBackend,omitempty" flag:"storage-backend"`
|
||||
}
|
||||
|
||||
type KubeControllerManagerConfig struct {
|
||||
|
|
|
@ -787,6 +787,7 @@ func autoConvert_v1alpha1_KubeAPIServerConfig_To_kops_KubeAPIServerConfig(in *Ku
|
|||
out.RuntimeConfig = in.RuntimeConfig
|
||||
out.AnonymousAuth = in.AnonymousAuth
|
||||
out.KubeletPreferredAddressTypes = in.KubeletPreferredAddressTypes
|
||||
out.StorageBackend = in.StorageBackend
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -816,6 +817,7 @@ func autoConvert_kops_KubeAPIServerConfig_To_v1alpha1_KubeAPIServerConfig(in *ko
|
|||
out.RuntimeConfig = in.RuntimeConfig
|
||||
out.AnonymousAuth = in.AnonymousAuth
|
||||
out.KubeletPreferredAddressTypes = in.KubeletPreferredAddressTypes
|
||||
out.StorageBackend = in.StorageBackend
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -137,6 +137,8 @@ type KubeAPIServerConfig struct {
|
|||
AnonymousAuth *bool `json:"anonymousAuth,omitempty" flag:"anonymous-auth"`
|
||||
|
||||
KubeletPreferredAddressTypes []string `json:"kubeletPreferredAddressTypes,omitempty" flag:"kubelet-preferred-address-types"`
|
||||
|
||||
StorageBackend *string `json:"storageBackend,omitempty" flag:"storage-backend"`
|
||||
}
|
||||
|
||||
type KubeControllerManagerConfig struct {
|
||||
|
|
|
@ -44,6 +44,11 @@ func (b *KubeAPIServerOptionsBuilder) BuildOptions(o interface{}) error {
|
|||
options.KubeAPIServer.APIServerCount = fi.Int(count)
|
||||
}
|
||||
|
||||
if options.KubeAPIServer.StorageBackend == nil {
|
||||
// For the moment, we continue to use etcd2
|
||||
options.KubeAPIServer.StorageBackend = fi.String("etcd2")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -117,6 +117,24 @@ func TestPopulateCluster_Docker_Spec(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestPopulateCluster_StorageDefault(t *testing.T) {
|
||||
c := buildMinimalCluster()
|
||||
err := PerformAssignments(c)
|
||||
if err != nil {
|
||||
t.Fatalf("error from PerformAssignments: %v", err)
|
||||
}
|
||||
|
||||
addEtcdClusters(c)
|
||||
full, err := PopulateClusterSpec(c)
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error from PopulateCluster: %v", err)
|
||||
}
|
||||
|
||||
if fi.StringValue(full.Spec.KubeAPIServer.StorageBackend) != "etcd2" {
|
||||
t.Fatalf("Unexpected StorageBackend: %v", full.Spec.KubeAPIServer.StorageBackend)
|
||||
}
|
||||
}
|
||||
|
||||
func build(c *api.Cluster) (*api.Cluster, error) {
|
||||
err := PerformAssignments(c)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue