mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 14:14:39 +00:00
test clusterip
This commit is contained in:
@@ -539,6 +539,22 @@ var _ = SIGDescribe("Loadbalancing: L7", func() {
|
||||
jig.WaitForIngress(true)
|
||||
})
|
||||
|
||||
It("should be able to create a ClusterIP service [Unreleased]", func() {
|
||||
var err error
|
||||
By("Create a basic HTTP ingress using NEG")
|
||||
jig.CreateIngress(filepath.Join(framework.IngressManifestPath, "neg-clusterip"), ns, map[string]string{}, map[string]string{})
|
||||
jig.WaitForIngress(true)
|
||||
svcPorts := jig.GetServicePorts(false)
|
||||
usingNEG, err := gceController.BackendServiceUsingNEG(svcPorts)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(usingNEG).To(BeTrue())
|
||||
|
||||
// ClusterIP ServicePorts have no NodePort
|
||||
for _, sp := range svcPorts {
|
||||
Expect(sp.NodePort).To(Equal(int32(0)))
|
||||
}
|
||||
})
|
||||
|
||||
It("should sync endpoints to NEG", func() {
|
||||
name := "hostname"
|
||||
scaleAndValidateNEG := func(num int) {
|
||||
|
@@ -0,0 +1,8 @@
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: hostname
|
||||
spec:
|
||||
backend:
|
||||
serviceName: hostname
|
||||
servicePort: 80
|
18
test/e2e/testing-manifests/ingress/neg-clusterip/rc.yaml
Normal file
18
test/e2e/testing-manifests/ingress/neg-clusterip/rc.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
run: hostname
|
||||
name: hostname
|
||||
spec:
|
||||
minReadySeconds: 60
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
run: hostname
|
||||
spec:
|
||||
containers:
|
||||
- image: gcr.io/kubernetes-e2e-test-images/serve-hostname-amd64:1.1
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: hostname
|
||||
terminationGracePeriodSeconds: 120
|
15
test/e2e/testing-manifests/ingress/neg-clusterip/svc.yaml
Normal file
15
test/e2e/testing-manifests/ingress/neg-clusterip/svc.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: hostname
|
||||
annotations:
|
||||
alpha.cloud.google.com/load-balancer-neg: "true"
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
protocol: TCP
|
||||
targetPort: 9376
|
||||
selector:
|
||||
run: hostname
|
||||
sessionAffinity: None
|
||||
type: ClusterIP
|
Reference in New Issue
Block a user