Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
ca332a39
Commit
ca332a39
authored
Nov 04, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16048 from bprashanth/IngressE2E
Auto commit by PR queue bot
parents
1d04c53f
3943c5af
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
145 additions
and
8 deletions
+145
-8
e2e.sh
hack/jenkins/e2e.sh
+7
-0
ingress.go
test/e2e/ingress.go
+0
-0
resize_nodes.go
test/e2e/resize_nodes.go
+7
-5
serviceloadbalancers.go
test/e2e/serviceloadbalancers.go
+8
-3
util.go
test/e2e/util.go
+33
-0
Dockerfile
test/images/n-way-http/Dockerfile
+18
-0
Makefile
test/images/n-way-http/Makefile
+17
-0
server.go
test/images/n-way-http/server.go
+55
-0
No files found.
hack/jenkins/e2e.sh
View file @
ca332a39
...
...
@@ -124,6 +124,7 @@ GKE_REQUIRED_SKIP_TESTS=(
# Tests which cannot be run on AWS.
AWS_REQUIRED_SKIP_TESTS
=(
"experimental
\s
resource
\s
usage
\s
tracking"
# Expect --max-pods=100
"GCE
\s
L7
\s
LoadBalancer
\s
Controller"
# GCE L7 loadbalancing
)
...
...
@@ -153,6 +154,11 @@ GCE_FLAKY_TESTS=(
# comments below, and for poorly implemented tests, please quote the
# issue number tracking speed improvements.
GCE_SLOW_TESTS
=(
# Before enabling this loadbalancer test in any other test list you must
# make sure the associated project has enough quota. At the time of this
# writing a GCE project is allowed 3 backend services by default. This
# test requires at least 5.
"GCE
\s
L7
\s
LoadBalancer
\s
Controller"
# 10 min, file: ingress.go, slow by design
"SchedulerPredicates
\s
validates
\s
MaxPods
\s
limit "
# 8 min, file: scheduler_predicates.go, PR: #13315
"Nodes
\s
Resize"
# 3 min 30 sec, file: resize_nodes.go, issue: #13323
"resource
\s
usage
\s
tracking"
# 1 hour, file: kubelet_perf.go, slow by design
...
...
@@ -164,6 +170,7 @@ GCE_SLOW_TESTS=(
# Tests which are not able to be run in parallel.
GCE_PARALLEL_SKIP_TESTS
=(
"GCE
\s
L7
\s
LoadBalancer
\s
Controller"
# TODO: This cannot run in parallel with other L4 tests till quota has been bumped up.
"Nodes
\s
Network"
"MaxPods"
"Resource
\s
usage
\s
of
\s
system
\s
containers"
...
...
test/e2e/ingress.go
0 → 100644
View file @
ca332a39
This diff is collapsed.
Click to expand it.
test/e2e/resize_nodes.go
View file @
ca332a39
...
...
@@ -41,6 +41,7 @@ const (
serveHostnameImage
=
"gcr.io/google_containers/serve_hostname:1.1"
resizeNodeReadyTimeout
=
2
*
time
.
Minute
resizeNodeNotReadyTimeout
=
2
*
time
.
Minute
testPort
=
9376
)
func
resizeGroup
(
size
int
)
error
{
...
...
@@ -111,25 +112,26 @@ func waitForGroupSize(size int) error {
return
fmt
.
Errorf
(
"timeout waiting %v for node instance group size to be %d"
,
timeout
,
size
)
}
func
svcByName
(
name
string
)
*
api
.
Service
{
func
svcByName
(
name
string
,
port
int
)
*
api
.
Service
{
return
&
api
.
Service
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"test-service"
,
Name
:
name
,
},
Spec
:
api
.
ServiceSpec
{
Type
:
api
.
ServiceTypeNodePort
,
Selector
:
map
[
string
]
string
{
"name"
:
name
,
},
Ports
:
[]
api
.
ServicePort
{{
Port
:
9376
,
TargetPort
:
util
.
NewIntOrStringFromInt
(
9376
),
Port
:
port
,
TargetPort
:
util
.
NewIntOrStringFromInt
(
port
),
}},
},
}
}
func
newSVCByName
(
c
*
client
.
Client
,
ns
,
name
string
)
error
{
_
,
err
:=
c
.
Services
(
ns
)
.
Create
(
svcByName
(
name
))
_
,
err
:=
c
.
Services
(
ns
)
.
Create
(
svcByName
(
name
,
testPort
))
return
err
}
...
...
test/e2e/serviceloadbalancers.go
View file @
ca332a39
...
...
@@ -195,7 +195,7 @@ func (s *ingManager) test(path string) error {
url
:=
fmt
.
Sprintf
(
"%v/hostName"
,
path
)
httpClient
:=
&
http
.
Client
{}
return
wait
.
Poll
(
pollInterval
,
serviceRespondingTimeout
,
func
()
(
bool
,
error
)
{
body
,
err
:=
simpleGET
(
httpClient
,
url
)
body
,
err
:=
simpleGET
(
httpClient
,
url
,
""
)
if
err
!=
nil
{
Logf
(
"%v
\n
%v
\n
%v"
,
url
,
body
,
err
)
return
false
,
nil
...
...
@@ -240,8 +240,13 @@ var _ = Describe("ServiceLoadBalancer", func() {
})
// simpleGET executes a get on the given url, returns error if non-200 returned.
func
simpleGET
(
c
*
http
.
Client
,
url
string
)
(
string
,
error
)
{
res
,
err
:=
c
.
Get
(
url
)
func
simpleGET
(
c
*
http
.
Client
,
url
,
host
string
)
(
string
,
error
)
{
req
,
err
:=
http
.
NewRequest
(
"GET"
,
url
,
nil
)
if
err
!=
nil
{
return
""
,
err
}
req
.
Host
=
host
res
,
err
:=
c
.
Do
(
req
)
if
err
!=
nil
{
return
""
,
err
}
...
...
test/e2e/util.go
View file @
ca332a39
...
...
@@ -2157,3 +2157,36 @@ func OpenWebSocketForURL(url *url.URL, config *client.Config, protocols []string
cfg
.
Protocol
=
protocols
return
websocket
.
DialConfig
(
cfg
)
}
// getIngressAddress returns the ips/hostnames associated with the Ingress.
func
getIngressAddress
(
client
*
client
.
Client
,
ns
,
name
string
)
([]
string
,
error
)
{
ing
,
err
:=
client
.
Extensions
()
.
Ingress
(
ns
)
.
Get
(
name
)
if
err
!=
nil
{
return
nil
,
err
}
addresses
:=
[]
string
{}
for
_
,
a
:=
range
ing
.
Status
.
LoadBalancer
.
Ingress
{
if
a
.
IP
!=
""
{
addresses
=
append
(
addresses
,
a
.
IP
)
}
if
a
.
Hostname
!=
""
{
addresses
=
append
(
addresses
,
a
.
Hostname
)
}
}
return
addresses
,
nil
}
// waitForIngressAddress waits for the Ingress to acquire an address.
func
waitForIngressAddress
(
c
*
client
.
Client
,
ns
,
ingName
string
,
timeout
time
.
Duration
)
(
string
,
error
)
{
var
address
string
err
:=
wait
.
PollImmediate
(
10
*
time
.
Second
,
timeout
,
func
()
(
bool
,
error
)
{
ipOrNameList
,
err
:=
getIngressAddress
(
c
,
ns
,
ingName
)
if
err
!=
nil
||
len
(
ipOrNameList
)
==
0
{
Logf
(
"Waiting for Ingress %v to acquire IP, error %v"
,
ingName
,
err
)
return
false
,
nil
}
address
=
ipOrNameList
[
0
]
return
true
,
nil
})
return
address
,
err
}
test/images/n-way-http/Dockerfile
0 → 100644
View file @
ca332a39
# Copyright 2015 The Kubernetes Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM
busybox
MAINTAINER
Prashanth B <beeps@google.com>
ADD
server server
ENTRYPOINT
["/server"]
test/images/n-way-http/Makefile
0 → 100644
View file @
ca332a39
all
:
push
# 0.0 shouldn't clobber any released builds
TAG
=
0.0
PREFIX
=
gcr.io/google_containers/n-way-http
server
:
server.go
CGO_ENABLED
=
0
GOOS
=
linux godep go build
-a
-installsuffix
cgo
-ldflags
'-w'
-o
server ./server.go
container
:
server
docker build
-t
$(PREFIX)
:
$(TAG)
.
push
:
container
gcloud docker push
$(PREFIX)
:
$(TAG)
clean
:
rm
-f
server
test/images/n-way-http/server.go
0 → 100644
View file @
ca332a39
/*
Copyright 2015 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// A webserver that runs n http handlers. Example invocation:
// - server -port 8080 -prefix foo -num 10 -start 0
// Will given you 10 /foo(i) endpoints that simply echo foo(i) when requested.
// - server -start 3 -num 1
// Will create just one endpoint, at /foo3
package
main
import
(
"flag"
"fmt"
"log"
"net/http"
)
var
(
port
=
flag
.
Int
(
"port"
,
8080
,
"Port number for requests."
)
prefix
=
flag
.
String
(
"prefix"
,
"foo"
,
"String used as path prefix"
)
num
=
flag
.
Int
(
"num"
,
10
,
"Number of endpoints to create."
)
start
=
flag
.
Int
(
"start"
,
0
,
"Index to start, only makes sense with --num"
)
)
func
main
()
{
flag
.
Parse
()
// This container is used to test the GCE L7 controller which expects "/"
// to return a 200 response.
http
.
HandleFunc
(
"/"
,
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
w
.
WriteHeader
(
http
.
StatusOK
)
fmt
.
Fprint
(
w
,
"ok"
)
})
for
i
:=
*
start
;
i
<
*
start
+*
num
;
i
++
{
path
:=
fmt
.
Sprintf
(
"%v%d"
,
*
prefix
,
i
)
http
.
HandleFunc
(
fmt
.
Sprintf
(
"/%v"
,
path
),
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
w
.
WriteHeader
(
http
.
StatusOK
)
fmt
.
Fprint
(
w
,
path
)
})
}
log
.
Printf
(
"server -port %d -prefix %v -num %d -start %d"
,
*
port
,
*
prefix
,
*
num
,
*
start
)
http
.
ListenAndServe
(
fmt
.
Sprintf
(
":%d"
,
*
port
),
nil
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment