Skip to content

Commit c008cf9

Browse files
authored
Merge pull request kubernetes#77865 from mgdevstack/promote-service-types-updates
Promote e2e verifying different types of services and their behaviours
2 parents 68d6ec9 + 7c64fc9 commit c008cf9

File tree

2 files changed

+49
-5
lines changed

2 files changed

+49
-5
lines changed

test/conformance/testdata/conformance.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ test/e2e/network/service.go: "should provide secure master service"
219219
test/e2e/network/service.go: "should serve a basic endpoint from pods"
220220
test/e2e/network/service.go: "should serve multiport endpoints from pods"
221221
test/e2e/network/service.go: "should be able to create a functioning NodePort service"
222+
test/e2e/network/service.go: "should be able to change the type from ExternalName to ClusterIP"
223+
test/e2e/network/service.go: "should be able to change the type from ExternalName to NodePort"
224+
test/e2e/network/service.go: "should be able to change the type from ClusterIP to ExternalName"
225+
test/e2e/network/service.go: "should be able to change the type from NodePort to ExternalName"
222226
test/e2e/network/service_latency.go: "should not be very high"
223227
test/e2e/node/events.go: "should be sent by kubelets and the scheduler about pods scheduling and running"
224228
test/e2e/node/pods.go: "should be submitted and removed"

test/e2e/network/service.go

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,12 @@ var _ = SIGDescribe("Services", func() {
911911
}
912912
})
913913

914+
/*
915+
Testname: Service, update NodePort, same port different protocol
916+
Description: Create a service of type ClusterIP to accept TCP requests. Service creation MUST be successful by assigning ClusterIP to the service.
917+
When service type is updated to NodePort to support two protocols i.e. TCP and UDP for same assigned service port 80, service update MUST be successful by allocating two NodePorts to the service.
918+
TODO: Test Service reachability, good to include this check in Conformance perspective.
919+
*/
914920
ginkgo.It("should be able to update NodePorts with two same port numbers but different protocols", func() {
915921
serviceName := "nodeport-update-service"
916922
ns := f.Namespace.Name
@@ -928,7 +934,6 @@ var _ = SIGDescribe("Services", func() {
928934
e2elog.Logf("service port TCP: %d", svcPort)
929935

930936
// Change the services to NodePort and add a UDP port.
931-
932937
ginkgo.By("changing the TCP service to type=NodePort and add a UDP port")
933938
newService := jig.UpdateServiceOrFail(ns, tcpService.Name, func(s *v1.Service) {
934939
s.Spec.Type = v1.ServiceTypeNodePort
@@ -958,7 +963,14 @@ var _ = SIGDescribe("Services", func() {
958963
}
959964
})
960965

961-
ginkgo.It("should be able to change the type from ExternalName to ClusterIP", func() {
966+
/*
967+
Release: v1.16
968+
Testname: Service, change type, ExternalName to ClusterIP
969+
Description: Create a service of type ExternalName, pointing to external DNS. ClusterIP MUST not be assigned to the service.
970+
Update the service from ExternalName to ClusterIP by removing ExternalName entry, assigning port 80 as service port and TCP as protocol.
971+
Service update MUST be successful by assigning ClusterIP to the service and it MUST be reachable over serviceName and ClusterIP on provided service port.
972+
*/
973+
framework.ConformanceIt("should be able to change the type from ExternalName to ClusterIP", func() {
962974
serviceName := "externalname-service"
963975
ns := f.Namespace.Name
964976
jig := e2eservice.NewTestJig(cs, serviceName)
@@ -986,7 +998,15 @@ var _ = SIGDescribe("Services", func() {
986998
jig.CheckServiceReachability(ns, clusterIPService, execPod)
987999
})
9881000

989-
ginkgo.It("should be able to change the type from ExternalName to NodePort", func() {
1001+
/*
1002+
Release: v1.16
1003+
Testname: Service, change type, ExternalName to NodePort
1004+
Description: Create a service of type ExternalName, pointing to external DNS. ClusterIP MUST not be assigned to the service.
1005+
Update the service from ExternalName to NodePort, assigning port 80 as service port and, TCP as protocol.
1006+
service update MUST be successful by exposing service on every node's IP on dynamically assigned NodePort and, ClusterIP MUST be assigned to route service requests.
1007+
Service MUST be reachable over serviceName and the ClusterIP on servicePort. Service MUST also be reachable over node's IP on NodePort.
1008+
*/
1009+
framework.ConformanceIt("should be able to change the type from ExternalName to NodePort", func() {
9901010
serviceName := "externalname-service"
9911011
ns := f.Namespace.Name
9921012
jig := e2eservice.NewTestJig(cs, serviceName)
@@ -1014,7 +1034,14 @@ var _ = SIGDescribe("Services", func() {
10141034
jig.CheckServiceReachability(ns, nodePortService, execPod)
10151035
})
10161036

1017-
ginkgo.It("should be able to change the type from ClusterIP to ExternalName", func() {
1037+
/*
1038+
Release: v1.16
1039+
Testname: Service, change type, ClusterIP to ExternalName
1040+
Description: Create a service of type ClusterIP. Service creation MUST be successful by assigning ClusterIP to the service.
1041+
Update service type from ClusterIP to ExternalName by setting CNAME entry as externalName. Service update MUST be successful and service MUST not has associated ClusterIP.
1042+
Service MUST be able to resolve to IP address by returning A records ensuring service is pointing to provided externalName.
1043+
*/
1044+
framework.ConformanceIt("should be able to change the type from ClusterIP to ExternalName", func() {
10181045
serviceName := "clusterip-service"
10191046
ns := f.Namespace.Name
10201047
jig := e2eservice.NewTestJig(cs, serviceName)
@@ -1045,7 +1072,14 @@ var _ = SIGDescribe("Services", func() {
10451072
jig.CheckServiceReachability(ns, externalNameService, execPod)
10461073
})
10471074

1048-
ginkgo.It("should be able to change the type from NodePort to ExternalName", func() {
1075+
/*
1076+
Release: v1.16
1077+
Testname: Service, change type, NodePort to ExternalName
1078+
Description: Create a service of type NodePort. Service creation MUST be successful by exposing service on every node's IP on dynamically assigned NodePort and, ClusterIP MUST be assigned to route service requests.
1079+
Update the service type from NodePort to ExternalName by setting CNAME entry as externalName. Service update MUST be successful and, MUST not has ClusterIP associated with the service and, allocated NodePort MUST be released.
1080+
Service MUST be able to resolve to IP address by returning A records ensuring service is pointing to provided externalName.
1081+
*/
1082+
framework.ConformanceIt("should be able to change the type from NodePort to ExternalName", func() {
10491083
serviceName := "nodeport-service"
10501084
ns := f.Namespace.Name
10511085
jig := e2eservice.NewTestJig(cs, serviceName)
@@ -1080,6 +1114,12 @@ var _ = SIGDescribe("Services", func() {
10801114

10811115
})
10821116

1117+
/*
1118+
Testname: Service, NodePort, same port different protocols
1119+
Description: Create a service of type NodePort listening on port 53 for two protocols TCP and UDP.
1120+
Service creation MUST be successful by assigning a ClusterIP and two unique nodePorts for each protocol, making service reachable on every node's IP and nodePort.
1121+
TODO: Test Service reachability, good to include this check in Conformance perspective.
1122+
*/
10831123
ginkgo.It("should use same NodePort with same port but different protocols", func() {
10841124
serviceName := "nodeports"
10851125
ns := f.Namespace.Name

0 commit comments

Comments
 (0)