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
a9c5f675
Commit
a9c5f675
authored
Dec 13, 2016
by
Kubernetes Submit Queue
Committed by
GitHub
Dec 13, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #38668 from bprashanth/glbc_version
Automatic merge from submit-queue Bump glbc version, cleanup test Matches
https://github.com/kubernetes/ingress/pull/55
parents
3cc2625c
e4302a2b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
20 deletions
+47
-20
glbc.manifest
cluster/saltbase/salt/l7-gcp/glbc.manifest
+2
-2
ingress.go
test/e2e/ingress.go
+1
-1
ingress_utils.go
test/e2e/ingress_utils.go
+44
-17
No files found.
cluster/saltbase/salt/l7-gcp/glbc.manifest
View file @
a9c5f675
...
...
@@ -12,7 +12,7 @@ spec:
terminationGracePeriodSeconds: 600
hostNetwork: true
containers:
- image: gcr.io/google_containers/glbc:0.
8
.0
- image: gcr.io/google_containers/glbc:0.
9
.0
livenessProbe:
httpGet:
path: /healthz
...
...
@@ -43,7 +43,7 @@ spec:
# TODO: split this out into args when we no longer need to pipe stdout to a file #6428
- sh
- -c
- '/glbc --default-backend-service=kube-system/default-http-backend --sync-period=60s --running-in-cluster=false --use-real-cloud=true --config-file-path=/etc/gce.conf --healthz-port=8086 1>>/var/log/glbc.log 2>&1'
- '/glbc --
verbose=true --
default-backend-service=kube-system/default-http-backend --sync-period=60s --running-in-cluster=false --use-real-cloud=true --config-file-path=/etc/gce.conf --healthz-port=8086 1>>/var/log/glbc.log 2>&1'
volumes:
- hostPath:
path: /etc/gce.conf
...
...
test/e2e/ingress.go
View file @
a9c5f675
...
...
@@ -120,7 +120,7 @@ var _ = framework.KubeDescribe("Loadbalancing: L7", func() {
It
(
"shoud create ingress with given static-ip "
,
func
()
{
// ip released when the rest of lb resources are deleted in cleanupGCE
ip
:=
gceController
.
s
taticIP
(
ns
)
ip
:=
gceController
.
createS
taticIP
(
ns
)
By
(
fmt
.
Sprintf
(
"allocated static ip %v: %v through the GCE cloud provider"
,
ns
,
ip
))
jig
.
createIngress
(
filepath
.
Join
(
ingressManifestPath
,
"static-ip"
),
ns
,
map
[
string
]
string
{
...
...
test/e2e/ingress_utils.go
View file @
a9c5f675
...
...
@@ -335,6 +335,23 @@ func cleanupGCE(gceController *GCEIngressController) {
}
return
true
,
nil
})
// Static-IP allocated on behalf of the test, never deleted by the
// controller. Delete this IP only after the controller has had a chance
// to cleanup or it might interfere with the controller, causing it to
// throw out confusing events.
if
ipErr
:=
wait
.
Poll
(
5
*
time
.
Second
,
lbCleanupTimeout
,
func
()
(
bool
,
error
)
{
if
err
:=
gceController
.
deleteStaticIPs
();
err
!=
nil
{
framework
.
Logf
(
"Failed to delete static-ip: %v
\n
"
,
err
)
return
false
,
nil
}
return
true
,
nil
});
ipErr
!=
nil
{
// If this is a persistent error, the suite will fail when we run out
// of quota anyway.
By
(
fmt
.
Sprintf
(
"WARNING: possibly leaked static IP: %v
\n
"
,
ipErr
))
}
// Always try to cleanup even if pollErr == nil, because the cleanup
// routine also purges old leaked resources based on creation timestamp.
if
cleanupErr
:=
gceController
.
Cleanup
(
true
);
cleanupErr
!=
nil
{
...
...
@@ -342,6 +359,8 @@ func cleanupGCE(gceController *GCEIngressController) {
}
else
{
By
(
"No resources leaked."
)
}
// Fail if the controller didn't cleanup
if
pollErr
!=
nil
{
framework
.
Failf
(
"L7 controller failed to delete all cloud resources on time. %v"
,
pollErr
)
}
...
...
@@ -384,20 +403,6 @@ func (cont *GCEIngressController) deleteAddresses(del bool) string {
}
}
}
// If the test allocated a static ip, delete that regardless
if
cont
.
staticIPName
!=
""
{
if
err
:=
gcloudDelete
(
"addresses"
,
cont
.
staticIPName
,
cont
.
cloud
.
ProjectID
,
"--global"
);
err
==
nil
{
cont
.
staticIPName
=
""
}
}
else
{
e2eIPs
:=
[]
compute
.
Address
{}
gcloudList
(
"addresses"
,
"e2e-.*"
,
cont
.
cloud
.
ProjectID
,
&
e2eIPs
)
ips
:=
[]
string
{}
for
_
,
ip
:=
range
e2eIPs
{
ips
=
append
(
ips
,
ip
.
Name
)
}
framework
.
Logf
(
"None of the remaining %d static-ips were created by this e2e: %v"
,
len
(
ips
),
strings
.
Join
(
ips
,
", "
))
}
return
msg
}
...
...
@@ -664,9 +669,10 @@ func (cont *GCEIngressController) init() {
}
}
// staticIP allocates a random static ip with the given name. Returns a string
// representation of the ip. Caller is expected to manage cleanup of the ip.
func
(
cont
*
GCEIngressController
)
staticIP
(
name
string
)
string
{
// createStaticIP allocates a random static ip with the given name. Returns a string
// representation of the ip. Caller is expected to manage cleanup of the ip by
// invoking deleteStaticIPs.
func
(
cont
*
GCEIngressController
)
createStaticIP
(
name
string
)
string
{
gceCloud
:=
cont
.
cloud
.
Provider
.
(
*
gcecloud
.
GCECloud
)
ip
,
err
:=
gceCloud
.
ReserveGlobalStaticIP
(
name
,
""
)
if
err
!=
nil
{
...
...
@@ -684,6 +690,27 @@ func (cont *GCEIngressController) staticIP(name string) string {
return
ip
.
Address
}
// deleteStaticIPs delets all static-ips allocated through calls to
// createStaticIP.
func
(
cont
*
GCEIngressController
)
deleteStaticIPs
()
error
{
if
cont
.
staticIPName
!=
""
{
if
err
:=
gcloudDelete
(
"addresses"
,
cont
.
staticIPName
,
cont
.
cloud
.
ProjectID
,
"--global"
);
err
==
nil
{
cont
.
staticIPName
=
""
}
else
{
return
err
}
}
else
{
e2eIPs
:=
[]
compute
.
Address
{}
gcloudList
(
"addresses"
,
"e2e-.*"
,
cont
.
cloud
.
ProjectID
,
&
e2eIPs
)
ips
:=
[]
string
{}
for
_
,
ip
:=
range
e2eIPs
{
ips
=
append
(
ips
,
ip
.
Name
)
}
framework
.
Logf
(
"None of the remaining %d static-ips were created by this e2e: %v"
,
len
(
ips
),
strings
.
Join
(
ips
,
", "
))
}
return
nil
}
// gcloudList unmarshals json output of gcloud into given out interface.
func
gcloudList
(
resource
,
regex
,
project
string
,
out
interface
{})
{
// gcloud prints a message to stderr if it has an available update
...
...
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