Update etcd default ports for v3, and validate tests

pull/6/head
Timothy St. Clair 2016-08-10 15:39:36 -05:00
parent aedeccda95
commit 730fc70107
26 changed files with 46 additions and 46 deletions

View File

@ -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.

View File

@ -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:-""}

View File

@ -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"

View File

@ -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"}

View File

@ -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

View File

@ -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:

View File

@ -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}

View File

@ -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"

View File

@ -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"

View File

@ -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": [

View File

@ -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",

View File

@ -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",

View File

@ -63,7 +63,7 @@ touch /var/log/etcd-events.log:
- dir_mode: 755
- context:
suffix: ""
port: 4001
port: 2379
server_port: 2380
cpulimit: '"200m"'

View File

@ -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 = "" -%}

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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 || {

View File

@ -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[@]}"

View File

@ -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}

View File

@ -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}

View File

@ -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",
},
},

View File

@ -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{

View File

@ -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",
)
})

View File

@ -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
}

View File

@ -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 \