Skip to content

Commit 53ffaa7

Browse files
authored
Merge pull request kubernetes#76443 from mgdevstack/promote-service-sessionaffinity
Promote e2e "verifying service's sessionAffinity for ClusterIP and NodePort services" to Conformance
2 parents 172553b + 7aa94a6 commit 53ffaa7

File tree

2 files changed

+159
-12
lines changed

2 files changed

+159
-12
lines changed

test/conformance/testdata/conformance.yaml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,13 +1644,107 @@
16441644
the NodePort.
16451645
release: v1.16
16461646
file: test/e2e/network/service.go
1647+
- testname: Service, NodePort type, session affinity to None
1648+
codename: '[sig-network] Services should be able to switch session affinity for
1649+
NodePort service [LinuxOnly] [Conformance]'
1650+
description: 'Create a service of type "NodePort" and provide service port and protocol.
1651+
Service''s sessionAffinity is set to "ClientIP". Service creation MUST be successful
1652+
by assigning a "ClusterIP" to the service and allocating NodePort on all the nodes.
1653+
Create a Replication Controller to ensure that 3 pods are running and are targeted
1654+
by the service to serve hostname of the pod when requests are sent to the service.
1655+
Create another pod to make requests to the service. Update the service''s sessionAffinity
1656+
to "None". Service update MUST be successful. When a requests are made to the
1657+
service on node''s IP and NodePort, service MUST be able serve the hostname from
1658+
any pod of the replica. When service''s sessionAffinily is updated back to "ClientIP",
1659+
service MUST serve the hostname from the same pod of the replica for all consecutive
1660+
requests. Service MUST be reachable over serviceName and the ClusterIP on servicePort.
1661+
Service MUST also be reachable over node''s IP on NodePort. [LinuxOnly]: Windows
1662+
does not support session affinity.'
1663+
release: v1.19
1664+
file: test/e2e/network/service.go
1665+
- testname: Service, ClusterIP type, session affinity to None
1666+
codename: '[sig-network] Services should be able to switch session affinity for
1667+
service with type clusterIP [LinuxOnly] [Conformance]'
1668+
description: 'Create a service of type "ClusterIP". Service''s sessionAffinity is
1669+
set to "ClientIP". Service creation MUST be successful by assigning "ClusterIP"
1670+
to the service. Create a Replication Controller to ensure that 3 pods are running
1671+
and are targeted by the service to serve hostname of the pod when requests are
1672+
sent to the service. Create another pod to make requests to the service. Update
1673+
the service''s sessionAffinity to "None". Service update MUST be successful. When
1674+
a requests are made to the service, it MUST be able serve the hostname from any
1675+
pod of the replica. When service''s sessionAffinily is updated back to "ClientIP",
1676+
service MUST serve the hostname from the same pod of the replica for all consecutive
1677+
requests. Service MUST be reachable over serviceName and the ClusterIP on servicePort.
1678+
[LinuxOnly]: Windows does not support session affinity.'
1679+
release: v1.19
1680+
file: test/e2e/network/service.go
16471681
- testname: Find Kubernetes Service in default Namespace
16481682
codename: '[sig-network] Services should find a service from listing all namespaces
16491683
[Conformance]'
16501684
description: List all Services in all Namespaces, response MUST include a Service
16511685
named Kubernetes with the Namespace of default.
16521686
release: v1.18
16531687
file: test/e2e/network/service.go
1688+
- testname: Service, NodePort type, session affinity to ClientIP with timeout
1689+
codename: '[sig-network] Services should have session affinity timeout work for
1690+
NodePort service [LinuxOnly] [Conformance]'
1691+
description: 'Create a service of type "NodePort" and provide service port and protocol.
1692+
Service''s sessionAffinity is set to "ClientIP" and session affinity timeout is
1693+
set. Service creation MUST be successful by assigning a "ClusterIP" to service
1694+
and allocating NodePort on all nodes. Create a Replication Controller to ensure
1695+
that 3 pods are running and are targeted by the service to serve hostname of the
1696+
pod when requests are sent to the service. Create another pod to make requests
1697+
to the service on node''s IP and NodePort. Service MUST serve the hostname from
1698+
the same pod of the replica for all consecutive requests until timeout. After
1699+
timeout, requests MUST be served from different pods of the replica. Service MUST
1700+
be reachable over serviceName and the ClusterIP on servicePort. Service MUST also
1701+
be reachable over node''s IP on NodePort. [LinuxOnly]: Windows does not support
1702+
session affinity.'
1703+
release: v1.19
1704+
file: test/e2e/network/service.go
1705+
- testname: Service, ClusterIP type, session affinity to ClientIP with timeout
1706+
codename: '[sig-network] Services should have session affinity timeout work for
1707+
service with type clusterIP [LinuxOnly] [Conformance]'
1708+
description: 'Create a service of type "ClusterIP". Service''s sessionAffinity is
1709+
set to "ClientIP" and session affinity timeout is set. Service creation MUST be
1710+
successful by assigning "ClusterIP" to the service. Create a Replication Controller
1711+
to ensure that 3 pods are running and are targeted by the service to serve hostname
1712+
of the pod when requests are sent to the service. Create another pod to make requests
1713+
to the service. Service MUST serve the hostname from the same pod of the replica
1714+
for all consecutive requests until timeout expires. After timeout, requests MUST
1715+
be served from different pods of the replica. Service MUST be reachable over serviceName
1716+
and the ClusterIP on servicePort. [LinuxOnly]: Windows does not support session
1717+
affinity.'
1718+
release: v1.19
1719+
file: test/e2e/network/service.go
1720+
- testname: Service, NodePort type, session affinity to ClientIP
1721+
codename: '[sig-network] Services should have session affinity work for NodePort
1722+
service [LinuxOnly] [Conformance]'
1723+
description: 'Create a service of type "NodePort" and provide service port and protocol.
1724+
Service''s sessionAffinity is set to "ClientIP". Service creation MUST be successful
1725+
by assigning a "ClusterIP" to service and allocating NodePort on all nodes. Create
1726+
a Replication Controller to ensure that 3 pods are running and are targeted by
1727+
the service to serve hostname of the pod when a requests are sent to the service.
1728+
Create another pod to make requests to the service on node''s IP and NodePort.
1729+
Service MUST serve the hostname from the same pod of the replica for all consecutive
1730+
requests. Service MUST be reachable over serviceName and the ClusterIP on servicePort.
1731+
Service MUST also be reachable over node''s IP on NodePort. [LinuxOnly]: Windows
1732+
does not support session affinity.'
1733+
release: v1.19
1734+
file: test/e2e/network/service.go
1735+
- testname: Service, ClusterIP type, session affinity to ClientIP
1736+
codename: '[sig-network] Services should have session affinity work for service
1737+
with type clusterIP [LinuxOnly] [Conformance]'
1738+
description: 'Create a service of type "ClusterIP". Service''s sessionAffinity is
1739+
set to "ClientIP". Service creation MUST be successful by assigning "ClusterIP"
1740+
to the service. Create a Replication Controller to ensure that 3 pods are running
1741+
and are targeted by the service to serve hostname of the pod when requests are
1742+
sent to the service. Create another pod to make requests to the service. Service
1743+
MUST serve the hostname from the same pod of the replica for all consecutive requests.
1744+
Service MUST be reachable over serviceName and the ClusterIP on servicePort. [LinuxOnly]:
1745+
Windows does not support session affinity.'
1746+
release: v1.19
1747+
file: test/e2e/network/service.go
16541748
- testname: Kubernetes Service
16551749
codename: '[sig-network] Services should provide secure master service [Conformance]'
16561750
description: By default when a kubernetes cluster is running there MUST be a 'kubernetes'

test/e2e/network/service.go

Lines changed: 65 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2355,43 +2355,96 @@ var _ = SIGDescribe("Services", func() {
23552355
}
23562356
})
23572357

2358-
// [LinuxOnly]: Windows does not support session affinity.
2359-
ginkgo.It("should have session affinity work for service with type clusterIP [LinuxOnly]", func() {
2358+
/*
2359+
Release: v1.19
2360+
Testname: Service, ClusterIP type, session affinity to ClientIP
2361+
Description: Create a service of type "ClusterIP". Service's sessionAffinity is set to "ClientIP". Service creation MUST be successful by assigning "ClusterIP" to the service.
2362+
Create a Replication Controller to ensure that 3 pods are running and are targeted by the service to serve hostname of the pod when requests are sent to the service.
2363+
Create another pod to make requests to the service. Service MUST serve the hostname from the same pod of the replica for all consecutive requests.
2364+
Service MUST be reachable over serviceName and the ClusterIP on servicePort.
2365+
[LinuxOnly]: Windows does not support session affinity.
2366+
*/
2367+
framework.ConformanceIt("should have session affinity work for service with type clusterIP [LinuxOnly]", func() {
23602368
svc := getServeHostnameService("affinity-clusterip")
23612369
svc.Spec.Type = v1.ServiceTypeClusterIP
23622370
execAffinityTestForNonLBService(f, cs, svc)
23632371
})
23642372

2365-
// [LinuxOnly]: Windows does not support session affinity.
2366-
ginkgo.It("should have session affinity timeout work for service with type clusterIP [LinuxOnly]", func() {
2373+
/*
2374+
Release: v1.19
2375+
Testname: Service, ClusterIP type, session affinity to ClientIP with timeout
2376+
Description: Create a service of type "ClusterIP". Service's sessionAffinity is set to "ClientIP" and session affinity timeout is set. Service creation MUST be successful by assigning "ClusterIP" to the service.
2377+
Create a Replication Controller to ensure that 3 pods are running and are targeted by the service to serve hostname of the pod when requests are sent to the service.
2378+
Create another pod to make requests to the service. Service MUST serve the hostname from the same pod of the replica for all consecutive requests until timeout expires.
2379+
After timeout, requests MUST be served from different pods of the replica.
2380+
Service MUST be reachable over serviceName and the ClusterIP on servicePort.
2381+
[LinuxOnly]: Windows does not support session affinity.
2382+
*/
2383+
framework.ConformanceIt("should have session affinity timeout work for service with type clusterIP [LinuxOnly]", func() {
23672384
svc := getServeHostnameService("affinity-clusterip-timeout")
23682385
svc.Spec.Type = v1.ServiceTypeClusterIP
23692386
execAffinityTestForSessionAffinityTimeout(f, cs, svc)
23702387
})
23712388

2372-
// [LinuxOnly]: Windows does not support session affinity.
2373-
ginkgo.It("should be able to switch session affinity for service with type clusterIP [LinuxOnly]", func() {
2389+
/*
2390+
Release: v1.19
2391+
Testname: Service, ClusterIP type, session affinity to None
2392+
Description: Create a service of type "ClusterIP". Service's sessionAffinity is set to "ClientIP". Service creation MUST be successful by assigning "ClusterIP" to the service.
2393+
Create a Replication Controller to ensure that 3 pods are running and are targeted by the service to serve hostname of the pod when requests are sent to the service.
2394+
Create another pod to make requests to the service. Update the service's sessionAffinity to "None". Service update MUST be successful. When a requests are made to the service, it MUST be able serve the hostname from any pod of the replica.
2395+
When service's sessionAffinily is updated back to "ClientIP", service MUST serve the hostname from the same pod of the replica for all consecutive requests.
2396+
Service MUST be reachable over serviceName and the ClusterIP on servicePort.
2397+
[LinuxOnly]: Windows does not support session affinity.
2398+
*/
2399+
framework.ConformanceIt("should be able to switch session affinity for service with type clusterIP [LinuxOnly]", func() {
23742400
svc := getServeHostnameService("affinity-clusterip-transition")
23752401
svc.Spec.Type = v1.ServiceTypeClusterIP
23762402
execAffinityTestForNonLBServiceWithTransition(f, cs, svc)
23772403
})
23782404

2379-
// [LinuxOnly]: Windows does not support session affinity.
2380-
ginkgo.It("should have session affinity work for NodePort service [LinuxOnly]", func() {
2405+
/*
2406+
Release: v1.19
2407+
Testname: Service, NodePort type, session affinity to ClientIP
2408+
Description: Create a service of type "NodePort" and provide service port and protocol. Service's sessionAffinity is set to "ClientIP". Service creation MUST be successful by assigning a "ClusterIP" to service and allocating NodePort on all nodes.
2409+
Create a Replication Controller to ensure that 3 pods are running and are targeted by the service to serve hostname of the pod when a requests are sent to the service.
2410+
Create another pod to make requests to the service on node's IP and NodePort. Service MUST serve the hostname from the same pod of the replica for all consecutive requests.
2411+
Service MUST be reachable over serviceName and the ClusterIP on servicePort. Service MUST also be reachable over node's IP on NodePort.
2412+
[LinuxOnly]: Windows does not support session affinity.
2413+
*/
2414+
framework.ConformanceIt("should have session affinity work for NodePort service [LinuxOnly]", func() {
23812415
svc := getServeHostnameService("affinity-nodeport")
23822416
svc.Spec.Type = v1.ServiceTypeNodePort
23832417
execAffinityTestForNonLBService(f, cs, svc)
23842418
})
23852419

2386-
// [LinuxOnly]: Windows does not support session affinity.
2387-
ginkgo.It("should have session affinity timeout work for NodePort service [LinuxOnly]", func() {
2420+
/*
2421+
Release: v1.19
2422+
Testname: Service, NodePort type, session affinity to ClientIP with timeout
2423+
Description: Create a service of type "NodePort" and provide service port and protocol. Service's sessionAffinity is set to "ClientIP" and session affinity timeout is set.
2424+
Service creation MUST be successful by assigning a "ClusterIP" to service and allocating NodePort on all nodes.
2425+
Create a Replication Controller to ensure that 3 pods are running and are targeted by the service to serve hostname of the pod when requests are sent to the service.
2426+
Create another pod to make requests to the service on node's IP and NodePort. Service MUST serve the hostname from the same pod of the replica for all consecutive requests until timeout.
2427+
After timeout, requests MUST be served from different pods of the replica.
2428+
Service MUST be reachable over serviceName and the ClusterIP on servicePort. Service MUST also be reachable over node's IP on NodePort.
2429+
[LinuxOnly]: Windows does not support session affinity.
2430+
*/
2431+
framework.ConformanceIt("should have session affinity timeout work for NodePort service [LinuxOnly]", func() {
23882432
svc := getServeHostnameService("affinity-nodeport-timeout")
23892433
svc.Spec.Type = v1.ServiceTypeNodePort
23902434
execAffinityTestForSessionAffinityTimeout(f, cs, svc)
23912435
})
23922436

2393-
// [LinuxOnly]: Windows does not support session affinity.
2394-
ginkgo.It("should be able to switch session affinity for NodePort service [LinuxOnly]", func() {
2437+
/*
2438+
Release: v1.19
2439+
Testname: Service, NodePort type, session affinity to None
2440+
Description: Create a service of type "NodePort" and provide service port and protocol. Service's sessionAffinity is set to "ClientIP". Service creation MUST be successful by assigning a "ClusterIP" to the service and allocating NodePort on all the nodes.
2441+
Create a Replication Controller to ensure that 3 pods are running and are targeted by the service to serve hostname of the pod when requests are sent to the service.
2442+
Create another pod to make requests to the service. Update the service's sessionAffinity to "None". Service update MUST be successful. When a requests are made to the service on node's IP and NodePort, service MUST be able serve the hostname from any pod of the replica.
2443+
When service's sessionAffinily is updated back to "ClientIP", service MUST serve the hostname from the same pod of the replica for all consecutive requests.
2444+
Service MUST be reachable over serviceName and the ClusterIP on servicePort. Service MUST also be reachable over node's IP on NodePort.
2445+
[LinuxOnly]: Windows does not support session affinity.
2446+
*/
2447+
framework.ConformanceIt("should be able to switch session affinity for NodePort service [LinuxOnly]", func() {
23952448
svc := getServeHostnameService("affinity-nodeport-transition")
23962449
svc.Spec.Type = v1.ServiceTypeNodePort
23972450
execAffinityTestForNonLBServiceWithTransition(f, cs, svc)

0 commit comments

Comments
 (0)