diff --git a/cluster/centos/config-default.sh b/cluster/centos/config-default.sh index 30120398b0e..05ab4d570f2 100755 --- a/cluster/centos/config-default.sh +++ b/cluster/centos/config-default.sh @@ -31,7 +31,7 @@ export NUM_NODES=${NUM_NODES:-2} export NUM_NODES=${NUM_NODES} # By default, the cluster will use the etcd installed on master. -export ETCD_SERVERS=${ETCD_SERVERS:-"http://$MASTER_IP:4001"} +export ETCD_SERVERS=${ETCD_SERVERS:-"http://$MASTER_IP:2379"} # define the IP range used for service cluster IPs. # according to rfc 1918 ref: https://tools.ietf.org/html/rfc1918 choose a private ip range here. diff --git a/cluster/centos/master/scripts/apiserver.sh b/cluster/centos/master/scripts/apiserver.sh index 70d0d4e923e..5ed89a760d3 100755 --- a/cluster/centos/master/scripts/apiserver.sh +++ b/cluster/centos/master/scripts/apiserver.sh @@ -16,7 +16,7 @@ MASTER_ADDRESS=${1:-"8.8.8.18"} -ETCD_SERVERS=${2:-"http://8.8.8.18:4001"} +ETCD_SERVERS=${2:-"http://8.8.8.18:2379"} SERVICE_CLUSTER_IP_RANGE=${3:-"10.10.10.0/24"} ADMISSION_CONTROL=${4:-""} diff --git a/cluster/centos/master/scripts/etcd.sh b/cluster/centos/master/scripts/etcd.sh index dc9ae41d8a1..35d543830e5 100755 --- a/cluster/centos/master/scripts/etcd.sh +++ b/cluster/centos/master/scripts/etcd.sh @@ -28,7 +28,7 @@ ETCD_DATA_DIR="${etcd_data_dir}/default.etcd" #ETCD_HEARTBEAT_INTERVAL="100" #ETCD_ELECTION_TIMEOUT="1000" #ETCD_LISTEN_PEER_URLS="http://localhost:2380,http://localhost:7001" -ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:4001" +ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379" #ETCD_MAX_SNAPSHOTS="5" #ETCD_MAX_WALS="5" #ETCD_CORS="" @@ -40,7 +40,7 @@ ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:4001" #ETCD_INITIAL_CLUSTER="default=http://localhost:2380,default=http://localhost:7001" #ETCD_INITIAL_CLUSTER_STATE="new" #ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster" -ETCD_ADVERTISE_CLIENT_URLS="http://localhost:2379,http://localhost:4001" +ETCD_ADVERTISE_CLIENT_URLS="http://localhost:2379" #ETCD_DISCOVERY="" #ETCD_DISCOVERY_SRV="" #ETCD_DISCOVERY_FALLBACK="proxy" diff --git a/cluster/centos/node/scripts/flannel.sh b/cluster/centos/node/scripts/flannel.sh index 386512c571f..217e98952b6 100755 --- a/cluster/centos/node/scripts/flannel.sh +++ b/cluster/centos/node/scripts/flannel.sh @@ -15,7 +15,7 @@ # limitations under the License. -ETCD_SERVERS=${1:-"http://8.8.8.18:4001"} +ETCD_SERVERS=${1:-"http://8.8.8.18:2379"} FLANNEL_NET=${2:-"172.16.0.0/16"} diff --git a/cluster/gce/coreos/configure-node.sh b/cluster/gce/coreos/configure-node.sh index 93d94f092d8..bebc240512b 100755 --- a/cluster/gce/coreos/configure-node.sh +++ b/cluster/gce/coreos/configure-node.sh @@ -88,7 +88,7 @@ function configure-kube-apiserver() { echo "Configuring kube-apiserver" # Wait for etcd to be up. - wait-url-up http://127.0.0.1:4001/version + wait-url-up http://127.0.0.1:2379/version touch /var/log/kube-apiserver.log diff --git a/cluster/gce/coreos/kube-manifests/etcd.yaml b/cluster/gce/coreos/kube-manifests/etcd.yaml index ad1c397661b..1c8cb2ae4ff 100644 --- a/cluster/gce/coreos/kube-manifests/etcd.yaml +++ b/cluster/gce/coreos/kube-manifests/etcd.yaml @@ -10,8 +10,8 @@ spec: - -c - /usr/local/bin/etcd --listen-peer-urls=http://127.0.0.1:2380 - --advertise-client-urls=http://127.0.0.1:4001 - --listen-client-urls=http://127.0.0.1:4001 + --advertise-client-urls=http://127.0.0.1:2379 + --listen-client-urls=http://127.0.0.1:2379 --data-dir=/var/etcd/data 1>>/var/log/etcd.log 2>&1 image: gcr.io/google_containers/etcd:3.0.4 @@ -20,7 +20,7 @@ spec: httpGet: host: 127.0.0.1 path: /health - port: 4001 + port: 2379 scheme: HTTP initialDelaySeconds: 15 timeoutSeconds: 15 @@ -30,8 +30,8 @@ spec: hostPort: 2380 name: serverport protocol: TCP - - containerPort: 4001 - hostPort: 4001 + - containerPort: 2379 + hostPort: 2379 name: clientport protocol: TCP resources: diff --git a/cluster/gce/coreos/kube-manifests/kube-apiserver.yaml b/cluster/gce/coreos/kube-manifests/kube-apiserver.yaml index e6318b303eb..62f82276462 100644 --- a/cluster/gce/coreos/kube-manifests/kube-apiserver.yaml +++ b/cluster/gce/coreos/kube-manifests/kube-apiserver.yaml @@ -10,7 +10,7 @@ spec: - -c - /usr/local/bin/kube-apiserver --address=127.0.0.1 - --etcd-servers=http://127.0.0.1:4001 + --etcd-servers=http://127.0.0.1:2379 --etcd-servers-overrides=/events#http://127.0.0.1:4002 --cloud-provider=gce --admission-control=${ADMISSION_CONTROL} diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh index 73445a87275..99fe866feac 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -571,7 +571,7 @@ function start-etcd-servers { rm -f /etc/init.d/etcd fi prepare-log-file /var/log/etcd.log - prepare-etcd-manifest "" "4001" "2380" "200m" "etcd.manifest" + prepare-etcd-manifest "" "2379" "2380" "200m" "etcd.manifest" prepare-log-file /var/log/etcd-events.log prepare-etcd-manifest "-events" "4002" "2381" "100m" "etcd-events.manifest" @@ -630,7 +630,7 @@ function start-kube-apiserver { params+=" --basic-auth-file=/etc/srv/kubernetes/basic_auth.csv" params+=" --cloud-provider=gce" params+=" --client-ca-file=/etc/srv/kubernetes/ca.crt" - params+=" --etcd-servers=http://127.0.0.1:4001" + params+=" --etcd-servers=http://127.0.0.1:2379" params+=" --etcd-servers-overrides=/events#http://127.0.0.1:4002" params+=" --secure-port=443" params+=" --tls-cert-file=/etc/srv/kubernetes/server.cert" diff --git a/cluster/gce/trusty/configure-helper.sh b/cluster/gce/trusty/configure-helper.sh index 62a59018097..f2115727c8c 100644 --- a/cluster/gce/trusty/configure-helper.sh +++ b/cluster/gce/trusty/configure-helper.sh @@ -452,7 +452,7 @@ start_etcd_servers() { rm -f /etc/init.d/etcd fi prepare_log_file /var/log/etcd.log - prepare_etcd_manifest "" "4001" "2380" "200m" "etcd.manifest" + prepare_etcd_manifest "" "2379" "2380" "200m" "etcd.manifest" prepare_log_file /var/log/etcd-events.log prepare_etcd_manifest "-events" "4002" "2381" "100m" "etcd-events.manifest" @@ -508,7 +508,7 @@ start_kube_apiserver() { params="${APISERVER_TEST_ARGS:-} ${API_SERVER_TEST_LOG_LEVEL:-"--v=2"} ${CLOUD_CONFIG_OPT}" params="${params} --cloud-provider=gce" params="${params} --address=127.0.0.1" - params="${params} --etcd-servers=http://127.0.0.1:4001" + params="${params} --etcd-servers=http://127.0.0.1:2379" params="${params} --tls-cert-file=/etc/srv/kubernetes/server.cert" params="${params} --tls-private-key-file=/etc/srv/kubernetes/server.key" params="${params} --secure-port=443" diff --git a/cluster/images/hyperkube/static-pods/etcd.json b/cluster/images/hyperkube/static-pods/etcd.json index 6bbeb5aaba3..a70b6f2b957 100644 --- a/cluster/images/hyperkube/static-pods/etcd.json +++ b/cluster/images/hyperkube/static-pods/etcd.json @@ -13,8 +13,8 @@ "image": "gcr.io/google_containers/etcd-ARCH:3.0.4", "command": [ "/usr/local/bin/etcd", - "--listen-client-urls=http://127.0.0.1:4001", - "--advertise-client-urls=http://127.0.0.1:4001", + "--listen-client-urls=http://127.0.0.1:2379", + "--advertise-client-urls=http://127.0.0.1:2379", "--data-dir=/var/etcd/data" ], "volumeMounts": [ diff --git a/cluster/images/hyperkube/static-pods/master-multi.json b/cluster/images/hyperkube/static-pods/master-multi.json index 12194e64a85..7d45269db85 100644 --- a/cluster/images/hyperkube/static-pods/master-multi.json +++ b/cluster/images/hyperkube/static-pods/master-multi.json @@ -35,7 +35,7 @@ "apiserver", "--service-cluster-ip-range=10.0.0.1/24", "--insecure-bind-address=0.0.0.0", - "--etcd-servers=http://127.0.0.1:4001", + "--etcd-servers=http://127.0.0.1:2379", "--admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,ResourceQuota", "--client-ca-file=/srv/kubernetes/ca.crt", "--basic-auth-file=/srv/kubernetes/basic_auth.csv", diff --git a/cluster/images/hyperkube/static-pods/master.json b/cluster/images/hyperkube/static-pods/master.json index e29a8e8da03..c409e070c22 100644 --- a/cluster/images/hyperkube/static-pods/master.json +++ b/cluster/images/hyperkube/static-pods/master.json @@ -35,7 +35,7 @@ "apiserver", "--service-cluster-ip-range=10.0.0.1/24", "--insecure-bind-address=127.0.0.1", - "--etcd-servers=http://127.0.0.1:4001", + "--etcd-servers=http://127.0.0.1:2379", "--admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,ResourceQuota", "--client-ca-file=/srv/kubernetes/ca.crt", "--basic-auth-file=/srv/kubernetes/basic_auth.csv", diff --git a/cluster/saltbase/salt/etcd/init.sls b/cluster/saltbase/salt/etcd/init.sls index edd9f652f4b..6802ad4ca38 100644 --- a/cluster/saltbase/salt/etcd/init.sls +++ b/cluster/saltbase/salt/etcd/init.sls @@ -63,7 +63,7 @@ touch /var/log/etcd-events.log: - dir_mode: 755 - context: suffix: "" - port: 4001 + port: 2379 server_port: 2380 cpulimit: '"200m"' diff --git a/cluster/saltbase/salt/kube-apiserver/kube-apiserver.manifest b/cluster/saltbase/salt/kube-apiserver/kube-apiserver.manifest index 6ff98fce778..6a63c0eeac5 100644 --- a/cluster/saltbase/salt/kube-apiserver/kube-apiserver.manifest +++ b/cluster/saltbase/salt/kube-apiserver/kube-apiserver.manifest @@ -58,7 +58,7 @@ {% if pillar['storage_backend'] is defined -%} {% set storage_backend = "--storage-backend=" + pillar['storage_backend'] -%} {% endif -%} -{% set etcd_servers = "--etcd-servers=http://127.0.0.1:4001" -%} +{% set etcd_servers = "--etcd-servers=http://127.0.0.1:2379" -%} {% set etcd_servers_overrides = "--etcd-servers-overrides=/events#http://127.0.0.1:4002" -%} {% set target_ram_mb = "" -%} diff --git a/docs/admin/high-availability/etcd.yaml b/docs/admin/high-availability/etcd.yaml index fc9fe67e754..3c73984ba91 100644 --- a/docs/admin/high-availability/etcd.yaml +++ b/docs/admin/high-availability/etcd.yaml @@ -16,9 +16,9 @@ spec: - --listen-peer-urls - http://${NODE_IP}:2380 - --advertise-client-urls - - http://${NODE_IP}:4001 + - http://${NODE_IP}:2379 - --listen-client-urls - - http://127.0.0.1:4001 + - http://127.0.0.1:2379 - --data-dir - /var/etcd/data - --discovery @@ -27,8 +27,8 @@ spec: - containerPort: 2380 hostPort: 2380 name: serverport - - containerPort: 4001 - hostPort: 4001 + - containerPort: 2379 + hostPort: 2379 name: clientport volumeMounts: - mountPath: /var/etcd diff --git a/examples/apiserver/apiserver.go b/examples/apiserver/apiserver.go index 9206d168c2b..08fbe9a7f06 100644 --- a/examples/apiserver/apiserver.go +++ b/examples/apiserver/apiserver.go @@ -44,7 +44,7 @@ const ( func newStorageFactory() genericapiserver.StorageFactory { config := storagebackend.Config{ Prefix: genericoptions.DefaultEtcdPathPrefix, - ServerList: []string{"http://127.0.0.1:4001"}, + ServerList: []string{"http://127.0.0.1:2379"}, } storageFactory := genericapiserver.NewDefaultStorageFactory(config, "application/json", api.Codecs, genericapiserver.NewDefaultResourceEncodingConfig(), genericapiserver.NewResourceConfig()) @@ -61,7 +61,7 @@ func Run(serverOptions *genericoptions.ServerRunOptions) error { // Set ServiceClusterIPRange _, serviceClusterIPRange, _ := net.ParseCIDR("10.0.0.0/24") serverOptions.ServiceClusterIPRange = *serviceClusterIPRange - serverOptions.StorageConfig.ServerList = []string{"http://127.0.0.1:4001"} + serverOptions.StorageConfig.ServerList = []string{"http://127.0.0.1:2379"} genericvalidation.ValidateRunOptions(serverOptions) genericvalidation.VerifyEtcdServersList(serverOptions) config := genericapiserver.NewConfig(serverOptions) diff --git a/federation/cmd/federation-apiserver/app/server_test.go b/federation/cmd/federation-apiserver/app/server_test.go index 3ecbaf5a0dd..a77b05ffd58 100644 --- a/federation/cmd/federation-apiserver/app/server_test.go +++ b/federation/cmd/federation-apiserver/app/server_test.go @@ -88,7 +88,7 @@ func TestRun(t *testing.T) { s.InsecurePort = insecurePort _, ipNet, _ := net.ParseCIDR("10.10.10.0/24") s.ServiceClusterIPRange = *ipNet - s.StorageConfig.ServerList = []string{"http://localhost:4001"} + s.StorageConfig.ServerList = []string{"http://localhost:2379"} go func() { if err := Run(s); err != nil { t.Fatalf("Error in bringing up the server: %v", err) diff --git a/hack/lib/etcd.sh b/hack/lib/etcd.sh index 95685ac1080..13b4b709568 100644 --- a/hack/lib/etcd.sh +++ b/hack/lib/etcd.sh @@ -18,7 +18,7 @@ ETCD_VERSION=${ETCD_VERSION:-3.0.4} ETCD_HOST=${ETCD_HOST:-127.0.0.1} -ETCD_PORT=${ETCD_PORT:-4001} +ETCD_PORT=${ETCD_PORT:-2379} kube::etcd::start() { which etcd >/dev/null || { diff --git a/hack/make-rules/test-cmd.sh b/hack/make-rules/test-cmd.sh index 46322937085..ac8be3f3a45 100755 --- a/hack/make-rules/test-cmd.sh +++ b/hack/make-rules/test-cmd.sh @@ -138,7 +138,7 @@ make -C "${KUBE_ROOT}" WHAT="${BINS[*]}" kube::etcd::start ETCD_HOST=${ETCD_HOST:-127.0.0.1} -ETCD_PORT=${ETCD_PORT:-4001} +ETCD_PORT=${ETCD_PORT:-2379} API_PORT=${API_PORT:-8080} API_HOST=${API_HOST:-127.0.0.1} KUBELET_PORT=${KUBELET_PORT:-10250} @@ -1842,7 +1842,7 @@ __EOF__ kube::test::if_has_string "${output_message}" '\"etcd-server\" exposed' # Post-condition: generated service has both ports from the exposed pod kube::test::get_object_assert 'service etcd-server' "{{$port_name}} {{$port_field}}" 'port-1 2380' - kube::test::get_object_assert 'service etcd-server' "{{$second_port_name}} {{$second_port_field}}" 'port-2 4001' + kube::test::get_object_assert 'service etcd-server' "{{$second_port_name}} {{$second_port_field}}" 'port-2 2379' # Clean-up kubectl delete svc etcd-server "${kube_flags[@]}" diff --git a/hack/test-update-storage-objects.sh b/hack/test-update-storage-objects.sh index 1213a04b7bd..e282c6439d2 100755 --- a/hack/test-update-storage-objects.sh +++ b/hack/test-update-storage-objects.sh @@ -36,7 +36,7 @@ KUBE_STORAGE_MEDIA_TYPE_JSON="application/json" KUBE_STORAGE_MEDIA_TYPE_PROTOBUF="application/vnd.kubernetes.protobuf" ETCD_HOST=${ETCD_HOST:-127.0.0.1} -ETCD_PORT=${ETCD_PORT:-4001} +ETCD_PORT=${ETCD_PORT:-2379} ETCD_PREFIX=${ETCD_PREFIX:-randomPrefix} API_PORT=${API_PORT:-8080} API_HOST=${API_HOST:-127.0.0.1} diff --git a/hack/update-swagger-spec.sh b/hack/update-swagger-spec.sh index 66724189e2b..e249f17e1c4 100755 --- a/hack/update-swagger-spec.sh +++ b/hack/update-swagger-spec.sh @@ -52,7 +52,7 @@ apiserver=$(kube::util::find-binary "kube-apiserver") TMP_DIR=$(mktemp -d /tmp/update-swagger-spec.XXXX) ETCD_HOST=${ETCD_HOST:-127.0.0.1} -ETCD_PORT=${ETCD_PORT:-4001} +ETCD_PORT=${ETCD_PORT:-2379} API_PORT=${API_PORT:-8050} API_HOST=${API_HOST:-127.0.0.1} KUBELET_PORT=${KUBELET_PORT:-10250} diff --git a/pkg/api/deep_copy_test.go b/pkg/api/deep_copy_test.go index b10ec47e859..5c85edbcb52 100644 --- a/pkg/api/deep_copy_test.go +++ b/pkg/api/deep_copy_test.go @@ -71,9 +71,9 @@ var benchmarkPod api.Pod = api.Pod{ Command: []string{ "/usr/local/bin/etcd", "--addr", - "127.0.0.1:4001", + "127.0.0.1:2379", "--bind-addr", - "127.0.0.1:4001", + "127.0.0.1:2379", "--data-dir", "/var/etcd/data", }, @@ -86,8 +86,8 @@ var benchmarkPod api.Pod = api.Pod{ }, { Name: "clientport", - HostPort: 4001, - ContainerPort: 4001, + HostPort: 2379, + ContainerPort: 2379, Protocol: "TCP", }, }, diff --git a/pkg/master/master.go b/pkg/master/master.go index 654df45d3f5..59072cbf803 100644 --- a/pkg/master/master.go +++ b/pkg/master/master.go @@ -496,7 +496,7 @@ func (m *Master) getServersToValidate(c *Config) map[string]apiserver.Server { port, _ = strconv.Atoi(portString) } else { addr = etcdUrl.Host - port = 4001 + port = 2379 } // TODO: etcd health checking should be abstracted in the storage tier serversToValidate[fmt.Sprintf("etcd-%d", ix)] = apiserver.Server{ diff --git a/test/e2e/etcd_failure.go b/test/e2e/etcd_failure.go index ac2fa63805e..bec502ea3ca 100644 --- a/test/e2e/etcd_failure.go +++ b/test/e2e/etcd_failure.go @@ -52,8 +52,8 @@ var _ = framework.KubeDescribe("Etcd failure [Disruptive]", func() { It("should recover from network partition with master", func() { etcdFailTest( f, - "sudo iptables -A INPUT -p tcp --destination-port 4001 -j DROP", - "sudo iptables -D INPUT -p tcp --destination-port 4001 -j DROP", + "sudo iptables -A INPUT -p tcp --destination-port 2379 -j DROP", + "sudo iptables -D INPUT -p tcp --destination-port 2379 -j DROP", ) }) diff --git a/test/integration/framework/etcd_utils.go b/test/integration/framework/etcd_utils.go index 5d30439e8f2..66a50307f5f 100644 --- a/test/integration/framework/etcd_utils.go +++ b/test/integration/framework/etcd_utils.go @@ -29,13 +29,13 @@ import ( // If you need to start an etcd instance by hand, you also need to insert a key // for this check to pass (*any* key will do, eg: -//curl -L http://127.0.0.1:4001/v2/keys/message -XPUT -d value="Hello world"). +//curl -L http://127.0.0.1:2379/v2/keys/message -XPUT -d value="Hello world"). func init() { RequireEtcd() } func GetEtcdURLFromEnv() string { - url := env.GetEnvAsStringOrFallback("KUBE_INTEGRATION_ETCD_URL", "http://127.0.0.1:4001") + url := env.GetEnvAsStringOrFallback("KUBE_INTEGRATION_ETCD_URL", "http://127.0.0.1:2379") glog.V(4).Infof("Using KUBE_INTEGRATION_ETCD_URL=%q", url) return url } diff --git a/test/kubemark/start-kubemark-master.sh b/test/kubemark/start-kubemark-master.sh index 8c3f6423e56..3eed79718c0 100644 --- a/test/kubemark/start-kubemark-master.sh +++ b/test/kubemark/start-kubemark-master.sh @@ -31,8 +31,8 @@ fi sudo docker run --net=host -v /var/etcd/data:/var/etcd/data -d \ gcr.io/google_containers/etcd:3.0.4 /usr/local/bin/etcd \ --listen-peer-urls http://127.0.0.1:2380 \ - --advertise-client-urls=http://127.0.0.1:4001 \ - --listen-client-urls=http://0.0.0.0:4001 \ + --advertise-client-urls=http://127.0.0.1:2379 \ + --listen-client-urls=http://0.0.0.0:2379 \ --data-dir=/var/etcd/data # Increase the allowed number of open file descriptors @@ -44,7 +44,7 @@ kubernetes/server/bin/kube-scheduler --master=127.0.0.1:8080 $(cat scheduler_fla kubernetes/server/bin/kube-apiserver \ --address=0.0.0.0 \ - --etcd-servers=http://127.0.0.1:4001 \ + --etcd-servers=http://127.0.0.1:2379 \ --etcd-servers-overrides=/events#${EVENT_STORE_URL} \ --tls-cert-file=/srv/kubernetes/server.cert \ --tls-private-key-file=/srv/kubernetes/server.key \