Skip to content

Commit

Permalink
Merge pull request #36229 from wojtek-t/bump_etcd_version
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue (batch tested with PRs 36229, 39450)

Bump etcd to 3.0.14 and switch to v3 API in etcd.

Ref #20504

**Release note**:

```release-note
Switch default etcd version to 3.0.14.
Switch default storage backend flag in apiserver to `etcd3` mode.
```
  • Loading branch information
Kubernetes Submit Queue committed Jan 5, 2017
2 parents a104229 + 498a893 commit f4a8713
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 11 deletions.
8 changes: 4 additions & 4 deletions cluster/saltbase/salt/etcd/etcd.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
{% endfor -%}
{% set etcd_cluster = vars.etcd_cluster -%}
{% set cluster_state = vars.cluster_state -%}
{% set storage_backend = pillar.get('storage_backend', 'etcd2') -%}
{% set storage_backend = pillar.get('storage_backend', 'etcd3') -%}
{% set quota_bytes = '' -%}
{% if pillar.get('storage_backend', 'etcd2') == 'etcd3' -%}
{% if pillar.get('storage_backend', 'etcd3') == 'etcd3' -%}
{% set quota_bytes = '--quota-backend-bytes=4294967296' -%}
{% endif -%}
{% set srv_kube_path = "/srv/kubernetes" -%}
Expand All @@ -39,7 +39,7 @@
"containers":[
{
"name": "etcd-container",
"image": "gcr.io/google_containers/etcd:{{ pillar.get('etcd_docker_tag', '2.2.1') }}",
"image": "gcr.io/google_containers/etcd:{{ pillar.get('etcd_docker_tag', '3.0.14-alpha.1') }}",
"resources": {
"requests": {
"cpu": {{ cpulimit }}
Expand All @@ -55,7 +55,7 @@
"value": "{{ storage_backend }}"
},
{ "name": "TARGET_VERSION",
"value": "{{ pillar.get('etcd_version', '2.2.1') }}"
"value": "{{ pillar.get('etcd_version', '3.0.14') }}"
},
{ "name": "DATA_DIRECTORY",
"value": "/var/etcd/data{{ suffix }}"
Expand Down
4 changes: 2 additions & 2 deletions hack/verify-flags/exceptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ cluster/photon-controller/util.sh: node_name=${1}
cluster/rackspace/util.sh: local node_ip=$(nova show --minimal ${NODE_NAMES[$i]} \
cluster/saltbase/salt/cluster-autoscaler/cluster-autoscaler.manifest:{% set params = pillar['autoscaler_mig_config'] + " " + cloud_config -%}
cluster/saltbase/salt/etcd/etcd.manifest: "value": "{{ storage_backend }}"
cluster/saltbase/salt/etcd/etcd.manifest:{% if pillar.get('storage_backend', 'etcd2') == 'etcd3' -%}
cluster/saltbase/salt/etcd/etcd.manifest:{% set storage_backend = pillar.get('storage_backend', 'etcd2') -%}
cluster/saltbase/salt/etcd/etcd.manifest:{% if pillar.get('storage_backend', 'etcd3') == 'etcd3' -%}
cluster/saltbase/salt/etcd/etcd.manifest:{% set storage_backend = pillar.get('storage_backend', 'etcd3') -%}
cluster/saltbase/salt/kube-admission-controls/init.sls:{% if 'LimitRanger' in pillar.get('admission_control', '') %}
cluster/saltbase/salt/kube-apiserver/kube-apiserver.manifest:{% set params = address + " " + storage_backend + " " + etcd_servers + " " + etcd_servers_overrides + " " + cloud_provider + " " + cloud_config + " " + runtime_config + " " + feature_gates + " " + admission_control + " " + max_requests_inflight + " " + target_ram_mb + " " + service_cluster_ip_range + " " + client_ca_file + basic_auth_file + " " + min_request_timeout + " " + enable_garbage_collector + " " + etcd_quorum_read -%}
cluster/saltbase/salt/kube-controller-manager/kube-controller-manager.manifest:{% if pillar.get('enable_hostpath_provisioner', '').lower() == 'true' -%}
Expand Down
2 changes: 1 addition & 1 deletion pkg/genericapiserver/options/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (s *EtcdOptions) AddFlags(fs *pflag.FlagSet) {
"format: group/resource#servers, where servers are http://ip:port, semicolon separated.")

fs.StringVar(&s.StorageConfig.Type, "storage-backend", s.StorageConfig.Type,
"The storage backend for persistence. Options: 'etcd2' (default), 'etcd3'.")
"The storage backend for persistence. Options: 'etcd3' (default), 'etcd2'.")

fs.IntVar(&s.StorageConfig.DeserializationCacheSize, "deserialization-cache-size", s.StorageConfig.DeserializationCacheSize,
"Number of deserialized json objects to cache in memory.")
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/storagebackend/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const (

// Config is configuration for creating a storage backend.
type Config struct {
// Type defines the type of storage backend, e.g. "etcd2", etcd3". Default ("") is "etcd2".
// Type defines the type of storage backend, e.g. "etcd2", etcd3". Default ("") is "etcd3".
Type string
// Prefix is the prefix to all keys passed to storage.Interface methods.
Prefix string
Expand Down
4 changes: 2 additions & 2 deletions pkg/storage/storagebackend/factory/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ type DestroyFunc func()
// Create creates a storage backend based on given config.
func Create(c storagebackend.Config) (storage.Interface, DestroyFunc, error) {
switch c.Type {
case storagebackend.StorageTypeUnset, storagebackend.StorageTypeETCD2:
case storagebackend.StorageTypeETCD2:
return newETCD2Storage(c)
case storagebackend.StorageTypeETCD3:
case storagebackend.StorageTypeUnset, storagebackend.StorageTypeETCD3:
// TODO: We have the following features to implement:
// - Support secure connection by using key, cert, and CA files.
// - Honor "https" scheme to support secure connection in gRPC.
Expand Down
4 changes: 4 additions & 0 deletions test/e2e_node/services/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ func NewAPIServer() *APIServer {
func (a *APIServer) Start() error {
config := options.NewServerRunOptions()
config.Etcd.StorageConfig.ServerList = []string{getEtcdClientURL()}
// TODO: Current setup of etcd in e2e-node tests doesn't support etcd v3
// protocol. We should migrate it to use the same infrastructure as all
// other tests (pkg/storage/etcd/testing).
config.Etcd.StorageConfig.Type = "etcd2"
_, ipnet, err := net.ParseCIDR(clusterIPRange)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion test/kubemark/start-kubemark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ INSTANCE_PREFIX="${INSTANCE_PREFIX:-}"
SERVICE_CLUSTER_IP_RANGE="${SERVICE_CLUSTER_IP_RANGE:-}"
# Etcd related variables.
ETCD_IMAGE="${ETCD_IMAGE:-2.2.1}"
ETCD_IMAGE="${ETCD_IMAGE:-3.0.14-alpha.1}"
ETCD_VERSION="${ETCD_VERSION:-}"
# Controller-manager related variables.
Expand Down

0 comments on commit f4a8713

Please sign in to comment.