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
2e1d61a0
Commit
2e1d61a0
authored
Nov 02, 2017
by
nikhiljindal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding an e2e test for gce multi cluster ingress
parent
dc35709e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
4 deletions
+33
-4
ingress_utils.go
test/e2e/framework/ingress_utils.go
+7
-2
ingress.go
test/e2e/network/ingress.go
+26
-2
No files found.
test/e2e/framework/ingress_utils.go
View file @
2e1d61a0
...
...
@@ -62,7 +62,12 @@ const (
validFor
=
365
*
24
*
time
.
Hour
// Ingress class annotation defined in ingress repository.
ingressClass
=
"kubernetes.io/ingress.class"
// TODO: All these annotations should be reused from
// ingress-gce/pkg/annotations instead of duplicating them here.
IngressClass
=
"kubernetes.io/ingress.class"
// Ingress class annotation value for multi cluster ingress.
MulticlusterIngressClassValue
=
"gce-multi-cluster"
// all cloud resources created by the ingress controller start with this
// prefix.
...
...
@@ -937,7 +942,7 @@ func (j *IngressTestJig) CreateIngress(manifestPath, ns string, ingAnnotations m
j
.
Ingress
,
err
=
manifest
.
IngressFromManifest
(
filepath
.
Join
(
manifestPath
,
"ing.yaml"
))
ExpectNoError
(
err
)
j
.
Ingress
.
Namespace
=
ns
j
.
Ingress
.
Annotations
=
map
[
string
]
string
{
i
ngressClass
:
j
.
Class
}
j
.
Ingress
.
Annotations
=
map
[
string
]
string
{
I
ngressClass
:
j
.
Class
}
for
k
,
v
:=
range
ingAnnotations
{
j
.
Ingress
.
Annotations
[
k
]
=
v
}
...
...
test/e2e/network/ingress.go
View file @
2e1d61a0
...
...
@@ -33,8 +33,9 @@ import (
)
const
(
NEGAnnotation
=
"alpha.cloud.google.com/load-balancer-neg"
NEGUpdateTimeout
=
2
*
time
.
Minute
NEGAnnotation
=
"alpha.cloud.google.com/load-balancer-neg"
NEGUpdateTimeout
=
2
*
time
.
Minute
instanceGroupAnnotation
=
"ingress.gcp.kubernetes.io/instance-groups"
)
var
_
=
SIGDescribe
(
"Loadbalancing: L7"
,
func
()
{
...
...
@@ -153,6 +154,29 @@ var _ = SIGDescribe("Loadbalancing: L7", func() {
// framework.ExpectNoError(jig.verifyURL(fmt.Sprintf("https://%v/", ip), "", 30, 1*time.Second, httpClient))
})
It
(
"multicluster ingress should get instance group annotation"
,
func
()
{
name
:=
"echomap"
jig
.
CreateIngress
(
filepath
.
Join
(
framework
.
IngressManifestPath
,
"http"
),
ns
,
map
[
string
]
string
{
framework
.
IngressClass
:
framework
.
MulticlusterIngressClassValue
,
},
map
[
string
]
string
{})
By
(
fmt
.
Sprintf
(
"waiting for Ingress %s to come up"
,
name
))
pollErr
:=
wait
.
Poll
(
2
*
time
.
Second
,
framework
.
LoadBalancerPollTimeout
,
func
()
(
bool
,
error
)
{
ing
,
err
:=
f
.
ClientSet
.
ExtensionsV1beta1
()
.
Ingresses
(
ns
)
.
Get
(
name
,
metav1
.
GetOptions
{})
framework
.
ExpectNoError
(
err
)
annotations
:=
ing
.
Annotations
if
annotations
==
nil
||
annotations
[
instanceGroupAnnotation
]
==
""
{
framework
.
Logf
(
"Waiting for ingress to get %s annotation. Found annotations: %v"
,
instanceGroupAnnotation
,
annotations
)
return
false
,
nil
}
return
true
,
nil
})
if
pollErr
!=
nil
{
framework
.
ExpectNoError
(
fmt
.
Errorf
(
"Timed out waiting for ingress %s to get %s annotation"
,
name
,
instanceGroupAnnotation
))
}
// TODO(nikhiljindal): Check the instance group annotation value and verify with a multizone cluster.
})
// TODO: Implement a multizone e2e that verifies traffic reaches each
// zone based on pod labels.
})
...
...
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