e2e: use framework labels
This changes the text registration so that tags for which the framework has a dedicated API (features, feature gates, slow, serial, etc.) those APIs are used. Arbitrary, custom tags are still left in place for now.
This commit is contained in:
parent
833156b77e
commit
f2cfbf44b1
2
test/conformance/testdata/conformance.yaml
vendored
2
test/conformance/testdata/conformance.yaml
vendored
@ -3035,7 +3035,7 @@
|
|||||||
file: test/e2e/storage/persistent_volumes.go
|
file: test/e2e/storage/persistent_volumes.go
|
||||||
- testname: Projected Volume, multiple projections
|
- testname: Projected Volume, multiple projections
|
||||||
codename: '[sig-storage] Projected combined should project all components that make
|
codename: '[sig-storage] Projected combined should project all components that make
|
||||||
up the projection API [Projection][NodeConformance] [Conformance]'
|
up the projection API [Projection] [NodeConformance] [Conformance]'
|
||||||
description: A Pod is created with a projected volume source for secrets, configMap
|
description: A Pod is created with a projected volume source for secrets, configMap
|
||||||
and downwardAPI with pod name, cpu and memory limits and cpu and memory requests.
|
and downwardAPI with pod name, cpu and memory limits and cpu and memory requests.
|
||||||
Pod MUST be able to read the secrets, configMap values and the cpu and memory
|
Pod MUST be able to read the secrets, configMap values and the cpu and memory
|
||||||
|
@ -59,7 +59,7 @@ import (
|
|||||||
"github.com/onsi/ginkgo"
|
"github.com/onsi/ginkgo"
|
||||||
"k8s.io/kubernetes/test/e2e/lifecycle"
|
"k8s.io/kubernetes/test/e2e/lifecycle"
|
||||||
)
|
)
|
||||||
var _ = lifecycle.SIGDescribe("[Feature:BootstrapTokens]", func() {
|
var _ = lifecycle.SIGDescribe("cluster", feature.BootstrapTokens, func() {
|
||||||
/* ... */
|
/* ... */
|
||||||
ginkgo.It("should sign the new added bootstrap tokens", func(ctx context.Context) {
|
ginkgo.It("should sign the new added bootstrap tokens", func(ctx context.Context) {
|
||||||
/* ... */
|
/* ... */
|
||||||
|
@ -26,13 +26,13 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/onsi/ginkgo/v2"
|
|
||||||
"github.com/onsi/gomega"
|
"github.com/onsi/gomega"
|
||||||
"golang.org/x/crypto/cryptobyte"
|
"golang.org/x/crypto/cryptobyte"
|
||||||
|
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
@ -80,11 +80,11 @@ func restartAPIServer(ctx context.Context, node *v1.Node) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This test requires that --feature-gates=APIServerIdentity=true be set on the apiserver
|
// This test requires that --feature-gates=APIServerIdentity=true be set on the apiserver
|
||||||
var _ = SIGDescribe("kube-apiserver identity [Feature:APIServerIdentity]", func() {
|
var _ = SIGDescribe("kube-apiserver identity", feature.APIServerIdentity, func() {
|
||||||
f := framework.NewDefaultFramework("kube-apiserver-identity")
|
f := framework.NewDefaultFramework("kube-apiserver-identity")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
|
|
||||||
ginkgo.It("kube-apiserver identity should persist after restart [Disruptive]", func(ctx context.Context) {
|
f.It("kube-apiserver identity should persist after restart", f.WithDisruptive(), func(ctx context.Context) {
|
||||||
e2eskipper.SkipUnlessProviderIs("gce")
|
e2eskipper.SkipUnlessProviderIs("gce")
|
||||||
|
|
||||||
client := f.ClientSet
|
client := f.ClientSet
|
||||||
|
@ -141,7 +141,7 @@ var _ = SIGDescribe("Servers with support for API chunking", func() {
|
|||||||
MUST return the remaining items in chunks of the size not exceeding the limit, with appropriately
|
MUST return the remaining items in chunks of the size not exceeding the limit, with appropriately
|
||||||
set RemainingItems field in the response and with the ResourceVersion returned as part of the inconsistent list.
|
set RemainingItems field in the response and with the ResourceVersion returned as part of the inconsistent list.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should support continue listing from the last key if the original version has been compacted away, though the list is inconsistent [Slow]", func(ctx context.Context) {
|
framework.ConformanceIt("should support continue listing from the last key if the original version has been compacted away, though the list is inconsistent", f.WithSlow(), func(ctx context.Context) {
|
||||||
ns := f.Namespace.Name
|
ns := f.Namespace.Name
|
||||||
c := f.ClientSet
|
c := f.ClientSet
|
||||||
client := c.CoreV1().PodTemplates(ns)
|
client := c.CoreV1().PodTemplates(ns)
|
||||||
|
@ -36,7 +36,7 @@ import (
|
|||||||
"github.com/onsi/ginkgo/v2"
|
"github.com/onsi/ginkgo/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("Etcd failure [Disruptive]", func() {
|
var _ = SIGDescribe("Etcd failure", framework.WithDisruptive(), func() {
|
||||||
|
|
||||||
f := framework.NewDefaultFramework("etcd-failure")
|
f := framework.NewDefaultFramework("etcd-failure")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
|
@ -36,6 +36,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
clientscheme "k8s.io/client-go/kubernetes/scheme"
|
clientscheme "k8s.io/client-go/kubernetes/scheme"
|
||||||
"k8s.io/client-go/util/retry"
|
"k8s.io/client-go/util/retry"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||||
@ -231,7 +232,7 @@ func ensureServicesAreRemovedWhenNamespaceIsDeleted(ctx context.Context, f *fram
|
|||||||
// that each have a variable amount of content in the associated Namespace.
|
// that each have a variable amount of content in the associated Namespace.
|
||||||
// When run in [Serial] this test appears to delete Namespace objects at a
|
// When run in [Serial] this test appears to delete Namespace objects at a
|
||||||
// rate of approximately 1 per second.
|
// rate of approximately 1 per second.
|
||||||
var _ = SIGDescribe("Namespaces [Serial]", func() {
|
var _ = SIGDescribe("Namespaces", framework.WithSerial(), func() {
|
||||||
|
|
||||||
f := framework.NewDefaultFramework("namespaces")
|
f := framework.NewDefaultFramework("namespaces")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
||||||
@ -259,7 +260,7 @@ var _ = SIGDescribe("Namespaces [Serial]", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// On hold until etcd3; see #7372
|
// On hold until etcd3; see #7372
|
||||||
ginkgo.It("should always delete fast (ALL of 100 namespaces in 150 seconds) [Feature:ComprehensiveNamespaceDraining]", func(ctx context.Context) {
|
f.It("should always delete fast (ALL of 100 namespaces in 150 seconds)", feature.ComprehensiveNamespaceDraining, func(ctx context.Context) {
|
||||||
extinguish(ctx, f, 100, 0, 150)
|
extinguish(ctx, f, 100, 0, 150)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ import (
|
|||||||
watchtools "k8s.io/client-go/tools/watch"
|
watchtools "k8s.io/client-go/tools/watch"
|
||||||
"k8s.io/client-go/util/retry"
|
"k8s.io/client-go/util/retry"
|
||||||
"k8s.io/kubernetes/pkg/quota/v1/evaluator/core"
|
"k8s.io/kubernetes/pkg/quota/v1/evaluator/core"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
"k8s.io/kubernetes/test/utils/crd"
|
"k8s.io/kubernetes/test/utils/crd"
|
||||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||||
@ -1203,7 +1204,7 @@ var _ = SIGDescribe("ResourceQuota", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
var _ = SIGDescribe("ResourceQuota [Feature:ScopeSelectors]", func() {
|
var _ = SIGDescribe("ResourceQuota", feature.ScopeSelectors, func() {
|
||||||
f := framework.NewDefaultFramework("scope-selectors")
|
f := framework.NewDefaultFramework("scope-selectors")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
||||||
ginkgo.It("should verify ResourceQuota with best effort scope using scope-selectors.", func(ctx context.Context) {
|
ginkgo.It("should verify ResourceQuota with best effort scope using scope-selectors.", func(ctx context.Context) {
|
||||||
@ -1384,7 +1385,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:ScopeSelectors]", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
var _ = SIGDescribe("ResourceQuota [Feature:PodPriority]", func() {
|
var _ = SIGDescribe("ResourceQuota", feature.PodPriority, func() {
|
||||||
f := framework.NewDefaultFramework("resourcequota-priorityclass")
|
f := framework.NewDefaultFramework("resourcequota-priorityclass")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ import (
|
|||||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
|
|
||||||
@ -36,7 +37,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// This test requires that --feature-gates=APIServerIdentity=true,StorageVersionAPI=true be set on the apiserver and the controller manager
|
// This test requires that --feature-gates=APIServerIdentity=true,StorageVersionAPI=true be set on the apiserver and the controller manager
|
||||||
var _ = SIGDescribe("StorageVersion resources [Feature:StorageVersionAPI]", func() {
|
var _ = SIGDescribe("StorageVersion resources", feature.StorageVersionAPI, func() {
|
||||||
f := framework.NewDefaultFramework("storage-version")
|
f := framework.NewDefaultFramework("storage-version")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
|
|
||||||
|
@ -32,10 +32,11 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
"k8s.io/apimachinery/pkg/watch"
|
"k8s.io/apimachinery/pkg/watch"
|
||||||
"k8s.io/client-go/tools/cache"
|
"k8s.io/client-go/tools/cache"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("API Streaming (aka. WatchList) [Serial] [Feature:WatchList]", func() {
|
var _ = SIGDescribe("API Streaming (aka. WatchList)", framework.WithSerial(), feature.WatchList, func() {
|
||||||
f := framework.NewDefaultFramework("watchlist")
|
f := framework.NewDefaultFramework("watchlist")
|
||||||
ginkgo.It("should be requested when ENABLE_CLIENT_GO_WATCH_LIST_ALPHA is set", func(ctx context.Context) {
|
ginkgo.It("should be requested when ENABLE_CLIENT_GO_WATCH_LIST_ALPHA is set", func(ctx context.Context) {
|
||||||
prevWatchListEnvValue, wasWatchListEnvSet := os.LookupEnv("ENABLE_CLIENT_GO_WATCH_LIST_ALPHA")
|
prevWatchListEnvValue, wasWatchListEnvSet := os.LookupEnv("ENABLE_CLIENT_GO_WATCH_LIST_ALPHA")
|
||||||
|
@ -54,7 +54,7 @@ const (
|
|||||||
// happen. In the future, running in parallel may work if we have an eviction
|
// happen. In the future, running in parallel may work if we have an eviction
|
||||||
// model which lets the DS controller kick out other pods to make room.
|
// model which lets the DS controller kick out other pods to make room.
|
||||||
// See https://issues.k8s.io/21767 for more details
|
// See https://issues.k8s.io/21767 for more details
|
||||||
var _ = SIGDescribe("ControllerRevision [Serial]", func() {
|
var _ = SIGDescribe("ControllerRevision", framework.WithSerial(), func() {
|
||||||
var f *framework.Framework
|
var f *framework.Framework
|
||||||
|
|
||||||
ginkgo.AfterEach(func(ctx context.Context) {
|
ginkgo.AfterEach(func(ctx context.Context) {
|
||||||
|
@ -94,7 +94,7 @@ var _ = SIGDescribe("CronJob", func() {
|
|||||||
Testname: CronJob Suspend
|
Testname: CronJob Suspend
|
||||||
Description: CronJob MUST support suspension, which suppresses creation of new jobs.
|
Description: CronJob MUST support suspension, which suppresses creation of new jobs.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should not schedule jobs when suspended [Slow]", func(ctx context.Context) {
|
framework.ConformanceIt("should not schedule jobs when suspended", f.WithSlow(), func(ctx context.Context) {
|
||||||
ginkgo.By("Creating a suspended cronjob")
|
ginkgo.By("Creating a suspended cronjob")
|
||||||
cronJob := newTestCronJob("suspended", "*/1 * * * ?", batchv1.AllowConcurrent,
|
cronJob := newTestCronJob("suspended", "*/1 * * * ?", batchv1.AllowConcurrent,
|
||||||
sleepCommand, nil, nil)
|
sleepCommand, nil, nil)
|
||||||
@ -122,7 +122,7 @@ var _ = SIGDescribe("CronJob", func() {
|
|||||||
Testname: CronJob ForbidConcurrent
|
Testname: CronJob ForbidConcurrent
|
||||||
Description: CronJob MUST support ForbidConcurrent policy, allowing to run single, previous job at the time.
|
Description: CronJob MUST support ForbidConcurrent policy, allowing to run single, previous job at the time.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should not schedule new jobs when ForbidConcurrent [Slow]", func(ctx context.Context) {
|
framework.ConformanceIt("should not schedule new jobs when ForbidConcurrent", f.WithSlow(), func(ctx context.Context) {
|
||||||
ginkgo.By("Creating a ForbidConcurrent cronjob")
|
ginkgo.By("Creating a ForbidConcurrent cronjob")
|
||||||
cronJob := newTestCronJob("forbid", "*/1 * * * ?", batchv1.ForbidConcurrent,
|
cronJob := newTestCronJob("forbid", "*/1 * * * ?", batchv1.ForbidConcurrent,
|
||||||
sleepCommand, nil, nil)
|
sleepCommand, nil, nil)
|
||||||
|
@ -205,7 +205,7 @@ func getContainerRestarts(ctx context.Context, c clientset.Interface, ns string,
|
|||||||
return failedContainers, containerRestartNodes.List()
|
return failedContainers, containerRestartNodes.List()
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = SIGDescribe("DaemonRestart [Disruptive]", func() {
|
var _ = SIGDescribe("DaemonRestart", framework.WithDisruptive(), func() {
|
||||||
|
|
||||||
f := framework.NewDefaultFramework("daemonrestart")
|
f := framework.NewDefaultFramework("daemonrestart")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
|
@ -116,7 +116,7 @@ func updateDaemonSetWithRetries(ctx context.Context, c clientset.Interface, name
|
|||||||
// happen. In the future, running in parallel may work if we have an eviction
|
// happen. In the future, running in parallel may work if we have an eviction
|
||||||
// model which lets the DS controller kick out other pods to make room.
|
// model which lets the DS controller kick out other pods to make room.
|
||||||
// See https://issues.k8s.io/21767 for more details
|
// See https://issues.k8s.io/21767 for more details
|
||||||
var _ = SIGDescribe("Daemon set [Serial]", func() {
|
var _ = SIGDescribe("Daemon set", framework.WithSerial(), func() {
|
||||||
var f *framework.Framework
|
var f *framework.Framework
|
||||||
|
|
||||||
ginkgo.AfterEach(func(ctx context.Context) {
|
ginkgo.AfterEach(func(ctx context.Context) {
|
||||||
|
@ -283,11 +283,11 @@ var _ = SIGDescribe("DisruptionController", func() {
|
|||||||
// tests with exclusive set to true relies on HostPort to make sure
|
// tests with exclusive set to true relies on HostPort to make sure
|
||||||
// only one pod from the replicaset is assigned to each node. This
|
// only one pod from the replicaset is assigned to each node. This
|
||||||
// requires these tests to be run serially.
|
// requires these tests to be run serially.
|
||||||
var serial string
|
args := []interface{}{fmt.Sprintf("evictions: %s => %s", c.description, expectation)}
|
||||||
if c.exclusive {
|
if c.exclusive {
|
||||||
serial = " [Serial]"
|
args = append(args, framework.WithSerial())
|
||||||
}
|
}
|
||||||
ginkgo.It(fmt.Sprintf("evictions: %s => %s%s", c.description, expectation, serial), func(ctx context.Context) {
|
f.It(append(args, func(ctx context.Context) {
|
||||||
if c.skipForBigClusters {
|
if c.skipForBigClusters {
|
||||||
e2eskipper.SkipUnlessNodeCountIsAtMost(bigClusterSize - 1)
|
e2eskipper.SkipUnlessNodeCountIsAtMost(bigClusterSize - 1)
|
||||||
}
|
}
|
||||||
@ -338,7 +338,7 @@ var _ = SIGDescribe("DisruptionController", func() {
|
|||||||
})
|
})
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
}
|
}
|
||||||
})
|
})...)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -652,7 +652,7 @@ done`}
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should run a job to completion with CPU requests [Serial]", func(ctx context.Context) {
|
f.It("should run a job to completion with CPU requests", f.WithSerial(), func(ctx context.Context) {
|
||||||
ginkgo.By("Creating a job that with CPU requests")
|
ginkgo.By("Creating a job that with CPU requests")
|
||||||
|
|
||||||
testNodeName := scheduling.GetNodeThatCanRunPod(ctx, f)
|
testNodeName := scheduling.GetNodeThatCanRunPod(ctx, f)
|
||||||
|
@ -498,7 +498,7 @@ func testRSLifeCycle(ctx context.Context, f *framework.Framework) {
|
|||||||
framework.ExpectNoError(err, "Failed to create pods: %s", err)
|
framework.ExpectNoError(err, "Failed to create pods: %s", err)
|
||||||
|
|
||||||
// Scale the ReplicaSet
|
// Scale the ReplicaSet
|
||||||
ginkgo.By(fmt.Sprintf("Scaling up %q replicaset ", rsName))
|
ginkgo.By(fmt.Sprintf("Scaling up %q replicaset", rsName))
|
||||||
_, err = e2ereplicaset.UpdateReplicaSetWithRetries(c, ns, rsName, func(update *appsv1.ReplicaSet) {
|
_, err = e2ereplicaset.UpdateReplicaSetWithRetries(c, ns, rsName, func(update *appsv1.ReplicaSet) {
|
||||||
x := int32(2)
|
x := int32(2)
|
||||||
update.Spec.Replicas = &x
|
update.Spec.Replicas = &x
|
||||||
|
@ -47,6 +47,7 @@ import (
|
|||||||
"k8s.io/client-go/tools/cache"
|
"k8s.io/client-go/tools/cache"
|
||||||
watchtools "k8s.io/client-go/tools/watch"
|
watchtools "k8s.io/client-go/tools/watch"
|
||||||
"k8s.io/client-go/util/retry"
|
"k8s.io/client-go/util/retry"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl"
|
e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl"
|
||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
@ -637,7 +638,7 @@ var _ = SIGDescribe("StatefulSet", func() {
|
|||||||
Testname: StatefulSet, Scaling
|
Testname: StatefulSet, Scaling
|
||||||
Description: StatefulSet MUST create Pods in ascending order by ordinal index when scaling up, and delete Pods in descending order when scaling down. Scaling up or down MUST pause if any Pods belonging to the StatefulSet are unhealthy. This test does not depend on a preexisting default StorageClass or a dynamic provisioner.
|
Description: StatefulSet MUST create Pods in ascending order by ordinal index when scaling up, and delete Pods in descending order when scaling down. Scaling up or down MUST pause if any Pods belonging to the StatefulSet are unhealthy. This test does not depend on a preexisting default StorageClass or a dynamic provisioner.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("Scaling should happen in predictable order and halt if any stateful pod is unhealthy [Slow]", func(ctx context.Context) {
|
framework.ConformanceIt("Scaling should happen in predictable order and halt if any stateful pod is unhealthy", f.WithSlow(), func(ctx context.Context) {
|
||||||
psLabels := klabels.Set(labels)
|
psLabels := klabels.Set(labels)
|
||||||
w := &cache.ListWatch{
|
w := &cache.ListWatch{
|
||||||
WatchFunc: func(options metav1.ListOptions) (i watch.Interface, e error) {
|
WatchFunc: func(options metav1.ListOptions) (i watch.Interface, e error) {
|
||||||
@ -747,7 +748,7 @@ var _ = SIGDescribe("StatefulSet", func() {
|
|||||||
Testname: StatefulSet, Burst Scaling
|
Testname: StatefulSet, Burst Scaling
|
||||||
Description: StatefulSet MUST support the Parallel PodManagementPolicy for burst scaling. This test does not depend on a preexisting default StorageClass or a dynamic provisioner.
|
Description: StatefulSet MUST support the Parallel PodManagementPolicy for burst scaling. This test does not depend on a preexisting default StorageClass or a dynamic provisioner.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("Burst scaling should run to completion even with unhealthy pods [Slow]", func(ctx context.Context) {
|
framework.ConformanceIt("Burst scaling should run to completion even with unhealthy pods", f.WithSlow(), func(ctx context.Context) {
|
||||||
psLabels := klabels.Set(labels)
|
psLabels := klabels.Set(labels)
|
||||||
|
|
||||||
ginkgo.By("Creating stateful set " + ssName + " in namespace " + ns)
|
ginkgo.By("Creating stateful set " + ssName + " in namespace " + ns)
|
||||||
@ -1154,7 +1155,7 @@ var _ = SIGDescribe("StatefulSet", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.Describe("Deploy clustered applications [Feature:StatefulSet] [Slow]", func() {
|
f.Describe("Deploy clustered applications", feature.StatefulSet, framework.WithSlow(), func() {
|
||||||
var appTester *clusterAppTester
|
var appTester *clusterAppTester
|
||||||
|
|
||||||
ginkgo.BeforeEach(func(ctx context.Context) {
|
ginkgo.BeforeEach(func(ctx context.Context) {
|
||||||
@ -1424,7 +1425,7 @@ var _ = SIGDescribe("StatefulSet", func() {
|
|||||||
e2estatefulset.DeleteAllStatefulSets(ctx, c, ns)
|
e2estatefulset.DeleteAllStatefulSets(ctx, c, ns)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("PVC should be recreated when pod is pending due to missing PVC [Disruptive][Serial]", func(ctx context.Context) {
|
f.It("PVC should be recreated when pod is pending due to missing PVC", f.WithDisruptive(), f.WithSerial(), func(ctx context.Context) {
|
||||||
e2epv.SkipIfNoDefaultStorageClass(ctx, c)
|
e2epv.SkipIfNoDefaultStorageClass(ctx, c)
|
||||||
|
|
||||||
readyNode, err := e2enode.GetRandomReadySchedulableNode(ctx, c)
|
readyNode, err := e2enode.GetRandomReadySchedulableNode(ctx, c)
|
||||||
|
@ -25,6 +25,7 @@ import (
|
|||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/cluster/ports"
|
"k8s.io/kubernetes/pkg/cluster/ports"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
@ -35,7 +36,7 @@ import (
|
|||||||
"github.com/onsi/gomega"
|
"github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("[Feature:NodeAuthenticator]", func() {
|
var _ = SIGDescribe(feature.NodeAuthenticator, func() {
|
||||||
|
|
||||||
f := framework.NewDefaultFramework("node-authn")
|
f := framework.NewDefaultFramework("node-authn")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
||||||
|
@ -28,6 +28,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
restclient "k8s.io/client-go/rest"
|
restclient "k8s.io/client-go/rest"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
@ -41,7 +42,7 @@ const (
|
|||||||
nodeNamePrefix = "system:node:"
|
nodeNamePrefix = "system:node:"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("[Feature:NodeAuthorizer]", func() {
|
var _ = SIGDescribe(feature.NodeAuthorizer, func() {
|
||||||
|
|
||||||
f := framework.NewDefaultFramework("node-authz")
|
f := framework.NewDefaultFramework("node-authz")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
||||||
|
@ -43,6 +43,7 @@ import (
|
|||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
e2eoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
|
e2eoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
|
"k8s.io/kubernetes/test/e2e/nodefeature"
|
||||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
utilptr "k8s.io/utils/pointer"
|
utilptr "k8s.io/utils/pointer"
|
||||||
@ -334,7 +335,7 @@ var _ = SIGDescribe("ServiceAccounts", func() {
|
|||||||
Containers MUST verify that the projected service account token can be
|
Containers MUST verify that the projected service account token can be
|
||||||
read and has correct file mode set including ownership and permission.
|
read and has correct file mode set including ownership and permission.
|
||||||
*/
|
*/
|
||||||
ginkgo.It("should set ownership and permission when RunAsUser or FsGroup is present [LinuxOnly] [NodeFeature:FSGroup]", func(ctx context.Context) {
|
f.It("should set ownership and permission when RunAsUser or FsGroup is present [LinuxOnly]", nodefeature.FSGroup, func(ctx context.Context) {
|
||||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -430,7 +431,7 @@ var _ = SIGDescribe("ServiceAccounts", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should support InClusterConfig with token rotation [Slow]", func(ctx context.Context) {
|
f.It("should support InClusterConfig with token rotation", f.WithSlow(), func(ctx context.Context) {
|
||||||
tenMin := int64(10 * 60)
|
tenMin := int64(10 * 60)
|
||||||
pod := &v1.Pod{
|
pod := &v1.Pod{
|
||||||
ObjectMeta: metav1.ObjectMeta{Name: "inclusterclient"},
|
ObjectMeta: metav1.ObjectMeta{Name: "inclusterclient"},
|
||||||
|
@ -23,6 +23,7 @@ import (
|
|||||||
|
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2eautoscaling "k8s.io/kubernetes/test/e2e/framework/autoscaling"
|
e2eautoscaling "k8s.io/kubernetes/test/e2e/framework/autoscaling"
|
||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
@ -34,7 +35,7 @@ import (
|
|||||||
"github.com/onsi/gomega/gmeasure"
|
"github.com/onsi/gomega/gmeasure"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("[Feature:ClusterSizeAutoscalingScaleUp] [Slow] Autoscaling", func() {
|
var _ = SIGDescribe(feature.ClusterSizeAutoscalingScaleUp, framework.WithSlow(), "Autoscaling", func() {
|
||||||
f := framework.NewDefaultFramework("autoscaling")
|
f := framework.NewDefaultFramework("autoscaling")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
var experiment *gmeasure.Experiment
|
var experiment *gmeasure.Experiment
|
||||||
|
@ -31,6 +31,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/util/strategicpatch"
|
"k8s.io/apimachinery/pkg/util/strategicpatch"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
e2erc "k8s.io/kubernetes/test/e2e/framework/rc"
|
e2erc "k8s.io/kubernetes/test/e2e/framework/rc"
|
||||||
@ -61,7 +62,7 @@ type scaleUpTestConfig struct {
|
|||||||
expectedResult *clusterPredicates
|
expectedResult *clusterPredicates
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = SIGDescribe("Cluster size autoscaler scalability [Slow]", func() {
|
var _ = SIGDescribe("Cluster size autoscaler scalability", framework.WithSlow(), func() {
|
||||||
f := framework.NewDefaultFramework("autoscaling")
|
f := framework.NewDefaultFramework("autoscaling")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
var c clientset.Interface
|
var c clientset.Interface
|
||||||
@ -138,7 +139,7 @@ var _ = SIGDescribe("Cluster size autoscaler scalability [Slow]", func() {
|
|||||||
klog.Infof("Made nodes schedulable again in %v", time.Since(s).String())
|
klog.Infof("Made nodes schedulable again in %v", time.Since(s).String())
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should scale up at all [Feature:ClusterAutoscalerScalability1]", func(ctx context.Context) {
|
f.It("should scale up at all", feature.ClusterAutoscalerScalability1, func(ctx context.Context) {
|
||||||
perNodeReservation := int(float64(memCapacityMb) * 0.95)
|
perNodeReservation := int(float64(memCapacityMb) * 0.95)
|
||||||
replicasPerNode := 10
|
replicasPerNode := 10
|
||||||
|
|
||||||
@ -161,7 +162,7 @@ var _ = SIGDescribe("Cluster size autoscaler scalability [Slow]", func() {
|
|||||||
defer testCleanup()
|
defer testCleanup()
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should scale up twice [Feature:ClusterAutoscalerScalability2]", func(ctx context.Context) {
|
f.It("should scale up twice", feature.ClusterAutoscalerScalability2, func(ctx context.Context) {
|
||||||
perNodeReservation := int(float64(memCapacityMb) * 0.95)
|
perNodeReservation := int(float64(memCapacityMb) * 0.95)
|
||||||
replicasPerNode := 10
|
replicasPerNode := 10
|
||||||
additionalNodes1 := int(math.Ceil(0.7 * maxNodes))
|
additionalNodes1 := int(math.Ceil(0.7 * maxNodes))
|
||||||
@ -210,7 +211,7 @@ var _ = SIGDescribe("Cluster size autoscaler scalability [Slow]", func() {
|
|||||||
klog.Infof("Scaled up twice")
|
klog.Infof("Scaled up twice")
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should scale down empty nodes [Feature:ClusterAutoscalerScalability3]", func(ctx context.Context) {
|
f.It("should scale down empty nodes", feature.ClusterAutoscalerScalability3, func(ctx context.Context) {
|
||||||
perNodeReservation := int(float64(memCapacityMb) * 0.7)
|
perNodeReservation := int(float64(memCapacityMb) * 0.7)
|
||||||
replicas := int(math.Ceil(maxNodes * 0.7))
|
replicas := int(math.Ceil(maxNodes * 0.7))
|
||||||
totalNodes := maxNodes
|
totalNodes := maxNodes
|
||||||
@ -238,7 +239,7 @@ var _ = SIGDescribe("Cluster size autoscaler scalability [Slow]", func() {
|
|||||||
}, scaleDownTimeout))
|
}, scaleDownTimeout))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should scale down underutilized nodes [Feature:ClusterAutoscalerScalability4]", func(ctx context.Context) {
|
f.It("should scale down underutilized nodes", feature.ClusterAutoscalerScalability4, func(ctx context.Context) {
|
||||||
perPodReservation := int(float64(memCapacityMb) * 0.01)
|
perPodReservation := int(float64(memCapacityMb) * 0.01)
|
||||||
// underutilizedNodes are 10% full
|
// underutilizedNodes are 10% full
|
||||||
underutilizedPerNodeReplicas := 10
|
underutilizedPerNodeReplicas := 10
|
||||||
@ -296,7 +297,7 @@ var _ = SIGDescribe("Cluster size autoscaler scalability [Slow]", func() {
|
|||||||
}, timeout))
|
}, timeout))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("shouldn't scale down with underutilized nodes due to host port conflicts [Feature:ClusterAutoscalerScalability5]", func(ctx context.Context) {
|
f.It("shouldn't scale down with underutilized nodes due to host port conflicts", feature.ClusterAutoscalerScalability5, func(ctx context.Context) {
|
||||||
fullReservation := int(float64(memCapacityMb) * 0.9)
|
fullReservation := int(float64(memCapacityMb) * 0.9)
|
||||||
hostPortPodReservation := int(float64(memCapacityMb) * 0.3)
|
hostPortPodReservation := int(float64(memCapacityMb) * 0.3)
|
||||||
totalNodes := maxNodes
|
totalNodes := maxNodes
|
||||||
@ -333,7 +334,7 @@ var _ = SIGDescribe("Cluster size autoscaler scalability [Slow]", func() {
|
|||||||
gomega.Expect(nodes.Items).To(gomega.HaveLen(totalNodes))
|
gomega.Expect(nodes.Items).To(gomega.HaveLen(totalNodes))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("CA ignores unschedulable pods while scheduling schedulable pods [Feature:ClusterAutoscalerScalability6]", func(ctx context.Context) {
|
f.It("CA ignores unschedulable pods while scheduling schedulable pods", feature.ClusterAutoscalerScalability6, func(ctx context.Context) {
|
||||||
// Start a number of pods saturating existing nodes.
|
// Start a number of pods saturating existing nodes.
|
||||||
perNodeReservation := int(float64(memCapacityMb) * 0.80)
|
perNodeReservation := int(float64(memCapacityMb) * 0.80)
|
||||||
replicasPerNode := 10
|
replicasPerNode := 10
|
||||||
|
@ -43,6 +43,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl"
|
e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl"
|
||||||
e2emanifest "k8s.io/kubernetes/test/e2e/framework/manifest"
|
e2emanifest "k8s.io/kubernetes/test/e2e/framework/manifest"
|
||||||
@ -93,7 +94,7 @@ const (
|
|||||||
gpuLabel = "cloud.google.com/gke-accelerator"
|
gpuLabel = "cloud.google.com/gke-accelerator"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
var _ = SIGDescribe("Cluster size autoscaling", framework.WithSlow(), func() {
|
||||||
f := framework.NewDefaultFramework("autoscaling")
|
f := framework.NewDefaultFramework("autoscaling")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
var c clientset.Interface
|
var c clientset.Interface
|
||||||
@ -166,7 +167,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
klog.Infof("Made nodes schedulable again in %v", time.Since(s).String())
|
klog.Infof("Made nodes schedulable again in %v", time.Since(s).String())
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("shouldn't increase cluster size if pending pod is too large [Feature:ClusterSizeAutoscalingScaleUp]", func(ctx context.Context) {
|
f.It("shouldn't increase cluster size if pending pod is too large", feature.ClusterSizeAutoscalingScaleUp, func(ctx context.Context) {
|
||||||
ginkgo.By("Creating unschedulable pod")
|
ginkgo.By("Creating unschedulable pod")
|
||||||
ReserveMemory(ctx, f, "memory-reservation", 1, int(1.1*float64(memAllocatableMb)), false, defaultTimeout)
|
ReserveMemory(ctx, f, "memory-reservation", 1, int(1.1*float64(memAllocatableMb)), false, defaultTimeout)
|
||||||
ginkgo.DeferCleanup(e2erc.DeleteRCAndWaitForGC, f.ClientSet, f.Namespace.Name, "memory-reservation")
|
ginkgo.DeferCleanup(e2erc.DeleteRCAndWaitForGC, f.ClientSet, f.Namespace.Name, "memory-reservation")
|
||||||
@ -206,13 +207,13 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
framework.ExpectNoError(waitForAllCaPodsReadyInNamespace(ctx, f, c))
|
framework.ExpectNoError(waitForAllCaPodsReadyInNamespace(ctx, f, c))
|
||||||
}
|
}
|
||||||
|
|
||||||
ginkgo.It("should increase cluster size if pending pods are small [Feature:ClusterSizeAutoscalingScaleUp]", func(ctx context.Context) {
|
f.It("should increase cluster size if pending pods are small", feature.ClusterSizeAutoscalingScaleUp, func(ctx context.Context) {
|
||||||
simpleScaleUpTest(ctx, 0)
|
simpleScaleUpTest(ctx, 0)
|
||||||
})
|
})
|
||||||
|
|
||||||
gpuType := os.Getenv("TESTED_GPU_TYPE")
|
gpuType := os.Getenv("TESTED_GPU_TYPE")
|
||||||
|
|
||||||
ginkgo.It(fmt.Sprintf("Should scale up GPU pool from 0 [GpuType:%s] [Feature:ClusterSizeAutoscalingGpu]", gpuType), func(ctx context.Context) {
|
f.It(fmt.Sprintf("Should scale up GPU pool from 0 [GpuType:%s]", gpuType), feature.ClusterSizeAutoscalingGpu, func(ctx context.Context) {
|
||||||
e2eskipper.SkipUnlessProviderIs("gke")
|
e2eskipper.SkipUnlessProviderIs("gke")
|
||||||
if gpuType == "" {
|
if gpuType == "" {
|
||||||
framework.Failf("TEST_GPU_TYPE not defined")
|
framework.Failf("TEST_GPU_TYPE not defined")
|
||||||
@ -239,7 +240,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
gomega.Expect(getPoolNodes(ctx, f, gpuPoolName)).To(gomega.HaveLen(1))
|
gomega.Expect(getPoolNodes(ctx, f, gpuPoolName)).To(gomega.HaveLen(1))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It(fmt.Sprintf("Should scale up GPU pool from 1 [GpuType:%s] [Feature:ClusterSizeAutoscalingGpu]", gpuType), func(ctx context.Context) {
|
f.It(fmt.Sprintf("Should scale up GPU pool from 1 [GpuType:%s]", gpuType), feature.ClusterSizeAutoscalingGpu, func(ctx context.Context) {
|
||||||
e2eskipper.SkipUnlessProviderIs("gke")
|
e2eskipper.SkipUnlessProviderIs("gke")
|
||||||
if gpuType == "" {
|
if gpuType == "" {
|
||||||
framework.Failf("TEST_GPU_TYPE not defined")
|
framework.Failf("TEST_GPU_TYPE not defined")
|
||||||
@ -269,7 +270,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
gomega.Expect(getPoolNodes(ctx, f, gpuPoolName)).To(gomega.HaveLen(2))
|
gomega.Expect(getPoolNodes(ctx, f, gpuPoolName)).To(gomega.HaveLen(2))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It(fmt.Sprintf("Should not scale GPU pool up if pod does not require GPUs [GpuType:%s] [Feature:ClusterSizeAutoscalingGpu]", gpuType), func(ctx context.Context) {
|
f.It(fmt.Sprintf("Should not scale GPU pool up if pod does not require GPUs [GpuType:%s]", gpuType), feature.ClusterSizeAutoscalingGpu, func(ctx context.Context) {
|
||||||
e2eskipper.SkipUnlessProviderIs("gke")
|
e2eskipper.SkipUnlessProviderIs("gke")
|
||||||
if gpuType == "" {
|
if gpuType == "" {
|
||||||
framework.Failf("TEST_GPU_TYPE not defined")
|
framework.Failf("TEST_GPU_TYPE not defined")
|
||||||
@ -298,7 +299,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
gomega.Expect(getPoolNodes(ctx, f, gpuPoolName)).To(gomega.BeEmpty())
|
gomega.Expect(getPoolNodes(ctx, f, gpuPoolName)).To(gomega.BeEmpty())
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It(fmt.Sprintf("Should scale down GPU pool from 1 [GpuType:%s] [Feature:ClusterSizeAutoscalingGpu]", gpuType), func(ctx context.Context) {
|
f.It(fmt.Sprintf("Should scale down GPU pool from 1 [GpuType:%s]", gpuType), feature.ClusterSizeAutoscalingGpu, func(ctx context.Context) {
|
||||||
e2eskipper.SkipUnlessProviderIs("gke")
|
e2eskipper.SkipUnlessProviderIs("gke")
|
||||||
if gpuType == "" {
|
if gpuType == "" {
|
||||||
framework.Failf("TEST_GPU_TYPE not defined")
|
framework.Failf("TEST_GPU_TYPE not defined")
|
||||||
@ -328,11 +329,11 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
gomega.Expect(getPoolNodes(ctx, f, gpuPoolName)).To(gomega.BeEmpty())
|
gomega.Expect(getPoolNodes(ctx, f, gpuPoolName)).To(gomega.BeEmpty())
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should increase cluster size if pending pods are small and one node is broken [Feature:ClusterSizeAutoscalingScaleUp]", func(ctx context.Context) {
|
f.It("should increase cluster size if pending pods are small and one node is broken", feature.ClusterSizeAutoscalingScaleUp, func(ctx context.Context) {
|
||||||
e2enetwork.TestUnderTemporaryNetworkFailure(ctx, c, "default", getAnyNode(ctx, c), func(ctx context.Context) { simpleScaleUpTest(ctx, 1) })
|
e2enetwork.TestUnderTemporaryNetworkFailure(ctx, c, "default", getAnyNode(ctx, c), func(ctx context.Context) { simpleScaleUpTest(ctx, 1) })
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("shouldn't trigger additional scale-ups during processing scale-up [Feature:ClusterSizeAutoscalingScaleUp]", func(ctx context.Context) {
|
f.It("shouldn't trigger additional scale-ups during processing scale-up", feature.ClusterSizeAutoscalingScaleUp, func(ctx context.Context) {
|
||||||
// Wait for the situation to stabilize - CA should be running and have up-to-date node readiness info.
|
// Wait for the situation to stabilize - CA should be running and have up-to-date node readiness info.
|
||||||
status, err := waitForScaleUpStatus(ctx, c, func(s *scaleUpStatus) bool {
|
status, err := waitForScaleUpStatus(ctx, c, func(s *scaleUpStatus) bool {
|
||||||
return s.ready == s.target && s.ready <= nodeCount
|
return s.ready == s.target && s.ready <= nodeCount
|
||||||
@ -372,7 +373,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
gomega.Expect(nodes.Items).To(gomega.HaveLen(status.target + unmanagedNodes))
|
gomega.Expect(nodes.Items).To(gomega.HaveLen(status.target + unmanagedNodes))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should increase cluster size if pending pods are small and there is another node pool that is not autoscaled [Feature:ClusterSizeAutoscalingScaleUp]", func(ctx context.Context) {
|
f.It("should increase cluster size if pending pods are small and there is another node pool that is not autoscaled", feature.ClusterSizeAutoscalingScaleUp, func(ctx context.Context) {
|
||||||
e2eskipper.SkipUnlessProviderIs("gke")
|
e2eskipper.SkipUnlessProviderIs("gke")
|
||||||
|
|
||||||
ginkgo.By("Creating new node-pool with n1-standard-4 machines")
|
ginkgo.By("Creating new node-pool with n1-standard-4 machines")
|
||||||
@ -406,7 +407,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
framework.ExpectNoError(waitForAllCaPodsReadyInNamespace(ctx, f, c))
|
framework.ExpectNoError(waitForAllCaPodsReadyInNamespace(ctx, f, c))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should disable node pool autoscaling [Feature:ClusterSizeAutoscalingScaleUp]", func(ctx context.Context) {
|
f.It("should disable node pool autoscaling", feature.ClusterSizeAutoscalingScaleUp, func(ctx context.Context) {
|
||||||
e2eskipper.SkipUnlessProviderIs("gke")
|
e2eskipper.SkipUnlessProviderIs("gke")
|
||||||
|
|
||||||
ginkgo.By("Creating new node-pool with n1-standard-4 machines")
|
ginkgo.By("Creating new node-pool with n1-standard-4 machines")
|
||||||
@ -419,7 +420,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
framework.ExpectNoError(disableAutoscaler(extraPoolName, 1, 2))
|
framework.ExpectNoError(disableAutoscaler(extraPoolName, 1, 2))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should increase cluster size if pods are pending due to host port conflict [Feature:ClusterSizeAutoscalingScaleUp]", func(ctx context.Context) {
|
f.It("should increase cluster size if pods are pending due to host port conflict", feature.ClusterSizeAutoscalingScaleUp, func(ctx context.Context) {
|
||||||
scheduling.CreateHostPortPods(ctx, f, "host-port", nodeCount+2, false)
|
scheduling.CreateHostPortPods(ctx, f, "host-port", nodeCount+2, false)
|
||||||
ginkgo.DeferCleanup(e2erc.DeleteRCAndWaitForGC, f.ClientSet, f.Namespace.Name, "host-port")
|
ginkgo.DeferCleanup(e2erc.DeleteRCAndWaitForGC, f.ClientSet, f.Namespace.Name, "host-port")
|
||||||
|
|
||||||
@ -428,7 +429,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
framework.ExpectNoError(waitForAllCaPodsReadyInNamespace(ctx, f, c))
|
framework.ExpectNoError(waitForAllCaPodsReadyInNamespace(ctx, f, c))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should increase cluster size if pods are pending due to pod anti-affinity [Feature:ClusterSizeAutoscalingScaleUp]", func(ctx context.Context) {
|
f.It("should increase cluster size if pods are pending due to pod anti-affinity", feature.ClusterSizeAutoscalingScaleUp, func(ctx context.Context) {
|
||||||
pods := nodeCount
|
pods := nodeCount
|
||||||
newPods := 2
|
newPods := 2
|
||||||
labels := map[string]string{
|
labels := map[string]string{
|
||||||
@ -447,7 +448,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
framework.ExpectNoError(e2enode.WaitForReadyNodes(ctx, c, nodeCount+newPods, scaleUpTimeout))
|
framework.ExpectNoError(e2enode.WaitForReadyNodes(ctx, c, nodeCount+newPods, scaleUpTimeout))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should increase cluster size if pod requesting EmptyDir volume is pending [Feature:ClusterSizeAutoscalingScaleUp]", func(ctx context.Context) {
|
f.It("should increase cluster size if pod requesting EmptyDir volume is pending", feature.ClusterSizeAutoscalingScaleUp, func(ctx context.Context) {
|
||||||
ginkgo.By("creating pods")
|
ginkgo.By("creating pods")
|
||||||
pods := nodeCount
|
pods := nodeCount
|
||||||
newPods := 1
|
newPods := 1
|
||||||
@ -468,7 +469,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
framework.ExpectNoError(e2enode.WaitForReadyNodes(ctx, c, nodeCount+newPods, scaleUpTimeout))
|
framework.ExpectNoError(e2enode.WaitForReadyNodes(ctx, c, nodeCount+newPods, scaleUpTimeout))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should increase cluster size if pod requesting volume is pending [Feature:ClusterSizeAutoscalingScaleUp]", func(ctx context.Context) {
|
f.It("should increase cluster size if pod requesting volume is pending", feature.ClusterSizeAutoscalingScaleUp, func(ctx context.Context) {
|
||||||
e2eskipper.SkipUnlessProviderIs("gce", "gke")
|
e2eskipper.SkipUnlessProviderIs("gce", "gke")
|
||||||
|
|
||||||
volumeLabels := labels.Set{
|
volumeLabels := labels.Set{
|
||||||
@ -538,7 +539,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
framework.ExpectNoError(e2enode.WaitForReadyNodes(ctx, c, nodeCount+newPods, scaleUpTimeout))
|
framework.ExpectNoError(e2enode.WaitForReadyNodes(ctx, c, nodeCount+newPods, scaleUpTimeout))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should add node to the particular mig [Feature:ClusterSizeAutoscalingScaleUp]", func(ctx context.Context) {
|
f.It("should add node to the particular mig", feature.ClusterSizeAutoscalingScaleUp, func(ctx context.Context) {
|
||||||
labelKey := "cluster-autoscaling-test.special-node"
|
labelKey := "cluster-autoscaling-test.special-node"
|
||||||
labelValue := "true"
|
labelValue := "true"
|
||||||
|
|
||||||
@ -638,7 +639,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
framework.ExpectNoError(e2erc.DeleteRCAndWaitForGC(ctx, f.ClientSet, f.Namespace.Name, "node-selector"))
|
framework.ExpectNoError(e2erc.DeleteRCAndWaitForGC(ctx, f.ClientSet, f.Namespace.Name, "node-selector"))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should scale up correct target pool [Feature:ClusterSizeAutoscalingScaleUp]", func(ctx context.Context) {
|
f.It("should scale up correct target pool", feature.ClusterSizeAutoscalingScaleUp, func(ctx context.Context) {
|
||||||
e2eskipper.SkipUnlessProviderIs("gke")
|
e2eskipper.SkipUnlessProviderIs("gke")
|
||||||
|
|
||||||
ginkgo.By("Creating new node-pool with n1-standard-4 machines")
|
ginkgo.By("Creating new node-pool with n1-standard-4 machines")
|
||||||
@ -683,15 +684,15 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
func(size int) bool { return size < increasedSize }, scaleDownTimeout, unready))
|
func(size int) bool { return size < increasedSize }, scaleDownTimeout, unready))
|
||||||
}
|
}
|
||||||
|
|
||||||
ginkgo.It("should correctly scale down after a node is not needed [Feature:ClusterSizeAutoscalingScaleDown]",
|
f.It("should correctly scale down after a node is not needed", feature.ClusterSizeAutoscalingScaleDown,
|
||||||
func(ctx context.Context) { simpleScaleDownTest(ctx, 0) })
|
func(ctx context.Context) { simpleScaleDownTest(ctx, 0) })
|
||||||
|
|
||||||
ginkgo.It("should correctly scale down after a node is not needed and one node is broken [Feature:ClusterSizeAutoscalingScaleDown]", func(ctx context.Context) {
|
f.It("should correctly scale down after a node is not needed and one node is broken", feature.ClusterSizeAutoscalingScaleDown, func(ctx context.Context) {
|
||||||
e2eskipper.SkipUnlessSSHKeyPresent()
|
e2eskipper.SkipUnlessSSHKeyPresent()
|
||||||
e2enetwork.TestUnderTemporaryNetworkFailure(ctx, c, "default", getAnyNode(ctx, c), func(ctx context.Context) { simpleScaleDownTest(ctx, 1) })
|
e2enetwork.TestUnderTemporaryNetworkFailure(ctx, c, "default", getAnyNode(ctx, c), func(ctx context.Context) { simpleScaleDownTest(ctx, 1) })
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should correctly scale down after a node is not needed when there is non autoscaled pool[Feature:ClusterSizeAutoscalingScaleDown]", func(ctx context.Context) {
|
f.It("should correctly scale down after a node is not needed when there is non autoscaled pool", feature.ClusterSizeAutoscalingScaleDown, func(ctx context.Context) {
|
||||||
e2eskipper.SkipUnlessProviderIs("gke")
|
e2eskipper.SkipUnlessProviderIs("gke")
|
||||||
|
|
||||||
increasedSize := manuallyIncreaseClusterSize(ctx, f, originalSizes)
|
increasedSize := manuallyIncreaseClusterSize(ctx, f, originalSizes)
|
||||||
@ -713,7 +714,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
func(size int) bool { return size < increasedSize+extraNodes }, scaleDownTimeout+10*time.Minute))
|
func(size int) bool { return size < increasedSize+extraNodes }, scaleDownTimeout+10*time.Minute))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should be able to scale down when rescheduling a pod is required and pdb allows for it[Feature:ClusterSizeAutoscalingScaleDown]", func(ctx context.Context) {
|
f.It("should be able to scale down when rescheduling a pod is required and pdb allows for it", feature.ClusterSizeAutoscalingScaleDown, func(ctx context.Context) {
|
||||||
runDrainTest(ctx, f, originalSizes, f.Namespace.Name, 1, 1, func(increasedSize int) {
|
runDrainTest(ctx, f, originalSizes, f.Namespace.Name, 1, 1, func(increasedSize int) {
|
||||||
ginkgo.By("Some node should be removed")
|
ginkgo.By("Some node should be removed")
|
||||||
framework.ExpectNoError(WaitForClusterSizeFunc(ctx, f.ClientSet,
|
framework.ExpectNoError(WaitForClusterSizeFunc(ctx, f.ClientSet,
|
||||||
@ -721,7 +722,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("shouldn't be able to scale down when rescheduling a pod is required, but pdb doesn't allow drain[Feature:ClusterSizeAutoscalingScaleDown]", func(ctx context.Context) {
|
f.It("shouldn't be able to scale down when rescheduling a pod is required, but pdb doesn't allow drain", feature.ClusterSizeAutoscalingScaleDown, func(ctx context.Context) {
|
||||||
runDrainTest(ctx, f, originalSizes, f.Namespace.Name, 1, 0, func(increasedSize int) {
|
runDrainTest(ctx, f, originalSizes, f.Namespace.Name, 1, 0, func(increasedSize int) {
|
||||||
ginkgo.By("No nodes should be removed")
|
ginkgo.By("No nodes should be removed")
|
||||||
time.Sleep(scaleDownTimeout)
|
time.Sleep(scaleDownTimeout)
|
||||||
@ -731,7 +732,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should be able to scale down by draining multiple pods one by one as dictated by pdb[Feature:ClusterSizeAutoscalingScaleDown]", func(ctx context.Context) {
|
f.It("should be able to scale down by draining multiple pods one by one as dictated by pdb", feature.ClusterSizeAutoscalingScaleDown, func(ctx context.Context) {
|
||||||
runDrainTest(ctx, f, originalSizes, f.Namespace.Name, 2, 1, func(increasedSize int) {
|
runDrainTest(ctx, f, originalSizes, f.Namespace.Name, 2, 1, func(increasedSize int) {
|
||||||
ginkgo.By("Some node should be removed")
|
ginkgo.By("Some node should be removed")
|
||||||
framework.ExpectNoError(WaitForClusterSizeFunc(ctx, f.ClientSet,
|
framework.ExpectNoError(WaitForClusterSizeFunc(ctx, f.ClientSet,
|
||||||
@ -739,7 +740,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should be able to scale down by draining system pods with pdb[Feature:ClusterSizeAutoscalingScaleDown]", func(ctx context.Context) {
|
f.It("should be able to scale down by draining system pods with pdb", feature.ClusterSizeAutoscalingScaleDown, func(ctx context.Context) {
|
||||||
runDrainTest(ctx, f, originalSizes, "kube-system", 2, 1, func(increasedSize int) {
|
runDrainTest(ctx, f, originalSizes, "kube-system", 2, 1, func(increasedSize int) {
|
||||||
ginkgo.By("Some node should be removed")
|
ginkgo.By("Some node should be removed")
|
||||||
framework.ExpectNoError(WaitForClusterSizeFunc(ctx, f.ClientSet,
|
framework.ExpectNoError(WaitForClusterSizeFunc(ctx, f.ClientSet,
|
||||||
@ -747,7 +748,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("Should be able to scale a node group up from 0[Feature:ClusterSizeAutoscalingScaleUp]", func(ctx context.Context) {
|
f.It("Should be able to scale a node group up from 0", feature.ClusterSizeAutoscalingScaleUp, func(ctx context.Context) {
|
||||||
// Provider-specific setup
|
// Provider-specific setup
|
||||||
if framework.ProviderIs("gke") {
|
if framework.ProviderIs("gke") {
|
||||||
// GKE-specific setup
|
// GKE-specific setup
|
||||||
@ -870,7 +871,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
gomega.Expect(newSize).To(gomega.BeEmpty())
|
gomega.Expect(newSize).To(gomega.BeEmpty())
|
||||||
}
|
}
|
||||||
|
|
||||||
ginkgo.It("Should be able to scale a node group down to 0[Feature:ClusterSizeAutoscalingScaleDown]", func(ctx context.Context) {
|
f.It("Should be able to scale a node group down to 0", feature.ClusterSizeAutoscalingScaleDown, func(ctx context.Context) {
|
||||||
if framework.ProviderIs("gke") { // In GKE, we can just add a node pool
|
if framework.ProviderIs("gke") { // In GKE, we can just add a node pool
|
||||||
gkeScaleToZero(ctx)
|
gkeScaleToZero(ctx)
|
||||||
} else if len(originalSizes) >= 2 {
|
} else if len(originalSizes) >= 2 {
|
||||||
@ -880,7 +881,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("Shouldn't perform scale up operation and should list unhealthy status if most of the cluster is broken[Feature:ClusterSizeAutoscalingScaleUp]", func(ctx context.Context) {
|
f.It("Shouldn't perform scale up operation and should list unhealthy status if most of the cluster is broken", feature.ClusterSizeAutoscalingScaleUp, func(ctx context.Context) {
|
||||||
e2eskipper.SkipUnlessSSHKeyPresent()
|
e2eskipper.SkipUnlessSSHKeyPresent()
|
||||||
|
|
||||||
clusterSize := nodeCount
|
clusterSize := nodeCount
|
||||||
@ -944,7 +945,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
framework.ExpectNoError(e2enode.WaitForReadyNodes(ctx, c, len(nodes.Items), nodesRecoverTimeout))
|
framework.ExpectNoError(e2enode.WaitForReadyNodes(ctx, c, len(nodes.Items), nodesRecoverTimeout))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("shouldn't scale up when expendable pod is created [Feature:ClusterSizeAutoscalingScaleUp]", func(ctx context.Context) {
|
f.It("shouldn't scale up when expendable pod is created", feature.ClusterSizeAutoscalingScaleUp, func(ctx context.Context) {
|
||||||
createPriorityClasses(ctx, f)
|
createPriorityClasses(ctx, f)
|
||||||
// Create nodesCountAfterResize+1 pods allocating 0.7 allocatable on present nodes. One more node will have to be created.
|
// Create nodesCountAfterResize+1 pods allocating 0.7 allocatable on present nodes. One more node will have to be created.
|
||||||
ginkgo.DeferCleanup(ReserveMemoryWithPriority, f, "memory-reservation", nodeCount+1, int(float64(nodeCount+1)*float64(0.7)*float64(memAllocatableMb)), false, time.Second, expendablePriorityClassName)
|
ginkgo.DeferCleanup(ReserveMemoryWithPriority, f, "memory-reservation", nodeCount+1, int(float64(nodeCount+1)*float64(0.7)*float64(memAllocatableMb)), false, time.Second, expendablePriorityClassName)
|
||||||
@ -955,7 +956,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
func(size int) bool { return size == nodeCount }, time.Second))
|
func(size int) bool { return size == nodeCount }, time.Second))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should scale up when non expendable pod is created [Feature:ClusterSizeAutoscalingScaleUp]", func(ctx context.Context) {
|
f.It("should scale up when non expendable pod is created", feature.ClusterSizeAutoscalingScaleUp, func(ctx context.Context) {
|
||||||
createPriorityClasses(ctx, f)
|
createPriorityClasses(ctx, f)
|
||||||
// Create nodesCountAfterResize+1 pods allocating 0.7 allocatable on present nodes. One more node will have to be created.
|
// Create nodesCountAfterResize+1 pods allocating 0.7 allocatable on present nodes. One more node will have to be created.
|
||||||
cleanupFunc := ReserveMemoryWithPriority(ctx, f, "memory-reservation", nodeCount+1, int(float64(nodeCount+1)*float64(0.7)*float64(memAllocatableMb)), true, scaleUpTimeout, highPriorityClassName)
|
cleanupFunc := ReserveMemoryWithPriority(ctx, f, "memory-reservation", nodeCount+1, int(float64(nodeCount+1)*float64(0.7)*float64(memAllocatableMb)), true, scaleUpTimeout, highPriorityClassName)
|
||||||
@ -965,7 +966,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
func(size int) bool { return size > nodeCount }, time.Second))
|
func(size int) bool { return size > nodeCount }, time.Second))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("shouldn't scale up when expendable pod is preempted [Feature:ClusterSizeAutoscalingScaleUp]", func(ctx context.Context) {
|
f.It("shouldn't scale up when expendable pod is preempted", feature.ClusterSizeAutoscalingScaleUp, func(ctx context.Context) {
|
||||||
createPriorityClasses(ctx, f)
|
createPriorityClasses(ctx, f)
|
||||||
// Create nodesCountAfterResize pods allocating 0.7 allocatable on present nodes - one pod per node.
|
// Create nodesCountAfterResize pods allocating 0.7 allocatable on present nodes - one pod per node.
|
||||||
cleanupFunc1 := ReserveMemoryWithPriority(ctx, f, "memory-reservation1", nodeCount, int(float64(nodeCount)*float64(0.7)*float64(memAllocatableMb)), true, defaultTimeout, expendablePriorityClassName)
|
cleanupFunc1 := ReserveMemoryWithPriority(ctx, f, "memory-reservation1", nodeCount, int(float64(nodeCount)*float64(0.7)*float64(memAllocatableMb)), true, defaultTimeout, expendablePriorityClassName)
|
||||||
@ -977,7 +978,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
func(size int) bool { return size == nodeCount }, time.Second))
|
func(size int) bool { return size == nodeCount }, time.Second))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should scale down when expendable pod is running [Feature:ClusterSizeAutoscalingScaleDown]", func(ctx context.Context) {
|
f.It("should scale down when expendable pod is running", feature.ClusterSizeAutoscalingScaleDown, func(ctx context.Context) {
|
||||||
createPriorityClasses(ctx, f)
|
createPriorityClasses(ctx, f)
|
||||||
increasedSize := manuallyIncreaseClusterSize(ctx, f, originalSizes)
|
increasedSize := manuallyIncreaseClusterSize(ctx, f, originalSizes)
|
||||||
// Create increasedSize pods allocating 0.7 allocatable on present nodes - one pod per node.
|
// Create increasedSize pods allocating 0.7 allocatable on present nodes - one pod per node.
|
||||||
@ -988,7 +989,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
func(size int) bool { return size == nodeCount }, scaleDownTimeout))
|
func(size int) bool { return size == nodeCount }, scaleDownTimeout))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("shouldn't scale down when non expendable pod is running [Feature:ClusterSizeAutoscalingScaleDown]", func(ctx context.Context) {
|
f.It("shouldn't scale down when non expendable pod is running", feature.ClusterSizeAutoscalingScaleDown, func(ctx context.Context) {
|
||||||
createPriorityClasses(ctx, f)
|
createPriorityClasses(ctx, f)
|
||||||
increasedSize := manuallyIncreaseClusterSize(ctx, f, originalSizes)
|
increasedSize := manuallyIncreaseClusterSize(ctx, f, originalSizes)
|
||||||
// Create increasedSize pods allocating 0.7 allocatable on present nodes - one pod per node.
|
// Create increasedSize pods allocating 0.7 allocatable on present nodes - one pod per node.
|
||||||
|
@ -31,6 +31,7 @@ import (
|
|||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2edeployment "k8s.io/kubernetes/test/e2e/framework/deployment"
|
e2edeployment "k8s.io/kubernetes/test/e2e/framework/deployment"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
@ -53,7 +54,7 @@ type externalMetricTarget struct {
|
|||||||
isAverage bool
|
isAverage bool
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = SIGDescribe("[HPA] [Feature:CustomMetricsAutoscaling] Horizontal pod autoscaling (scale resource: Custom Metrics from Stackdriver)", func() {
|
var _ = SIGDescribe("[HPA]", feature.CustomMetricsAutoscaling, "Horizontal pod autoscaling (scale resource: Custom Metrics from Stackdriver)", func() {
|
||||||
ginkgo.BeforeEach(func() {
|
ginkgo.BeforeEach(func() {
|
||||||
e2eskipper.SkipUnlessProviderIs("gce", "gke")
|
e2eskipper.SkipUnlessProviderIs("gce", "gke")
|
||||||
})
|
})
|
||||||
|
@ -104,7 +104,7 @@ var _ = SIGDescribe("DNS horizontal autoscaling", func() {
|
|||||||
|
|
||||||
// This test is separated because it is slow and need to run serially.
|
// This test is separated because it is slow and need to run serially.
|
||||||
// Will take around 5 minutes to run on a 4 nodes cluster.
|
// Will take around 5 minutes to run on a 4 nodes cluster.
|
||||||
ginkgo.It("[Serial] [Slow] kube-dns-autoscaler should scale kube-dns pods when cluster size changed", func(ctx context.Context) {
|
f.It(f.WithSerial(), f.WithSlow(), "kube-dns-autoscaler should scale kube-dns pods when cluster size changed", func(ctx context.Context) {
|
||||||
numNodes, err := e2enode.TotalRegistered(ctx, c)
|
numNodes, err := e2enode.TotalRegistered(ctx, c)
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ import (
|
|||||||
autoscalingv2 "k8s.io/api/autoscaling/v2"
|
autoscalingv2 "k8s.io/api/autoscaling/v2"
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2eautoscaling "k8s.io/kubernetes/test/e2e/framework/autoscaling"
|
e2eautoscaling "k8s.io/kubernetes/test/e2e/framework/autoscaling"
|
||||||
)
|
)
|
||||||
@ -42,11 +43,11 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// These tests don't seem to be running properly in parallel: issue: #20338.
|
// These tests don't seem to be running properly in parallel: issue: #20338.
|
||||||
var _ = SIGDescribe("[Feature:HPA] Horizontal pod autoscaling (scale resource: CPU)", func() {
|
var _ = SIGDescribe(feature.HPA, "Horizontal pod autoscaling (scale resource: CPU)", func() {
|
||||||
f := framework.NewDefaultFramework("horizontal-pod-autoscaling")
|
f := framework.NewDefaultFramework("horizontal-pod-autoscaling")
|
||||||
f.NamespacePodSecurityLevel = api.LevelBaseline
|
f.NamespacePodSecurityLevel = api.LevelBaseline
|
||||||
|
|
||||||
ginkgo.Describe("[Serial] [Slow] Deployment (Pod Resource)", func() {
|
f.Describe(framework.WithSerial(), framework.WithSlow(), "Deployment (Pod Resource)", func() {
|
||||||
ginkgo.It(titleUp+titleAverageUtilization, func(ctx context.Context) {
|
ginkgo.It(titleUp+titleAverageUtilization, func(ctx context.Context) {
|
||||||
scaleUp(ctx, "test-deployment", e2eautoscaling.KindDeployment, cpuResource, utilizationMetricType, false, f)
|
scaleUp(ctx, "test-deployment", e2eautoscaling.KindDeployment, cpuResource, utilizationMetricType, false, f)
|
||||||
})
|
})
|
||||||
@ -58,7 +59,7 @@ var _ = SIGDescribe("[Feature:HPA] Horizontal pod autoscaling (scale resource: C
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.Describe("[Serial] [Slow] Deployment (Container Resource)", func() {
|
f.Describe(framework.WithSerial(), framework.WithSlow(), "Deployment (Container Resource)", func() {
|
||||||
ginkgo.It(titleUp+titleAverageUtilization, func(ctx context.Context) {
|
ginkgo.It(titleUp+titleAverageUtilization, func(ctx context.Context) {
|
||||||
scaleUpContainerResource(ctx, "test-deployment", e2eautoscaling.KindDeployment, cpuResource, utilizationMetricType, f)
|
scaleUpContainerResource(ctx, "test-deployment", e2eautoscaling.KindDeployment, cpuResource, utilizationMetricType, f)
|
||||||
})
|
})
|
||||||
@ -67,7 +68,7 @@ var _ = SIGDescribe("[Feature:HPA] Horizontal pod autoscaling (scale resource: C
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.Describe("[Serial] [Slow] ReplicaSet", func() {
|
f.Describe(framework.WithSerial(), framework.WithSlow(), "ReplicaSet", func() {
|
||||||
ginkgo.It(titleUp, func(ctx context.Context) {
|
ginkgo.It(titleUp, func(ctx context.Context) {
|
||||||
scaleUp(ctx, "rs", e2eautoscaling.KindReplicaSet, cpuResource, utilizationMetricType, false, f)
|
scaleUp(ctx, "rs", e2eautoscaling.KindReplicaSet, cpuResource, utilizationMetricType, false, f)
|
||||||
})
|
})
|
||||||
@ -77,7 +78,7 @@ var _ = SIGDescribe("[Feature:HPA] Horizontal pod autoscaling (scale resource: C
|
|||||||
})
|
})
|
||||||
|
|
||||||
// These tests take ~20 minutes each.
|
// These tests take ~20 minutes each.
|
||||||
ginkgo.Describe("[Serial] [Slow] ReplicationController", func() {
|
f.Describe(framework.WithSerial(), framework.WithSlow(), "ReplicationController", func() {
|
||||||
ginkgo.It(titleUp+" and verify decision stability", func(ctx context.Context) {
|
ginkgo.It(titleUp+" and verify decision stability", func(ctx context.Context) {
|
||||||
scaleUp(ctx, "rc", e2eautoscaling.KindRC, cpuResource, utilizationMetricType, true, f)
|
scaleUp(ctx, "rc", e2eautoscaling.KindRC, cpuResource, utilizationMetricType, true, f)
|
||||||
})
|
})
|
||||||
@ -86,7 +87,7 @@ var _ = SIGDescribe("[Feature:HPA] Horizontal pod autoscaling (scale resource: C
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.Describe("ReplicationController light", func() {
|
f.Describe("ReplicationController light", func() {
|
||||||
ginkgo.It("Should scale from 1 pod to 2 pods", func(ctx context.Context) {
|
ginkgo.It("Should scale from 1 pod to 2 pods", func(ctx context.Context) {
|
||||||
st := &HPAScaleTest{
|
st := &HPAScaleTest{
|
||||||
initPods: 1,
|
initPods: 1,
|
||||||
@ -101,7 +102,7 @@ var _ = SIGDescribe("[Feature:HPA] Horizontal pod autoscaling (scale resource: C
|
|||||||
}
|
}
|
||||||
st.run(ctx, "rc-light", e2eautoscaling.KindRC, f)
|
st.run(ctx, "rc-light", e2eautoscaling.KindRC, f)
|
||||||
})
|
})
|
||||||
ginkgo.It("[Slow] Should scale from 2 pods to 1 pod", func(ctx context.Context) {
|
f.It(f.WithSlow(), "Should scale from 2 pods to 1 pod", func(ctx context.Context) {
|
||||||
st := &HPAScaleTest{
|
st := &HPAScaleTest{
|
||||||
initPods: 2,
|
initPods: 2,
|
||||||
initCPUTotal: 50,
|
initCPUTotal: 50,
|
||||||
@ -117,7 +118,7 @@ var _ = SIGDescribe("[Feature:HPA] Horizontal pod autoscaling (scale resource: C
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.Describe("[Serial] [Slow] ReplicaSet with idle sidecar (ContainerResource use case)", func() {
|
f.Describe(framework.WithSerial(), framework.WithSlow(), "ReplicaSet with idle sidecar (ContainerResource use case)", func() {
|
||||||
// ContainerResource CPU autoscaling on idle sidecar
|
// ContainerResource CPU autoscaling on idle sidecar
|
||||||
ginkgo.It(titleUp+" on a busy application with an idle sidecar container", func(ctx context.Context) {
|
ginkgo.It(titleUp+" on a busy application with an idle sidecar container", func(ctx context.Context) {
|
||||||
scaleOnIdleSideCar(ctx, "rs", e2eautoscaling.KindReplicaSet, cpuResource, utilizationMetricType, false, f)
|
scaleOnIdleSideCar(ctx, "rs", e2eautoscaling.KindReplicaSet, cpuResource, utilizationMetricType, false, f)
|
||||||
@ -129,7 +130,7 @@ var _ = SIGDescribe("[Feature:HPA] Horizontal pod autoscaling (scale resource: C
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.Describe("CustomResourceDefinition", func() {
|
f.Describe("CustomResourceDefinition", func() {
|
||||||
ginkgo.It("Should scale with a CRD targetRef", func(ctx context.Context) {
|
ginkgo.It("Should scale with a CRD targetRef", func(ctx context.Context) {
|
||||||
scaleTest := &HPAScaleTest{
|
scaleTest := &HPAScaleTest{
|
||||||
initPods: 1,
|
initPods: 1,
|
||||||
@ -147,11 +148,11 @@ var _ = SIGDescribe("[Feature:HPA] Horizontal pod autoscaling (scale resource: C
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
var _ = SIGDescribe("[Feature:HPA] Horizontal pod autoscaling (scale resource: Memory)", func() {
|
var _ = SIGDescribe(feature.HPA, "Horizontal pod autoscaling (scale resource: Memory)", func() {
|
||||||
f := framework.NewDefaultFramework("horizontal-pod-autoscaling")
|
f := framework.NewDefaultFramework("horizontal-pod-autoscaling")
|
||||||
f.NamespacePodSecurityLevel = api.LevelBaseline
|
f.NamespacePodSecurityLevel = api.LevelBaseline
|
||||||
|
|
||||||
ginkgo.Describe("[Serial] [Slow] Deployment (Pod Resource)", func() {
|
f.Describe(framework.WithSerial(), framework.WithSlow(), "Deployment (Pod Resource)", func() {
|
||||||
ginkgo.It(titleUp+titleAverageUtilization, func(ctx context.Context) {
|
ginkgo.It(titleUp+titleAverageUtilization, func(ctx context.Context) {
|
||||||
scaleUp(ctx, "test-deployment", e2eautoscaling.KindDeployment, memResource, utilizationMetricType, false, f)
|
scaleUp(ctx, "test-deployment", e2eautoscaling.KindDeployment, memResource, utilizationMetricType, false, f)
|
||||||
})
|
})
|
||||||
@ -160,7 +161,7 @@ var _ = SIGDescribe("[Feature:HPA] Horizontal pod autoscaling (scale resource: M
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.Describe("[Serial] [Slow] Deployment (Container Resource)", func() {
|
f.Describe(framework.WithSerial(), framework.WithSlow(), "Deployment (Container Resource)", func() {
|
||||||
ginkgo.It(titleUp+titleAverageUtilization, func(ctx context.Context) {
|
ginkgo.It(titleUp+titleAverageUtilization, func(ctx context.Context) {
|
||||||
scaleUpContainerResource(ctx, "test-deployment", e2eautoscaling.KindDeployment, memResource, utilizationMetricType, f)
|
scaleUpContainerResource(ctx, "test-deployment", e2eautoscaling.KindDeployment, memResource, utilizationMetricType, f)
|
||||||
})
|
})
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
autoscalingv2 "k8s.io/api/autoscaling/v2"
|
autoscalingv2 "k8s.io/api/autoscaling/v2"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2eautoscaling "k8s.io/kubernetes/test/e2e/framework/autoscaling"
|
e2eautoscaling "k8s.io/kubernetes/test/e2e/framework/autoscaling"
|
||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
@ -29,7 +30,7 @@ import (
|
|||||||
"github.com/onsi/gomega"
|
"github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("[Feature:HPA] [Serial] [Slow] Horizontal pod autoscaling (non-default behavior)", func() {
|
var _ = SIGDescribe(feature.HPA, framework.WithSerial(), framework.WithSlow(), "Horizontal pod autoscaling (non-default behavior)", func() {
|
||||||
f := framework.NewDefaultFramework("horizontal-pod-autoscaling")
|
f := framework.NewDefaultFramework("horizontal-pod-autoscaling")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"k8s.io/kubernetes/test/e2e/cloud/gcp/common"
|
"k8s.io/kubernetes/test/e2e/cloud/gcp/common"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2epv "k8s.io/kubernetes/test/e2e/framework/pv"
|
e2epv "k8s.io/kubernetes/test/e2e/framework/pv"
|
||||||
"k8s.io/kubernetes/test/e2e/upgrades"
|
"k8s.io/kubernetes/test/e2e/upgrades"
|
||||||
@ -36,7 +37,7 @@ var upgradeTests = []upgrades.Test{
|
|||||||
&apps.CassandraUpgradeTest{},
|
&apps.CassandraUpgradeTest{},
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = SIGDescribe("stateful Upgrade [Feature:StatefulUpgrade]", func() {
|
var _ = SIGDescribe("stateful Upgrade", feature.StatefulUpgrade, func() {
|
||||||
f := framework.NewDefaultFramework("stateful-upgrade")
|
f := framework.NewDefaultFramework("stateful-upgrade")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
testFrameworks := upgrades.CreateUpgradeFrameworks(upgradeTests)
|
testFrameworks := upgrades.CreateUpgradeFrameworks(upgradeTests)
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"k8s.io/kubernetes/test/e2e/cloud/gcp/common"
|
"k8s.io/kubernetes/test/e2e/cloud/gcp/common"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
"k8s.io/kubernetes/test/e2e/upgrades"
|
"k8s.io/kubernetes/test/e2e/upgrades"
|
||||||
"k8s.io/kubernetes/test/e2e/upgrades/auth"
|
"k8s.io/kubernetes/test/e2e/upgrades/auth"
|
||||||
@ -33,7 +34,7 @@ var upgradeTests = []upgrades.Test{
|
|||||||
&auth.ServiceAccountAdmissionControllerMigrationTest{},
|
&auth.ServiceAccountAdmissionControllerMigrationTest{},
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = SIGDescribe("ServiceAccount admission controller migration [Feature:BoundServiceAccountTokenVolume]", func() {
|
var _ = SIGDescribe("ServiceAccount admission controller migration", feature.BoundServiceAccountTokenVolume, func() {
|
||||||
f := framework.NewDefaultFramework("serviceaccount-admission-controller-migration")
|
f := framework.NewDefaultFramework("serviceaccount-admission-controller-migration")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
testFrameworks := upgrades.CreateUpgradeFrameworks(upgradeTests)
|
testFrameworks := upgrades.CreateUpgradeFrameworks(upgradeTests)
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"k8s.io/kubernetes/test/e2e/cloud/gcp/common"
|
"k8s.io/kubernetes/test/e2e/cloud/gcp/common"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
"k8s.io/kubernetes/test/e2e/upgrades"
|
"k8s.io/kubernetes/test/e2e/upgrades"
|
||||||
"k8s.io/kubernetes/test/e2e/upgrades/apps"
|
"k8s.io/kubernetes/test/e2e/upgrades/apps"
|
||||||
@ -52,7 +53,7 @@ var upgradeTests = []upgrades.Test{
|
|||||||
&storage.VolumeModeDowngradeTest{},
|
&storage.VolumeModeDowngradeTest{},
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = SIGDescribe("Upgrade [Feature:Upgrade]", func() {
|
var _ = SIGDescribe("Upgrade", feature.Upgrade, func() {
|
||||||
f := framework.NewDefaultFramework("cluster-upgrade")
|
f := framework.NewDefaultFramework("cluster-upgrade")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
testFrameworks := upgrades.CreateUpgradeFrameworks(upgradeTests)
|
testFrameworks := upgrades.CreateUpgradeFrameworks(upgradeTests)
|
||||||
@ -60,7 +61,7 @@ var _ = SIGDescribe("Upgrade [Feature:Upgrade]", func() {
|
|||||||
// Create the frameworks here because we can only create them
|
// Create the frameworks here because we can only create them
|
||||||
// in a "Describe".
|
// in a "Describe".
|
||||||
ginkgo.Describe("master upgrade", func() {
|
ginkgo.Describe("master upgrade", func() {
|
||||||
ginkgo.It("should maintain a functioning cluster [Feature:MasterUpgrade]", func(ctx context.Context) {
|
f.It("should maintain a functioning cluster", feature.MasterUpgrade, func(ctx context.Context) {
|
||||||
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
@ -77,7 +78,7 @@ var _ = SIGDescribe("Upgrade [Feature:Upgrade]", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.Describe("cluster upgrade", func() {
|
ginkgo.Describe("cluster upgrade", func() {
|
||||||
ginkgo.It("should maintain a functioning cluster [Feature:ClusterUpgrade]", func(ctx context.Context) {
|
f.It("should maintain a functioning cluster", feature.ClusterUpgrade, func(ctx context.Context) {
|
||||||
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
@ -91,13 +92,13 @@ var _ = SIGDescribe("Upgrade [Feature:Upgrade]", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
var _ = SIGDescribe("Downgrade [Feature:Downgrade]", func() {
|
var _ = SIGDescribe("Downgrade", feature.Downgrade, func() {
|
||||||
f := framework.NewDefaultFramework("cluster-downgrade")
|
f := framework.NewDefaultFramework("cluster-downgrade")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
testFrameworks := upgrades.CreateUpgradeFrameworks(upgradeTests)
|
testFrameworks := upgrades.CreateUpgradeFrameworks(upgradeTests)
|
||||||
|
|
||||||
ginkgo.Describe("cluster downgrade", func() {
|
ginkgo.Describe("cluster downgrade", func() {
|
||||||
ginkgo.It("should maintain a functioning cluster [Feature:ClusterDowngrade]", func(ctx context.Context) {
|
f.It("should maintain a functioning cluster", feature.ClusterDowngrade, func(ctx context.Context) {
|
||||||
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
@ -29,7 +30,7 @@ import (
|
|||||||
"github.com/onsi/ginkgo/v2"
|
"github.com/onsi/ginkgo/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("GKE node pools [Feature:GKENodePool]", func() {
|
var _ = SIGDescribe("GKE node pools", feature.GKENodePool, func() {
|
||||||
|
|
||||||
f := framework.NewDefaultFramework("node-pools")
|
f := framework.NewDefaultFramework("node-pools")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
@ -38,7 +39,7 @@ var _ = SIGDescribe("GKE node pools [Feature:GKENodePool]", func() {
|
|||||||
e2eskipper.SkipUnlessProviderIs("gke")
|
e2eskipper.SkipUnlessProviderIs("gke")
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should create a cluster with multiple node pools [Feature:GKENodePool]", func(ctx context.Context) {
|
f.It("should create a cluster with multiple node pools", feature.GKENodePool, func(ctx context.Context) {
|
||||||
framework.Logf("Start create node pool test")
|
framework.Logf("Start create node pool test")
|
||||||
testCreateDeleteNodePool(ctx, f, "test-pool")
|
testCreateDeleteNodePool(ctx, f, "test-pool")
|
||||||
})
|
})
|
||||||
|
@ -31,6 +31,7 @@ import (
|
|||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
"k8s.io/kubernetes/test/e2e/common"
|
"k8s.io/kubernetes/test/e2e/common"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
@ -160,7 +161,7 @@ func waitForMasters(ctx context.Context, masterPrefix string, c clientset.Interf
|
|||||||
return fmt.Errorf("timeout waiting %v for the number of masters to be %d", timeout, size)
|
return fmt.Errorf("timeout waiting %v for the number of masters to be %d", timeout, size)
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = SIGDescribe("HA-master [Feature:HAMaster]", func() {
|
var _ = SIGDescribe("HA-master", feature.HAMaster, func() {
|
||||||
f := framework.NewDefaultFramework("ha-master")
|
f := framework.NewDefaultFramework("ha-master")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
var c clientset.Interface
|
var c clientset.Interface
|
||||||
@ -227,7 +228,7 @@ var _ = SIGDescribe("HA-master [Feature:HAMaster]", func() {
|
|||||||
verifyRCs(ctx, c, ns, existingRCs)
|
verifyRCs(ctx, c, ns, existingRCs)
|
||||||
}
|
}
|
||||||
|
|
||||||
ginkgo.It("survive addition/removal replicas same zone [Serial][Disruptive]", func(ctx context.Context) {
|
f.It("survive addition/removal replicas same zone", f.WithSerial(), f.WithDisruptive(), func(ctx context.Context) {
|
||||||
zone := framework.TestContext.CloudConfig.Zone
|
zone := framework.TestContext.CloudConfig.Zone
|
||||||
step(ctx, None, "")
|
step(ctx, None, "")
|
||||||
numAdditionalReplicas := 2
|
numAdditionalReplicas := 2
|
||||||
@ -239,7 +240,7 @@ var _ = SIGDescribe("HA-master [Feature:HAMaster]", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("survive addition/removal replicas different zones [Serial][Disruptive]", func(ctx context.Context) {
|
f.It("survive addition/removal replicas different zones", f.WithSerial(), f.WithDisruptive(), func(ctx context.Context) {
|
||||||
zone := framework.TestContext.CloudConfig.Zone
|
zone := framework.TestContext.CloudConfig.Zone
|
||||||
region := findRegionForZone(zone)
|
region := findRegionForZone(zone)
|
||||||
zones := findZonesForRegion(region)
|
zones := findZonesForRegion(region)
|
||||||
@ -257,7 +258,7 @@ var _ = SIGDescribe("HA-master [Feature:HAMaster]", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("survive addition/removal replicas multizone workers [Serial][Disruptive]", func(ctx context.Context) {
|
f.It("survive addition/removal replicas multizone workers", f.WithSerial(), f.WithDisruptive(), func(ctx context.Context) {
|
||||||
zone := framework.TestContext.CloudConfig.Zone
|
zone := framework.TestContext.CloudConfig.Zone
|
||||||
region := findRegionForZone(zone)
|
region := findRegionForZone(zone)
|
||||||
zones := findZonesForRegion(region)
|
zones := findZonesForRegion(region)
|
||||||
|
@ -25,6 +25,7 @@ import (
|
|||||||
|
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/kubernetes/pkg/cluster/ports"
|
"k8s.io/kubernetes/pkg/cluster/ports"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2ekubelet "k8s.io/kubernetes/test/e2e/framework/kubelet"
|
e2ekubelet "k8s.io/kubernetes/test/e2e/framework/kubelet"
|
||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
@ -33,7 +34,7 @@ import (
|
|||||||
"github.com/onsi/ginkgo/v2"
|
"github.com/onsi/ginkgo/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("Ports Security Check [Feature:KubeletSecurity]", func() {
|
var _ = SIGDescribe("Ports Security Check", feature.KubeletSecurity, func() {
|
||||||
f := framework.NewDefaultFramework("kubelet-security")
|
f := framework.NewDefaultFramework("kubelet-security")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"k8s.io/kubernetes/test/e2e/cloud/gcp/common"
|
"k8s.io/kubernetes/test/e2e/cloud/gcp/common"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
"k8s.io/kubernetes/test/e2e/upgrades"
|
"k8s.io/kubernetes/test/e2e/upgrades"
|
||||||
@ -45,7 +46,7 @@ func kubeProxyDaemonSetExtraEnvs(enableKubeProxyDaemonSet bool) []string {
|
|||||||
return []string{fmt.Sprintf("KUBE_PROXY_DAEMONSET=%v", enableKubeProxyDaemonSet)}
|
return []string{fmt.Sprintf("KUBE_PROXY_DAEMONSET=%v", enableKubeProxyDaemonSet)}
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = SIGDescribe("kube-proxy migration [Feature:KubeProxyDaemonSetMigration]", func() {
|
var _ = SIGDescribe("kube-proxy migration", feature.KubeProxyDaemonSetMigration, func() {
|
||||||
f := framework.NewDefaultFramework("kube-proxy-ds-migration")
|
f := framework.NewDefaultFramework("kube-proxy-ds-migration")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
upgradeTestFrameworks := upgrades.CreateUpgradeFrameworks(upgradeTests)
|
upgradeTestFrameworks := upgrades.CreateUpgradeFrameworks(upgradeTests)
|
||||||
@ -56,7 +57,7 @@ var _ = SIGDescribe("kube-proxy migration [Feature:KubeProxyDaemonSetMigration]"
|
|||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.Describe("Upgrade kube-proxy from static pods to a DaemonSet", func() {
|
ginkgo.Describe("Upgrade kube-proxy from static pods to a DaemonSet", func() {
|
||||||
ginkgo.It("should maintain a functioning cluster [Feature:KubeProxyDaemonSetUpgrade]", func(ctx context.Context) {
|
f.It("should maintain a functioning cluster", feature.KubeProxyDaemonSetUpgrade, func(ctx context.Context) {
|
||||||
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
@ -74,7 +75,7 @@ var _ = SIGDescribe("kube-proxy migration [Feature:KubeProxyDaemonSetMigration]"
|
|||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.Describe("Downgrade kube-proxy from a DaemonSet to static pods", func() {
|
ginkgo.Describe("Downgrade kube-proxy from a DaemonSet to static pods", func() {
|
||||||
ginkgo.It("should maintain a functioning cluster [Feature:KubeProxyDaemonSetDowngrade]", func(ctx context.Context) {
|
f.It("should maintain a functioning cluster", feature.KubeProxyDaemonSetDowngrade, func(ctx context.Context) {
|
||||||
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"k8s.io/kubernetes/test/e2e/cloud/gcp/common"
|
"k8s.io/kubernetes/test/e2e/cloud/gcp/common"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
"k8s.io/kubernetes/test/e2e/upgrades"
|
"k8s.io/kubernetes/test/e2e/upgrades"
|
||||||
"k8s.io/kubernetes/test/e2e/upgrades/node"
|
"k8s.io/kubernetes/test/e2e/upgrades/node"
|
||||||
@ -33,13 +34,13 @@ var upgradeTests = []upgrades.Test{
|
|||||||
&node.NvidiaGPUUpgradeTest{},
|
&node.NvidiaGPUUpgradeTest{},
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = SIGDescribe("gpu Upgrade [Feature:GPUUpgrade]", func() {
|
var _ = SIGDescribe("gpu Upgrade", feature.GPUUpgrade, func() {
|
||||||
f := framework.NewDefaultFramework("gpu-upgrade")
|
f := framework.NewDefaultFramework("gpu-upgrade")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
testFrameworks := upgrades.CreateUpgradeFrameworks(upgradeTests)
|
testFrameworks := upgrades.CreateUpgradeFrameworks(upgradeTests)
|
||||||
|
|
||||||
ginkgo.Describe("master upgrade", func() {
|
ginkgo.Describe("master upgrade", func() {
|
||||||
ginkgo.It("should NOT disrupt gpu pod [Feature:GPUMasterUpgrade]", func(ctx context.Context) {
|
f.It("should NOT disrupt gpu pod", feature.GPUMasterUpgrade, func(ctx context.Context) {
|
||||||
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
@ -52,7 +53,7 @@ var _ = SIGDescribe("gpu Upgrade [Feature:GPUUpgrade]", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
ginkgo.Describe("cluster upgrade", func() {
|
ginkgo.Describe("cluster upgrade", func() {
|
||||||
ginkgo.It("should be able to run gpu pod after upgrade [Feature:GPUClusterUpgrade]", func(ctx context.Context) {
|
f.It("should be able to run gpu pod after upgrade", feature.GPUClusterUpgrade, func(ctx context.Context) {
|
||||||
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
@ -65,7 +66,7 @@ var _ = SIGDescribe("gpu Upgrade [Feature:GPUUpgrade]", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
ginkgo.Describe("cluster downgrade", func() {
|
ginkgo.Describe("cluster downgrade", func() {
|
||||||
ginkgo.It("should be able to run gpu pod after downgrade [Feature:GPUClusterDowngrade]", func(ctx context.Context) {
|
f.It("should be able to run gpu pod after downgrade", feature.GPUClusterDowngrade, func(ctx context.Context) {
|
||||||
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
upgCtx, err := common.GetUpgradeContext(f.ClientSet.Discovery())
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ import (
|
|||||||
"github.com/onsi/gomega"
|
"github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("[Disruptive]NodeLease", func() {
|
var _ = SIGDescribe(framework.WithDisruptive(), "NodeLease", func() {
|
||||||
f := framework.NewDefaultFramework("node-lease-test")
|
f := framework.NewDefaultFramework("node-lease-test")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
var systemPodsNo int32
|
var systemPodsNo int32
|
||||||
|
@ -29,6 +29,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
"k8s.io/apimachinery/pkg/util/sets"
|
"k8s.io/apimachinery/pkg/util/sets"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
@ -54,7 +55,7 @@ const (
|
|||||||
rebootPodReadyAgainTimeout = 5 * time.Minute
|
rebootPodReadyAgainTimeout = 5 * time.Minute
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("Reboot [Disruptive] [Feature:Reboot]", func() {
|
var _ = SIGDescribe("Reboot", framework.WithDisruptive(), feature.Reboot, func() {
|
||||||
var f *framework.Framework
|
var f *framework.Framework
|
||||||
|
|
||||||
ginkgo.BeforeEach(func() {
|
ginkgo.BeforeEach(func() {
|
||||||
|
@ -27,6 +27,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/fields"
|
"k8s.io/apimachinery/pkg/fields"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
@ -42,7 +43,7 @@ const (
|
|||||||
recreateNodeReadyAgainTimeout = 10 * time.Minute
|
recreateNodeReadyAgainTimeout = 10 * time.Minute
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("Recreate [Feature:Recreate]", func() {
|
var _ = SIGDescribe("Recreate", feature.Recreate, func() {
|
||||||
f := framework.NewDefaultFramework("recreate")
|
f := framework.NewDefaultFramework("recreate")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
var originalNodes []v1.Node
|
var originalNodes []v1.Node
|
||||||
|
@ -44,7 +44,7 @@ func resizeRC(ctx context.Context, c clientset.Interface, ns, name string, repli
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = SIGDescribe("Nodes [Disruptive]", func() {
|
var _ = SIGDescribe("Nodes", framework.WithDisruptive(), func() {
|
||||||
f := framework.NewDefaultFramework("resize-nodes")
|
f := framework.NewDefaultFramework("resize-nodes")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
var systemPodsNo int32
|
var systemPodsNo int32
|
||||||
@ -66,7 +66,7 @@ var _ = SIGDescribe("Nodes [Disruptive]", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Slow issue #13323 (8 min)
|
// Slow issue #13323 (8 min)
|
||||||
ginkgo.Describe("Resize [Slow]", func() {
|
f.Describe("Resize", framework.WithSlow(), func() {
|
||||||
var originalNodeCount int32
|
var originalNodeCount int32
|
||||||
|
|
||||||
ginkgo.BeforeEach(func() {
|
ginkgo.BeforeEach(func() {
|
||||||
|
@ -43,7 +43,7 @@ func nodeNames(nodes []v1.Node) []string {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = SIGDescribe("Restart [Disruptive]", func() {
|
var _ = SIGDescribe("Restart", framework.WithDisruptive(), func() {
|
||||||
f := framework.NewDefaultFramework("restart")
|
f := framework.NewDefaultFramework("restart")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
var ps *testutils.PodStore
|
var ps *testutils.PodStore
|
||||||
|
@ -24,6 +24,7 @@ import (
|
|||||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
@ -33,7 +34,7 @@ import (
|
|||||||
"github.com/onsi/gomega"
|
"github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("[Feature:CloudProvider][Disruptive] Nodes", func() {
|
var _ = SIGDescribe(feature.CloudProvider, framework.WithDisruptive(), "Nodes", func() {
|
||||||
f := framework.NewDefaultFramework("cloudprovider")
|
f := framework.NewDefaultFramework("cloudprovider")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
var c clientset.Interface
|
var c clientset.Interface
|
||||||
|
@ -22,6 +22,7 @@ import (
|
|||||||
"github.com/onsi/ginkgo/v2"
|
"github.com/onsi/ginkgo/v2"
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/sets"
|
"k8s.io/apimachinery/pkg/util/sets"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2enetwork "k8s.io/kubernetes/test/e2e/framework/network"
|
e2enetwork "k8s.io/kubernetes/test/e2e/framework/network"
|
||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
@ -81,7 +82,7 @@ var _ = SIGDescribe("Networking", func() {
|
|||||||
Description: Create a hostexec pod that is capable of curl to netcat commands. Create a test Pod that will act as a webserver front end exposing ports 8080 for tcp and 8081 for udp. The netserver service proxies are created on specified number of nodes.
|
Description: Create a hostexec pod that is capable of curl to netcat commands. Create a test Pod that will act as a webserver front end exposing ports 8080 for tcp and 8081 for udp. The netserver service proxies are created on specified number of nodes.
|
||||||
The kubectl exec on the webserver container MUST reach a http port on the each of service proxy endpoints in the cluster and the request MUST be successful. Container will execute curl command to reach the service port within specified max retry limit and MUST result in reporting unique hostnames.
|
The kubectl exec on the webserver container MUST reach a http port on the each of service proxy endpoints in the cluster and the request MUST be successful. Container will execute curl command to reach the service port within specified max retry limit and MUST result in reporting unique hostnames.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should function for intra-pod communication: http [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should function for intra-pod communication: http", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
config := e2enetwork.NewCoreNetworkingTestConfig(ctx, f, false)
|
config := e2enetwork.NewCoreNetworkingTestConfig(ctx, f, false)
|
||||||
checkPodToPodConnectivity(ctx, config, "http", e2enetwork.EndpointHTTPPort)
|
checkPodToPodConnectivity(ctx, config, "http", e2enetwork.EndpointHTTPPort)
|
||||||
})
|
})
|
||||||
@ -92,7 +93,7 @@ var _ = SIGDescribe("Networking", func() {
|
|||||||
Description: Create a hostexec pod that is capable of curl to netcat commands. Create a test Pod that will act as a webserver front end exposing ports 8080 for tcp and 8081 for udp. The netserver service proxies are created on specified number of nodes.
|
Description: Create a hostexec pod that is capable of curl to netcat commands. Create a test Pod that will act as a webserver front end exposing ports 8080 for tcp and 8081 for udp. The netserver service proxies are created on specified number of nodes.
|
||||||
The kubectl exec on the webserver container MUST reach a udp port on the each of service proxy endpoints in the cluster and the request MUST be successful. Container will execute curl command to reach the service port within specified max retry limit and MUST result in reporting unique hostnames.
|
The kubectl exec on the webserver container MUST reach a udp port on the each of service proxy endpoints in the cluster and the request MUST be successful. Container will execute curl command to reach the service port within specified max retry limit and MUST result in reporting unique hostnames.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should function for intra-pod communication: udp [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should function for intra-pod communication: udp", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
config := e2enetwork.NewCoreNetworkingTestConfig(ctx, f, false)
|
config := e2enetwork.NewCoreNetworkingTestConfig(ctx, f, false)
|
||||||
checkPodToPodConnectivity(ctx, config, "udp", e2enetwork.EndpointUDPPort)
|
checkPodToPodConnectivity(ctx, config, "udp", e2enetwork.EndpointUDPPort)
|
||||||
})
|
})
|
||||||
@ -104,7 +105,7 @@ var _ = SIGDescribe("Networking", func() {
|
|||||||
The kubectl exec on the webserver container MUST reach a http port on the each of service proxy endpoints in the cluster using a http post(protocol=tcp) and the request MUST be successful. Container will execute curl command to reach the service port within specified max retry limit and MUST result in reporting unique hostnames.
|
The kubectl exec on the webserver container MUST reach a http port on the each of service proxy endpoints in the cluster using a http post(protocol=tcp) and the request MUST be successful. Container will execute curl command to reach the service port within specified max retry limit and MUST result in reporting unique hostnames.
|
||||||
This test is marked LinuxOnly it breaks when using Overlay networking with Windows.
|
This test is marked LinuxOnly it breaks when using Overlay networking with Windows.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should function for node-pod communication: http [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should function for node-pod communication: http [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
config := e2enetwork.NewCoreNetworkingTestConfig(ctx, f, true)
|
config := e2enetwork.NewCoreNetworkingTestConfig(ctx, f, true)
|
||||||
for _, endpointPod := range config.EndpointPods {
|
for _, endpointPod := range config.EndpointPods {
|
||||||
err := config.DialFromNode(ctx, "http", endpointPod.Status.PodIP, e2enetwork.EndpointHTTPPort, config.MaxTries, 0, sets.NewString(endpointPod.Name))
|
err := config.DialFromNode(ctx, "http", endpointPod.Status.PodIP, e2enetwork.EndpointHTTPPort, config.MaxTries, 0, sets.NewString(endpointPod.Name))
|
||||||
@ -121,7 +122,7 @@ var _ = SIGDescribe("Networking", func() {
|
|||||||
The kubectl exec on the webserver container MUST reach a http port on the each of service proxy endpoints in the cluster using a http post(protocol=udp) and the request MUST be successful. Container will execute curl command to reach the service port within specified max retry limit and MUST result in reporting unique hostnames.
|
The kubectl exec on the webserver container MUST reach a http port on the each of service proxy endpoints in the cluster using a http post(protocol=udp) and the request MUST be successful. Container will execute curl command to reach the service port within specified max retry limit and MUST result in reporting unique hostnames.
|
||||||
This test is marked LinuxOnly it breaks when using Overlay networking with Windows.
|
This test is marked LinuxOnly it breaks when using Overlay networking with Windows.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should function for node-pod communication: udp [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should function for node-pod communication: udp [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
config := e2enetwork.NewCoreNetworkingTestConfig(ctx, f, true)
|
config := e2enetwork.NewCoreNetworkingTestConfig(ctx, f, true)
|
||||||
for _, endpointPod := range config.EndpointPods {
|
for _, endpointPod := range config.EndpointPods {
|
||||||
err := config.DialFromNode(ctx, "udp", endpointPod.Status.PodIP, e2enetwork.EndpointUDPPort, config.MaxTries, 0, sets.NewString(endpointPod.Name))
|
err := config.DialFromNode(ctx, "udp", endpointPod.Status.PodIP, e2enetwork.EndpointUDPPort, config.MaxTries, 0, sets.NewString(endpointPod.Name))
|
||||||
@ -131,12 +132,12 @@ var _ = SIGDescribe("Networking", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should function for intra-pod communication: sctp [LinuxOnly][Feature:SCTPConnectivity]", func(ctx context.Context) {
|
f.It("should function for intra-pod communication: sctp [LinuxOnly]", feature.SCTPConnectivity, func(ctx context.Context) {
|
||||||
config := e2enetwork.NewNetworkingTestConfig(ctx, f, e2enetwork.EnableSCTP)
|
config := e2enetwork.NewNetworkingTestConfig(ctx, f, e2enetwork.EnableSCTP)
|
||||||
checkPodToPodConnectivity(ctx, config, "sctp", e2enetwork.EndpointSCTPPort)
|
checkPodToPodConnectivity(ctx, config, "sctp", e2enetwork.EndpointSCTPPort)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should function for node-pod communication: sctp [LinuxOnly][Feature:SCTPConnectivity]", func(ctx context.Context) {
|
f.It("should function for node-pod communication: sctp [LinuxOnly]", feature.SCTPConnectivity, func(ctx context.Context) {
|
||||||
ginkgo.Skip("Skipping SCTP node to pod test until DialFromNode supports SCTP #96482")
|
ginkgo.Skip("Skipping SCTP node to pod test until DialFromNode supports SCTP #96482")
|
||||||
config := e2enetwork.NewNetworkingTestConfig(ctx, f, e2enetwork.EnableSCTP)
|
config := e2enetwork.NewNetworkingTestConfig(ctx, f, e2enetwork.EnableSCTP)
|
||||||
for _, endpointPod := range config.EndpointPods {
|
for _, endpointPod := range config.EndpointPods {
|
||||||
|
@ -43,7 +43,7 @@ var _ = SIGDescribe("ConfigMap", func() {
|
|||||||
Testname: ConfigMap, from environment field
|
Testname: ConfigMap, from environment field
|
||||||
Description: Create a Pod with an environment variable value set using a value from ConfigMap. A ConfigMap value MUST be accessible in the container environment.
|
Description: Create a Pod with an environment variable value set using a value from ConfigMap. A ConfigMap value MUST be accessible in the container environment.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable via environment variable [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable via environment variable", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
name := "configmap-test-" + string(uuid.NewUUID())
|
name := "configmap-test-" + string(uuid.NewUUID())
|
||||||
configMap := newConfigMap(f, name)
|
configMap := newConfigMap(f, name)
|
||||||
ginkgo.By(fmt.Sprintf("Creating configMap %v/%v", f.Namespace.Name, configMap.Name))
|
ginkgo.By(fmt.Sprintf("Creating configMap %v/%v", f.Namespace.Name, configMap.Name))
|
||||||
@ -91,7 +91,7 @@ var _ = SIGDescribe("ConfigMap", func() {
|
|||||||
Testname: ConfigMap, from environment variables
|
Testname: ConfigMap, from environment variables
|
||||||
Description: Create a Pod with a environment source from ConfigMap. All ConfigMap values MUST be available as environment variables in the container.
|
Description: Create a Pod with a environment source from ConfigMap. All ConfigMap values MUST be available as environment variables in the container.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable via the environment [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable via the environment", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
name := "configmap-test-" + string(uuid.NewUUID())
|
name := "configmap-test-" + string(uuid.NewUUID())
|
||||||
configMap := newConfigMap(f, name)
|
configMap := newConfigMap(f, name)
|
||||||
ginkgo.By(fmt.Sprintf("Creating configMap %v/%v", f.Namespace.Name, configMap.Name))
|
ginkgo.By(fmt.Sprintf("Creating configMap %v/%v", f.Namespace.Name, configMap.Name))
|
||||||
|
@ -24,18 +24,18 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
|
||||||
"k8s.io/apimachinery/pkg/watch"
|
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
|
||||||
"k8s.io/client-go/tools/cache"
|
|
||||||
|
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/fields"
|
"k8s.io/apimachinery/pkg/fields"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/apimachinery/pkg/util/intstr"
|
"k8s.io/apimachinery/pkg/util/intstr"
|
||||||
"k8s.io/apimachinery/pkg/util/uuid"
|
"k8s.io/apimachinery/pkg/util/uuid"
|
||||||
|
"k8s.io/apimachinery/pkg/watch"
|
||||||
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
|
"k8s.io/client-go/tools/cache"
|
||||||
podutil "k8s.io/kubernetes/pkg/api/v1/pod"
|
podutil "k8s.io/kubernetes/pkg/api/v1/pod"
|
||||||
"k8s.io/kubernetes/pkg/kubelet/events"
|
"k8s.io/kubernetes/pkg/kubelet/events"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2eevents "k8s.io/kubernetes/test/e2e/framework/events"
|
e2eevents "k8s.io/kubernetes/test/e2e/framework/events"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
@ -68,7 +68,7 @@ var _ = SIGDescribe("Probing container", func() {
|
|||||||
Testname: Pod readiness probe, with initial delay
|
Testname: Pod readiness probe, with initial delay
|
||||||
Description: Create a Pod that is configured with a initial delay set on the readiness probe. Check the Pod Start time to compare to the initial delay. The Pod MUST be ready only after the specified initial delay.
|
Description: Create a Pod that is configured with a initial delay set on the readiness probe. Check the Pod Start time to compare to the initial delay. The Pod MUST be ready only after the specified initial delay.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("with readiness probe should not be ready before initial delay and never restart [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("with readiness probe should not be ready before initial delay and never restart", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
containerName := "test-webserver"
|
containerName := "test-webserver"
|
||||||
p := podClient.Create(ctx, testWebServerPodSpec(probe.withInitialDelay().build(), nil, containerName, 80))
|
p := podClient.Create(ctx, testWebServerPodSpec(probe.withInitialDelay().build(), nil, containerName, 80))
|
||||||
framework.ExpectNoError(e2epod.WaitTimeoutForPodReadyInNamespace(ctx, f.ClientSet, p.Name, f.Namespace.Name, framework.PodStartTimeout))
|
framework.ExpectNoError(e2epod.WaitTimeoutForPodReadyInNamespace(ctx, f.ClientSet, p.Name, f.Namespace.Name, framework.PodStartTimeout))
|
||||||
@ -104,7 +104,7 @@ var _ = SIGDescribe("Probing container", func() {
|
|||||||
Description: Create a Pod with a readiness probe that fails consistently. When this Pod is created,
|
Description: Create a Pod with a readiness probe that fails consistently. When this Pod is created,
|
||||||
then the Pod MUST never be ready, never be running and restart count MUST be zero.
|
then the Pod MUST never be ready, never be running and restart count MUST be zero.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("with readiness probe that fails should never be ready and never restart [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("with readiness probe that fails should never be ready and never restart", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
p := podClient.Create(ctx, testWebServerPodSpec(probe.withFailing().build(), nil, "test-webserver", 80))
|
p := podClient.Create(ctx, testWebServerPodSpec(probe.withFailing().build(), nil, "test-webserver", 80))
|
||||||
gomega.Consistently(ctx, func() (bool, error) {
|
gomega.Consistently(ctx, func() (bool, error) {
|
||||||
p, err := podClient.Get(ctx, p.Name, metav1.GetOptions{})
|
p, err := podClient.Get(ctx, p.Name, metav1.GetOptions{})
|
||||||
@ -131,7 +131,7 @@ var _ = SIGDescribe("Probing container", func() {
|
|||||||
Testname: Pod liveness probe, using local file, restart
|
Testname: Pod liveness probe, using local file, restart
|
||||||
Description: Create a Pod with liveness probe that uses ExecAction handler to cat /temp/health file. The Container deletes the file /temp/health after 10 second, triggering liveness probe to fail. The Pod MUST now be killed and restarted incrementing restart count to 1.
|
Description: Create a Pod with liveness probe that uses ExecAction handler to cat /temp/health file. The Container deletes the file /temp/health after 10 second, triggering liveness probe to fail. The Pod MUST now be killed and restarted incrementing restart count to 1.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be restarted with a exec \"cat /tmp/health\" liveness probe [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be restarted with a exec \"cat /tmp/health\" liveness probe", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
cmd := []string{"/bin/sh", "-c", "echo ok >/tmp/health; sleep 10; rm -rf /tmp/health; sleep 600"}
|
cmd := []string{"/bin/sh", "-c", "echo ok >/tmp/health; sleep 10; rm -rf /tmp/health; sleep 600"}
|
||||||
livenessProbe := &v1.Probe{
|
livenessProbe := &v1.Probe{
|
||||||
ProbeHandler: execHandler([]string{"cat", "/tmp/health"}),
|
ProbeHandler: execHandler([]string{"cat", "/tmp/health"}),
|
||||||
@ -148,7 +148,7 @@ var _ = SIGDescribe("Probing container", func() {
|
|||||||
Testname: Pod liveness probe, using local file, no restart
|
Testname: Pod liveness probe, using local file, no restart
|
||||||
Description: Pod is created with liveness probe that uses 'exec' command to cat /temp/health file. Liveness probe MUST not fail to check health and the restart count should remain 0.
|
Description: Pod is created with liveness probe that uses 'exec' command to cat /temp/health file. Liveness probe MUST not fail to check health and the restart count should remain 0.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should *not* be restarted with a exec \"cat /tmp/health\" liveness probe [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should *not* be restarted with a exec \"cat /tmp/health\" liveness probe", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
cmd := []string{"/bin/sh", "-c", "echo ok >/tmp/health; sleep 600"}
|
cmd := []string{"/bin/sh", "-c", "echo ok >/tmp/health; sleep 600"}
|
||||||
livenessProbe := &v1.Probe{
|
livenessProbe := &v1.Probe{
|
||||||
ProbeHandler: execHandler([]string{"cat", "/tmp/health"}),
|
ProbeHandler: execHandler([]string{"cat", "/tmp/health"}),
|
||||||
@ -165,7 +165,7 @@ var _ = SIGDescribe("Probing container", func() {
|
|||||||
Testname: Pod liveness probe, using http endpoint, restart
|
Testname: Pod liveness probe, using http endpoint, restart
|
||||||
Description: A Pod is created with liveness probe on http endpoint /healthz. The http handler on the /healthz will return a http error after 10 seconds since the Pod is started. This MUST result in liveness check failure. The Pod MUST now be killed and restarted incrementing restart count to 1.
|
Description: A Pod is created with liveness probe on http endpoint /healthz. The http handler on the /healthz will return a http error after 10 seconds since the Pod is started. This MUST result in liveness check failure. The Pod MUST now be killed and restarted incrementing restart count to 1.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be restarted with a /healthz http liveness probe [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be restarted with a /healthz http liveness probe", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
livenessProbe := &v1.Probe{
|
livenessProbe := &v1.Probe{
|
||||||
ProbeHandler: httpGetHandler("/healthz", 8080),
|
ProbeHandler: httpGetHandler("/healthz", 8080),
|
||||||
InitialDelaySeconds: 15,
|
InitialDelaySeconds: 15,
|
||||||
@ -180,7 +180,7 @@ var _ = SIGDescribe("Probing container", func() {
|
|||||||
Testname: Pod liveness probe, using tcp socket, no restart
|
Testname: Pod liveness probe, using tcp socket, no restart
|
||||||
Description: A Pod is created with liveness probe on tcp socket 8080. The http handler on port 8080 will return http errors after 10 seconds, but the socket will remain open. Liveness probe MUST not fail to check health and the restart count should remain 0.
|
Description: A Pod is created with liveness probe on tcp socket 8080. The http handler on port 8080 will return http errors after 10 seconds, but the socket will remain open. Liveness probe MUST not fail to check health and the restart count should remain 0.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should *not* be restarted with a tcp:8080 liveness probe [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should *not* be restarted with a tcp:8080 liveness probe", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
livenessProbe := &v1.Probe{
|
livenessProbe := &v1.Probe{
|
||||||
ProbeHandler: tcpSocketHandler(8080),
|
ProbeHandler: tcpSocketHandler(8080),
|
||||||
InitialDelaySeconds: 15,
|
InitialDelaySeconds: 15,
|
||||||
@ -195,7 +195,7 @@ var _ = SIGDescribe("Probing container", func() {
|
|||||||
Testname: Pod liveness probe, using http endpoint, multiple restarts (slow)
|
Testname: Pod liveness probe, using http endpoint, multiple restarts (slow)
|
||||||
Description: A Pod is created with liveness probe on http endpoint /healthz. The http handler on the /healthz will return a http error after 10 seconds since the Pod is started. This MUST result in liveness check failure. The Pod MUST now be killed and restarted incrementing restart count to 1. The liveness probe must fail again after restart once the http handler for /healthz enpoind on the Pod returns an http error after 10 seconds from the start. Restart counts MUST increment every time health check fails, measure up to 5 restart.
|
Description: A Pod is created with liveness probe on http endpoint /healthz. The http handler on the /healthz will return a http error after 10 seconds since the Pod is started. This MUST result in liveness check failure. The Pod MUST now be killed and restarted incrementing restart count to 1. The liveness probe must fail again after restart once the http handler for /healthz enpoind on the Pod returns an http error after 10 seconds from the start. Restart counts MUST increment every time health check fails, measure up to 5 restart.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should have monotonically increasing restart count [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should have monotonically increasing restart count", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
livenessProbe := &v1.Probe{
|
livenessProbe := &v1.Probe{
|
||||||
ProbeHandler: httpGetHandler("/healthz", 8080),
|
ProbeHandler: httpGetHandler("/healthz", 8080),
|
||||||
InitialDelaySeconds: 5,
|
InitialDelaySeconds: 5,
|
||||||
@ -211,7 +211,7 @@ var _ = SIGDescribe("Probing container", func() {
|
|||||||
Testname: Pod liveness probe, using http endpoint, failure
|
Testname: Pod liveness probe, using http endpoint, failure
|
||||||
Description: A Pod is created with liveness probe on http endpoint '/'. Liveness probe on this endpoint will not fail. When liveness probe does not fail then the restart count MUST remain zero.
|
Description: A Pod is created with liveness probe on http endpoint '/'. Liveness probe on this endpoint will not fail. When liveness probe does not fail then the restart count MUST remain zero.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should *not* be restarted with a /healthz http liveness probe [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should *not* be restarted with a /healthz http liveness probe", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
livenessProbe := &v1.Probe{
|
livenessProbe := &v1.Probe{
|
||||||
ProbeHandler: httpGetHandler("/", 80),
|
ProbeHandler: httpGetHandler("/", 80),
|
||||||
InitialDelaySeconds: 15,
|
InitialDelaySeconds: 15,
|
||||||
@ -227,7 +227,7 @@ var _ = SIGDescribe("Probing container", func() {
|
|||||||
Testname: Pod liveness probe, container exec timeout, restart
|
Testname: Pod liveness probe, container exec timeout, restart
|
||||||
Description: A Pod is created with liveness probe with a Exec action on the Pod. If the liveness probe call does not return within the timeout specified, liveness probe MUST restart the Pod.
|
Description: A Pod is created with liveness probe with a Exec action on the Pod. If the liveness probe call does not return within the timeout specified, liveness probe MUST restart the Pod.
|
||||||
*/
|
*/
|
||||||
ginkgo.It("should be restarted with an exec liveness probe with timeout [MinimumKubeletVersion:1.20] [NodeConformance]", func(ctx context.Context) {
|
f.It("should be restarted with an exec liveness probe with timeout [MinimumKubeletVersion:1.20]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
cmd := []string{"/bin/sh", "-c", "sleep 600"}
|
cmd := []string{"/bin/sh", "-c", "sleep 600"}
|
||||||
livenessProbe := &v1.Probe{
|
livenessProbe := &v1.Probe{
|
||||||
ProbeHandler: execHandler([]string{"/bin/sh", "-c", "sleep 10"}),
|
ProbeHandler: execHandler([]string{"/bin/sh", "-c", "sleep 10"}),
|
||||||
@ -244,7 +244,7 @@ var _ = SIGDescribe("Probing container", func() {
|
|||||||
Testname: Pod readiness probe, container exec timeout, not ready
|
Testname: Pod readiness probe, container exec timeout, not ready
|
||||||
Description: A Pod is created with readiness probe with a Exec action on the Pod. If the readiness probe call does not return within the timeout specified, readiness probe MUST not be Ready.
|
Description: A Pod is created with readiness probe with a Exec action on the Pod. If the readiness probe call does not return within the timeout specified, readiness probe MUST not be Ready.
|
||||||
*/
|
*/
|
||||||
ginkgo.It("should not be ready with an exec readiness probe timeout [MinimumKubeletVersion:1.20] [NodeConformance]", func(ctx context.Context) {
|
f.It("should not be ready with an exec readiness probe timeout [MinimumKubeletVersion:1.20]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
cmd := []string{"/bin/sh", "-c", "sleep 600"}
|
cmd := []string{"/bin/sh", "-c", "sleep 600"}
|
||||||
readinessProbe := &v1.Probe{
|
readinessProbe := &v1.Probe{
|
||||||
ProbeHandler: execHandler([]string{"/bin/sh", "-c", "sleep 10"}),
|
ProbeHandler: execHandler([]string{"/bin/sh", "-c", "sleep 10"}),
|
||||||
@ -459,7 +459,7 @@ var _ = SIGDescribe("Probing container", func() {
|
|||||||
Testname: Set terminationGracePeriodSeconds for livenessProbe
|
Testname: Set terminationGracePeriodSeconds for livenessProbe
|
||||||
Description: A pod with a long terminationGracePeriod is created with a shorter livenessProbe-level terminationGracePeriodSeconds. We confirm the shorter termination period is used.
|
Description: A pod with a long terminationGracePeriod is created with a shorter livenessProbe-level terminationGracePeriodSeconds. We confirm the shorter termination period is used.
|
||||||
*/
|
*/
|
||||||
ginkgo.It("should override timeoutGracePeriodSeconds when LivenessProbe field is set [NodeConformance]", func(ctx context.Context) {
|
f.It("should override timeoutGracePeriodSeconds when LivenessProbe field is set", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
cmd := []string{"/bin/sh", "-c", "sleep 1000"}
|
cmd := []string{"/bin/sh", "-c", "sleep 1000"}
|
||||||
// probe will fail since pod has no http endpoints
|
// probe will fail since pod has no http endpoints
|
||||||
shortGracePeriod := int64(5)
|
shortGracePeriod := int64(5)
|
||||||
@ -489,7 +489,7 @@ var _ = SIGDescribe("Probing container", func() {
|
|||||||
Testname: Set terminationGracePeriodSeconds for startupProbe
|
Testname: Set terminationGracePeriodSeconds for startupProbe
|
||||||
Description: A pod with a long terminationGracePeriod is created with a shorter startupProbe-level terminationGracePeriodSeconds. We confirm the shorter termination period is used.
|
Description: A pod with a long terminationGracePeriod is created with a shorter startupProbe-level terminationGracePeriodSeconds. We confirm the shorter termination period is used.
|
||||||
*/
|
*/
|
||||||
ginkgo.It("should override timeoutGracePeriodSeconds when StartupProbe field is set [NodeConformance]", func(ctx context.Context) {
|
f.It("should override timeoutGracePeriodSeconds when StartupProbe field is set", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
cmd := []string{"/bin/sh", "-c", "sleep 1000"}
|
cmd := []string{"/bin/sh", "-c", "sleep 1000"}
|
||||||
// probe will fail since pod has no http endpoints
|
// probe will fail since pod has no http endpoints
|
||||||
livenessProbe := &v1.Probe{
|
livenessProbe := &v1.Probe{
|
||||||
@ -524,7 +524,7 @@ var _ = SIGDescribe("Probing container", func() {
|
|||||||
Testname: Pod liveness probe, using grpc call, success
|
Testname: Pod liveness probe, using grpc call, success
|
||||||
Description: A Pod is created with liveness probe on grpc service. Liveness probe on this endpoint will not fail. When liveness probe does not fail then the restart count MUST remain zero.
|
Description: A Pod is created with liveness probe on grpc service. Liveness probe on this endpoint will not fail. When liveness probe does not fail then the restart count MUST remain zero.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should *not* be restarted with a GRPC liveness probe [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should *not* be restarted with a GRPC liveness probe", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
livenessProbe := &v1.Probe{
|
livenessProbe := &v1.Probe{
|
||||||
ProbeHandler: v1.ProbeHandler{
|
ProbeHandler: v1.ProbeHandler{
|
||||||
GRPC: &v1.GRPCAction{
|
GRPC: &v1.GRPCAction{
|
||||||
@ -547,7 +547,7 @@ var _ = SIGDescribe("Probing container", func() {
|
|||||||
Description: A Pod is created with liveness probe on grpc service. Liveness probe on this endpoint should fail because of wrong probe port.
|
Description: A Pod is created with liveness probe on grpc service. Liveness probe on this endpoint should fail because of wrong probe port.
|
||||||
When liveness probe does fail then the restart count should +1.
|
When liveness probe does fail then the restart count should +1.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be restarted with a GRPC liveness probe [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be restarted with a GRPC liveness probe", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
livenessProbe := &v1.Probe{
|
livenessProbe := &v1.Probe{
|
||||||
ProbeHandler: v1.ProbeHandler{
|
ProbeHandler: v1.ProbeHandler{
|
||||||
GRPC: &v1.GRPCAction{
|
GRPC: &v1.GRPCAction{
|
||||||
@ -729,7 +729,7 @@ done
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
var _ = SIGDescribe("[NodeAlphaFeature:SidecarContainers][Feature:SidecarContainers] Probing restartable init container", func() {
|
var _ = SIGDescribe("[NodeAlphaFeature:SidecarContainers]", feature.SidecarContainers, "Probing restartable init container", func() {
|
||||||
f := framework.NewDefaultFramework("container-probe")
|
f := framework.NewDefaultFramework("container-probe")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
||||||
var podClient *e2epod.PodClient
|
var podClient *e2epod.PodClient
|
||||||
|
@ -38,7 +38,7 @@ var _ = SIGDescribe("Containers", func() {
|
|||||||
Testname: Containers, without command and arguments
|
Testname: Containers, without command and arguments
|
||||||
Description: Default command and arguments from the container image entrypoint MUST be used when Pod does not specify the container command
|
Description: Default command and arguments from the container image entrypoint MUST be used when Pod does not specify the container command
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should use the image defaults if command and args are blank [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should use the image defaults if command and args are blank", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
pod := entrypointTestPod(f.Namespace.Name)
|
pod := entrypointTestPod(f.Namespace.Name)
|
||||||
pod.Spec.Containers[0].Args = nil
|
pod.Spec.Containers[0].Args = nil
|
||||||
pod = e2epod.NewPodClient(f).Create(ctx, pod)
|
pod = e2epod.NewPodClient(f).Create(ctx, pod)
|
||||||
@ -58,7 +58,7 @@ var _ = SIGDescribe("Containers", func() {
|
|||||||
Testname: Containers, with arguments
|
Testname: Containers, with arguments
|
||||||
Description: Default command and from the container image entrypoint MUST be used when Pod does not specify the container command but the arguments from Pod spec MUST override when specified.
|
Description: Default command and from the container image entrypoint MUST be used when Pod does not specify the container command but the arguments from Pod spec MUST override when specified.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be able to override the image's default arguments (container cmd) [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be able to override the image's default arguments (container cmd)", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
pod := entrypointTestPod(f.Namespace.Name, "entrypoint-tester", "override", "arguments")
|
pod := entrypointTestPod(f.Namespace.Name, "entrypoint-tester", "override", "arguments")
|
||||||
e2epodoutput.TestContainerOutput(ctx, f, "override arguments", pod, 0, []string{
|
e2epodoutput.TestContainerOutput(ctx, f, "override arguments", pod, 0, []string{
|
||||||
"[/agnhost entrypoint-tester override arguments]",
|
"[/agnhost entrypoint-tester override arguments]",
|
||||||
@ -72,7 +72,7 @@ var _ = SIGDescribe("Containers", func() {
|
|||||||
Testname: Containers, with command
|
Testname: Containers, with command
|
||||||
Description: Default command from the container image entrypoint MUST NOT be used when Pod specifies the container command. Command from Pod spec MUST override the command in the image.
|
Description: Default command from the container image entrypoint MUST NOT be used when Pod specifies the container command. Command from Pod spec MUST override the command in the image.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be able to override the image's default command (container entrypoint) [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be able to override the image's default command (container entrypoint)", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
pod := entrypointTestPod(f.Namespace.Name, "entrypoint-tester")
|
pod := entrypointTestPod(f.Namespace.Name, "entrypoint-tester")
|
||||||
pod.Spec.Containers[0].Command = []string{"/agnhost-2"}
|
pod.Spec.Containers[0].Command = []string{"/agnhost-2"}
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ var _ = SIGDescribe("Containers", func() {
|
|||||||
Testname: Containers, with command and arguments
|
Testname: Containers, with command and arguments
|
||||||
Description: Default command and arguments from the container image entrypoint MUST NOT be used when Pod specifies the container command and arguments. Command and arguments from Pod spec MUST override the command and arguments in the image.
|
Description: Default command and arguments from the container image entrypoint MUST NOT be used when Pod specifies the container command and arguments. Command and arguments from Pod spec MUST override the command and arguments in the image.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be able to override the image's default command and arguments [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be able to override the image's default command and arguments", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
pod := entrypointTestPod(f.Namespace.Name, "entrypoint-tester", "override", "arguments")
|
pod := entrypointTestPod(f.Namespace.Name, "entrypoint-tester", "override", "arguments")
|
||||||
pod.Spec.Containers[0].Command = []string{"/agnhost-2"}
|
pod.Spec.Containers[0].Command = []string{"/agnhost-2"}
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ import (
|
|||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2enetwork "k8s.io/kubernetes/test/e2e/framework/network"
|
e2enetwork "k8s.io/kubernetes/test/e2e/framework/network"
|
||||||
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
|
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
|
||||||
|
"k8s.io/kubernetes/test/e2e/nodefeature"
|
||||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
|
|
||||||
@ -42,7 +43,7 @@ var _ = SIGDescribe("Downward API", func() {
|
|||||||
Testname: DownwardAPI, environment for name, namespace and ip
|
Testname: DownwardAPI, environment for name, namespace and ip
|
||||||
Description: Downward API MUST expose Pod and Container fields as environment variables. Specify Pod Name, namespace and IP as environment variable in the Pod Spec are visible at runtime in the container.
|
Description: Downward API MUST expose Pod and Container fields as environment variables. Specify Pod Name, namespace and IP as environment variable in the Pod Spec are visible at runtime in the container.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide pod name, namespace and IP address as env vars [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide pod name, namespace and IP address as env vars", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downward-api-" + string(uuid.NewUUID())
|
podName := "downward-api-" + string(uuid.NewUUID())
|
||||||
env := []v1.EnvVar{
|
env := []v1.EnvVar{
|
||||||
{
|
{
|
||||||
@ -88,7 +89,7 @@ var _ = SIGDescribe("Downward API", func() {
|
|||||||
Testname: DownwardAPI, environment for host ip
|
Testname: DownwardAPI, environment for host ip
|
||||||
Description: Downward API MUST expose Pod and Container fields as environment variables. Specify host IP as environment variable in the Pod Spec are visible at runtime in the container.
|
Description: Downward API MUST expose Pod and Container fields as environment variables. Specify host IP as environment variable in the Pod Spec are visible at runtime in the container.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide host IP as an env var [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide host IP as an env var", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downward-api-" + string(uuid.NewUUID())
|
podName := "downward-api-" + string(uuid.NewUUID())
|
||||||
env := []v1.EnvVar{
|
env := []v1.EnvVar{
|
||||||
{
|
{
|
||||||
@ -164,7 +165,7 @@ var _ = SIGDescribe("Downward API", func() {
|
|||||||
Testname: DownwardAPI, environment for CPU and memory limits and requests
|
Testname: DownwardAPI, environment for CPU and memory limits and requests
|
||||||
Description: Downward API MUST expose CPU request and Memory request set through environment variables at runtime in the container.
|
Description: Downward API MUST expose CPU request and Memory request set through environment variables at runtime in the container.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide container's limits.cpu/memory and requests.cpu/memory as env vars [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide container's limits.cpu/memory and requests.cpu/memory as env vars", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downward-api-" + string(uuid.NewUUID())
|
podName := "downward-api-" + string(uuid.NewUUID())
|
||||||
env := []v1.EnvVar{
|
env := []v1.EnvVar{
|
||||||
{
|
{
|
||||||
@ -215,7 +216,7 @@ var _ = SIGDescribe("Downward API", func() {
|
|||||||
Testname: DownwardAPI, environment for default CPU and memory limits and requests
|
Testname: DownwardAPI, environment for default CPU and memory limits and requests
|
||||||
Description: Downward API MUST expose CPU request and Memory limits set through environment variables at runtime in the container.
|
Description: Downward API MUST expose CPU request and Memory limits set through environment variables at runtime in the container.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide default limits.cpu/memory from node allocatable [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide default limits.cpu/memory from node allocatable", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downward-api-" + string(uuid.NewUUID())
|
podName := "downward-api-" + string(uuid.NewUUID())
|
||||||
env := []v1.EnvVar{
|
env := []v1.EnvVar{
|
||||||
{
|
{
|
||||||
@ -265,7 +266,7 @@ var _ = SIGDescribe("Downward API", func() {
|
|||||||
Testname: DownwardAPI, environment for Pod UID
|
Testname: DownwardAPI, environment for Pod UID
|
||||||
Description: Downward API MUST expose Pod UID set through environment variables at runtime in the container.
|
Description: Downward API MUST expose Pod UID set through environment variables at runtime in the container.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide pod UID as env vars [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide pod UID as env vars", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downward-api-" + string(uuid.NewUUID())
|
podName := "downward-api-" + string(uuid.NewUUID())
|
||||||
env := []v1.EnvVar{
|
env := []v1.EnvVar{
|
||||||
{
|
{
|
||||||
@ -287,7 +288,7 @@ var _ = SIGDescribe("Downward API", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
var _ = SIGDescribe("Downward API [Serial] [Disruptive] [NodeFeature:DownwardAPIHugePages]", func() {
|
var _ = SIGDescribe("Downward API", framework.WithSerial(), framework.WithDisruptive(), nodefeature.DownwardAPIHugePages, func() {
|
||||||
f := framework.NewDefaultFramework("downward-api")
|
f := framework.NewDefaultFramework("downward-api")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ import (
|
|||||||
"github.com/onsi/gomega"
|
"github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("Ephemeral Containers [NodeConformance]", func() {
|
var _ = SIGDescribe("Ephemeral Containers", framework.WithNodeConformance(), func() {
|
||||||
f := framework.NewDefaultFramework("ephemeral-containers-test")
|
f := framework.NewDefaultFramework("ephemeral-containers-test")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
||||||
var podClient *e2epod.PodClient
|
var podClient *e2epod.PodClient
|
||||||
|
@ -44,7 +44,7 @@ var _ = SIGDescribe("Variable Expansion", func() {
|
|||||||
Testname: Environment variables, expansion
|
Testname: Environment variables, expansion
|
||||||
Description: Create a Pod with environment variables. Environment variables defined using previously defined environment variables MUST expand to proper values.
|
Description: Create a Pod with environment variables. Environment variables defined using previously defined environment variables MUST expand to proper values.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should allow composing env vars into new env vars [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should allow composing env vars into new env vars", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
envVars := []v1.EnvVar{
|
envVars := []v1.EnvVar{
|
||||||
{
|
{
|
||||||
Name: "FOO",
|
Name: "FOO",
|
||||||
@ -73,7 +73,7 @@ var _ = SIGDescribe("Variable Expansion", func() {
|
|||||||
Testname: Environment variables, command expansion
|
Testname: Environment variables, command expansion
|
||||||
Description: Create a Pod with environment variables and container command using them. Container command using the defined environment variables MUST expand to proper values.
|
Description: Create a Pod with environment variables and container command using them. Container command using the defined environment variables MUST expand to proper values.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should allow substituting values in a container's command [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should allow substituting values in a container's command", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
envVars := []v1.EnvVar{
|
envVars := []v1.EnvVar{
|
||||||
{
|
{
|
||||||
Name: "TEST_VAR",
|
Name: "TEST_VAR",
|
||||||
@ -92,7 +92,7 @@ var _ = SIGDescribe("Variable Expansion", func() {
|
|||||||
Testname: Environment variables, command argument expansion
|
Testname: Environment variables, command argument expansion
|
||||||
Description: Create a Pod with environment variables and container command arguments using them. Container command arguments using the defined environment variables MUST expand to proper values.
|
Description: Create a Pod with environment variables and container command arguments using them. Container command arguments using the defined environment variables MUST expand to proper values.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should allow substituting values in a container's args [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should allow substituting values in a container's args", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
envVars := []v1.EnvVar{
|
envVars := []v1.EnvVar{
|
||||||
{
|
{
|
||||||
Name: "TEST_VAR",
|
Name: "TEST_VAR",
|
||||||
@ -152,7 +152,7 @@ var _ = SIGDescribe("Variable Expansion", func() {
|
|||||||
Testname: VolumeSubpathEnvExpansion, subpath with backticks
|
Testname: VolumeSubpathEnvExpansion, subpath with backticks
|
||||||
Description: Make sure a container's subpath can not be set using an expansion of environment variables when backticks are supplied.
|
Description: Make sure a container's subpath can not be set using an expansion of environment variables when backticks are supplied.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should fail substituting values in a volume subpath with backticks [Slow]", func(ctx context.Context) {
|
framework.ConformanceIt("should fail substituting values in a volume subpath with backticks", f.WithSlow(), func(ctx context.Context) {
|
||||||
|
|
||||||
envVars := []v1.EnvVar{
|
envVars := []v1.EnvVar{
|
||||||
{
|
{
|
||||||
@ -186,7 +186,7 @@ var _ = SIGDescribe("Variable Expansion", func() {
|
|||||||
Testname: VolumeSubpathEnvExpansion, subpath with absolute path
|
Testname: VolumeSubpathEnvExpansion, subpath with absolute path
|
||||||
Description: Make sure a container's subpath can not be set using an expansion of environment variables when absolute path is supplied.
|
Description: Make sure a container's subpath can not be set using an expansion of environment variables when absolute path is supplied.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should fail substituting values in a volume subpath with absolute path [Slow]", func(ctx context.Context) {
|
framework.ConformanceIt("should fail substituting values in a volume subpath with absolute path", f.WithSlow(), func(ctx context.Context) {
|
||||||
absolutePath := "/tmp"
|
absolutePath := "/tmp"
|
||||||
if framework.NodeOSDistroIs("windows") {
|
if framework.NodeOSDistroIs("windows") {
|
||||||
// Windows does not typically have a C:\tmp folder.
|
// Windows does not typically have a C:\tmp folder.
|
||||||
@ -225,7 +225,7 @@ var _ = SIGDescribe("Variable Expansion", func() {
|
|||||||
Testname: VolumeSubpathEnvExpansion, subpath ready from failed state
|
Testname: VolumeSubpathEnvExpansion, subpath ready from failed state
|
||||||
Description: Verify that a failing subpath expansion can be modified during the lifecycle of a container.
|
Description: Verify that a failing subpath expansion can be modified during the lifecycle of a container.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should verify that a failing subpath expansion can be modified during the lifecycle of a container [Slow]", func(ctx context.Context) {
|
framework.ConformanceIt("should verify that a failing subpath expansion can be modified during the lifecycle of a container", f.WithSlow(), func(ctx context.Context) {
|
||||||
|
|
||||||
envVars := []v1.EnvVar{
|
envVars := []v1.EnvVar{
|
||||||
{
|
{
|
||||||
@ -297,7 +297,7 @@ var _ = SIGDescribe("Variable Expansion", func() {
|
|||||||
3. successful expansion of the subpathexpr isn't required for volume cleanup
|
3. successful expansion of the subpathexpr isn't required for volume cleanup
|
||||||
|
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should succeed in writing subpaths in container [Slow]", func(ctx context.Context) {
|
framework.ConformanceIt("should succeed in writing subpaths in container", f.WithSlow(), func(ctx context.Context) {
|
||||||
|
|
||||||
envVars := []v1.EnvVar{
|
envVars := []v1.EnvVar{
|
||||||
{
|
{
|
||||||
|
@ -24,13 +24,14 @@ import (
|
|||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/uuid"
|
"k8s.io/apimachinery/pkg/util/uuid"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("ImageCredentialProvider [Feature:KubeletCredentialProviders]", func() {
|
var _ = SIGDescribe("ImageCredentialProvider", feature.KubeletCredentialProviders, func() {
|
||||||
f := framework.NewDefaultFramework("image-credential-provider")
|
f := framework.NewDefaultFramework("image-credential-provider")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
var podClient *e2epod.PodClient
|
var podClient *e2epod.PodClient
|
||||||
|
@ -159,7 +159,7 @@ func initContainersInvariants(pod *v1.Pod) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = SIGDescribe("InitContainer [NodeConformance]", func() {
|
var _ = SIGDescribe("InitContainer", framework.WithNodeConformance(), func() {
|
||||||
f := framework.NewDefaultFramework("init-container")
|
f := framework.NewDefaultFramework("init-container")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
||||||
var podClient *e2epod.PodClient
|
var podClient *e2epod.PodClient
|
||||||
|
@ -48,7 +48,7 @@ var _ = SIGDescribe("Kubelet", func() {
|
|||||||
Testname: Kubelet, log output, default
|
Testname: Kubelet, log output, default
|
||||||
Description: By default the stdout and stderr from the process being executed in a pod MUST be sent to the pod's logs.
|
Description: By default the stdout and stderr from the process being executed in a pod MUST be sent to the pod's logs.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should print the output to logs [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should print the output to logs", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podClient.CreateSync(ctx, &v1.Pod{
|
podClient.CreateSync(ctx, &v1.Pod{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: podName,
|
Name: podName,
|
||||||
@ -106,7 +106,7 @@ var _ = SIGDescribe("Kubelet", func() {
|
|||||||
Testname: Kubelet, failed pod, terminated reason
|
Testname: Kubelet, failed pod, terminated reason
|
||||||
Description: Create a Pod with terminated state. Pod MUST have only one container. Container MUST be in terminated state and MUST have an terminated reason.
|
Description: Create a Pod with terminated state. Pod MUST have only one container. Container MUST be in terminated state and MUST have an terminated reason.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should have an terminated reason [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should have an terminated reason", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
gomega.Eventually(ctx, func() error {
|
gomega.Eventually(ctx, func() error {
|
||||||
podData, err := podClient.Get(ctx, podName, metav1.GetOptions{})
|
podData, err := podClient.Get(ctx, podName, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -131,7 +131,7 @@ var _ = SIGDescribe("Kubelet", func() {
|
|||||||
Testname: Kubelet, failed pod, delete
|
Testname: Kubelet, failed pod, delete
|
||||||
Description: Create a Pod with terminated state. This terminated pod MUST be able to be deleted.
|
Description: Create a Pod with terminated state. This terminated pod MUST be able to be deleted.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be possible to delete [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be possible to delete", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
err := podClient.Delete(ctx, podName, metav1.DeleteOptions{})
|
err := podClient.Delete(ctx, podName, metav1.DeleteOptions{})
|
||||||
framework.ExpectNoError(err, "deleting Pod")
|
framework.ExpectNoError(err, "deleting Pod")
|
||||||
})
|
})
|
||||||
@ -144,7 +144,7 @@ var _ = SIGDescribe("Kubelet", func() {
|
|||||||
Testname: Kubelet, hostAliases
|
Testname: Kubelet, hostAliases
|
||||||
Description: Create a Pod with hostAliases and a container with command to output /etc/hosts entries. Pod's logs MUST have matching entries of specified hostAliases to the output of /etc/hosts entries.
|
Description: Create a Pod with hostAliases and a container with command to output /etc/hosts entries. Pod's logs MUST have matching entries of specified hostAliases to the output of /etc/hosts entries.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should write entries to /etc/hosts [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should write entries to /etc/hosts", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
pod := e2epod.NewAgnhostPod(f.Namespace.Name, podName, nil, nil, nil, "etc-hosts")
|
pod := e2epod.NewAgnhostPod(f.Namespace.Name, podName, nil, nil, nil, "etc-hosts")
|
||||||
// Don't restart the Pod since it is expected to exit
|
// Don't restart the Pod since it is expected to exit
|
||||||
pod.Spec.RestartPolicy = v1.RestartPolicyNever
|
pod.Spec.RestartPolicy = v1.RestartPolicyNever
|
||||||
@ -180,7 +180,7 @@ var _ = SIGDescribe("Kubelet", func() {
|
|||||||
Description: Create a Pod with security context set with ReadOnlyRootFileSystem set to true. The Pod then tries to write to the /file on the root, write operation to the root filesystem MUST fail as expected.
|
Description: Create a Pod with security context set with ReadOnlyRootFileSystem set to true. The Pod then tries to write to the /file on the root, write operation to the root filesystem MUST fail as expected.
|
||||||
This test is marked LinuxOnly since Windows does not support creating containers with read-only access.
|
This test is marked LinuxOnly since Windows does not support creating containers with read-only access.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should not write to root filesystem [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should not write to root filesystem [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
isReadOnly := true
|
isReadOnly := true
|
||||||
podClient.CreateSync(ctx, &v1.Pod{
|
podClient.CreateSync(ctx, &v1.Pod{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
|
@ -61,7 +61,7 @@ var _ = SIGDescribe("KubeletManagedEtcHosts", func() {
|
|||||||
3. The Pod with hostNetwork=true , /etc/hosts file MUST not be managed by the Kubelet.
|
3. The Pod with hostNetwork=true , /etc/hosts file MUST not be managed by the Kubelet.
|
||||||
This test is marked LinuxOnly since Windows cannot mount individual files in Containers.
|
This test is marked LinuxOnly since Windows cannot mount individual files in Containers.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should test kubelet managed /etc/hosts file [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should test kubelet managed /etc/hosts file [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
ginkgo.By("Setting up the test")
|
ginkgo.By("Setting up the test")
|
||||||
config.setup(ctx)
|
config.setup(ctx)
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ import (
|
|||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/intstr"
|
"k8s.io/apimachinery/pkg/util/intstr"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
@ -132,7 +133,7 @@ var _ = SIGDescribe("Container Lifecycle Hook", func() {
|
|||||||
Testname: Pod Lifecycle, post start exec hook
|
Testname: Pod Lifecycle, post start exec hook
|
||||||
Description: When a post start handler is specified in the container lifecycle using a 'Exec' action, then the handler MUST be invoked after the start of the container. A server pod is created that will serve http requests, create a second pod with a container lifecycle specifying a post start that invokes the server pod using ExecAction to validate that the post start is executed.
|
Description: When a post start handler is specified in the container lifecycle using a 'Exec' action, then the handler MUST be invoked after the start of the container. A server pod is created that will serve http requests, create a second pod with a container lifecycle specifying a post start that invokes the server pod using ExecAction to validate that the post start is executed.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should execute poststart exec hook properly [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should execute poststart exec hook properly", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
lifecycle := &v1.Lifecycle{
|
lifecycle := &v1.Lifecycle{
|
||||||
PostStart: &v1.LifecycleHandler{
|
PostStart: &v1.LifecycleHandler{
|
||||||
Exec: &v1.ExecAction{
|
Exec: &v1.ExecAction{
|
||||||
@ -149,7 +150,7 @@ var _ = SIGDescribe("Container Lifecycle Hook", func() {
|
|||||||
Testname: Pod Lifecycle, prestop exec hook
|
Testname: Pod Lifecycle, prestop exec hook
|
||||||
Description: When a pre-stop handler is specified in the container lifecycle using a 'Exec' action, then the handler MUST be invoked before the container is terminated. A server pod is created that will serve http requests, create a second pod with a container lifecycle specifying a pre-stop that invokes the server pod using ExecAction to validate that the pre-stop is executed.
|
Description: When a pre-stop handler is specified in the container lifecycle using a 'Exec' action, then the handler MUST be invoked before the container is terminated. A server pod is created that will serve http requests, create a second pod with a container lifecycle specifying a pre-stop that invokes the server pod using ExecAction to validate that the pre-stop is executed.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should execute prestop exec hook properly [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should execute prestop exec hook properly", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
lifecycle := &v1.Lifecycle{
|
lifecycle := &v1.Lifecycle{
|
||||||
PreStop: &v1.LifecycleHandler{
|
PreStop: &v1.LifecycleHandler{
|
||||||
Exec: &v1.ExecAction{
|
Exec: &v1.ExecAction{
|
||||||
@ -165,7 +166,7 @@ var _ = SIGDescribe("Container Lifecycle Hook", func() {
|
|||||||
Testname: Pod Lifecycle, post start http hook
|
Testname: Pod Lifecycle, post start http hook
|
||||||
Description: When a post start handler is specified in the container lifecycle using a HttpGet action, then the handler MUST be invoked after the start of the container. A server pod is created that will serve http requests, create a second pod on the same node with a container lifecycle specifying a post start that invokes the server pod to validate that the post start is executed.
|
Description: When a post start handler is specified in the container lifecycle using a HttpGet action, then the handler MUST be invoked after the start of the container. A server pod is created that will serve http requests, create a second pod on the same node with a container lifecycle specifying a post start that invokes the server pod to validate that the post start is executed.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should execute poststart http hook properly [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should execute poststart http hook properly", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
lifecycle := &v1.Lifecycle{
|
lifecycle := &v1.Lifecycle{
|
||||||
PostStart: &v1.LifecycleHandler{
|
PostStart: &v1.LifecycleHandler{
|
||||||
HTTPGet: &v1.HTTPGetAction{
|
HTTPGet: &v1.HTTPGetAction{
|
||||||
@ -187,7 +188,7 @@ var _ = SIGDescribe("Container Lifecycle Hook", func() {
|
|||||||
Testname: Pod Lifecycle, poststart https hook
|
Testname: Pod Lifecycle, poststart https hook
|
||||||
Description: When a post-start handler is specified in the container lifecycle using a 'HttpGet' action, then the handler MUST be invoked before the container is terminated. A server pod is created that will serve https requests, create a second pod on the same node with a container lifecycle specifying a post-start that invokes the server pod to validate that the post-start is executed.
|
Description: When a post-start handler is specified in the container lifecycle using a 'HttpGet' action, then the handler MUST be invoked before the container is terminated. A server pod is created that will serve https requests, create a second pod on the same node with a container lifecycle specifying a post-start that invokes the server pod to validate that the post-start is executed.
|
||||||
*/
|
*/
|
||||||
ginkgo.It("should execute poststart https hook properly [MinimumKubeletVersion:1.23] [NodeConformance]", func(ctx context.Context) {
|
f.It("should execute poststart https hook properly [MinimumKubeletVersion:1.23]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
lifecycle := &v1.Lifecycle{
|
lifecycle := &v1.Lifecycle{
|
||||||
PostStart: &v1.LifecycleHandler{
|
PostStart: &v1.LifecycleHandler{
|
||||||
HTTPGet: &v1.HTTPGetAction{
|
HTTPGet: &v1.HTTPGetAction{
|
||||||
@ -210,7 +211,7 @@ var _ = SIGDescribe("Container Lifecycle Hook", func() {
|
|||||||
Testname: Pod Lifecycle, prestop http hook
|
Testname: Pod Lifecycle, prestop http hook
|
||||||
Description: When a pre-stop handler is specified in the container lifecycle using a 'HttpGet' action, then the handler MUST be invoked before the container is terminated. A server pod is created that will serve http requests, create a second pod on the same node with a container lifecycle specifying a pre-stop that invokes the server pod to validate that the pre-stop is executed.
|
Description: When a pre-stop handler is specified in the container lifecycle using a 'HttpGet' action, then the handler MUST be invoked before the container is terminated. A server pod is created that will serve http requests, create a second pod on the same node with a container lifecycle specifying a pre-stop that invokes the server pod to validate that the pre-stop is executed.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should execute prestop http hook properly [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should execute prestop http hook properly", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
lifecycle := &v1.Lifecycle{
|
lifecycle := &v1.Lifecycle{
|
||||||
PreStop: &v1.LifecycleHandler{
|
PreStop: &v1.LifecycleHandler{
|
||||||
HTTPGet: &v1.HTTPGetAction{
|
HTTPGet: &v1.HTTPGetAction{
|
||||||
@ -232,7 +233,7 @@ var _ = SIGDescribe("Container Lifecycle Hook", func() {
|
|||||||
Testname: Pod Lifecycle, prestop https hook
|
Testname: Pod Lifecycle, prestop https hook
|
||||||
Description: When a pre-stop handler is specified in the container lifecycle using a 'HttpGet' action, then the handler MUST be invoked before the container is terminated. A server pod is created that will serve https requests, create a second pod on the same node with a container lifecycle specifying a pre-stop that invokes the server pod to validate that the pre-stop is executed.
|
Description: When a pre-stop handler is specified in the container lifecycle using a 'HttpGet' action, then the handler MUST be invoked before the container is terminated. A server pod is created that will serve https requests, create a second pod on the same node with a container lifecycle specifying a pre-stop that invokes the server pod to validate that the pre-stop is executed.
|
||||||
*/
|
*/
|
||||||
ginkgo.It("should execute prestop https hook properly [MinimumKubeletVersion:1.23] [NodeConformance]", func(ctx context.Context) {
|
f.It("should execute prestop https hook properly [MinimumKubeletVersion:1.23]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
lifecycle := &v1.Lifecycle{
|
lifecycle := &v1.Lifecycle{
|
||||||
PreStop: &v1.LifecycleHandler{
|
PreStop: &v1.LifecycleHandler{
|
||||||
HTTPGet: &v1.HTTPGetAction{
|
HTTPGet: &v1.HTTPGetAction{
|
||||||
@ -253,7 +254,7 @@ var _ = SIGDescribe("Container Lifecycle Hook", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
var _ = SIGDescribe("[NodeAlphaFeature:SidecarContainers][Feature:SidecarContainers] Restartable Init Container Lifecycle Hook", func() {
|
var _ = SIGDescribe("[NodeAlphaFeature:SidecarContainers]", feature.SidecarContainers, "Restartable Init Container Lifecycle Hook", func() {
|
||||||
f := framework.NewDefaultFramework("restartable-init-container-lifecycle-hook")
|
f := framework.NewDefaultFramework("restartable-init-container-lifecycle-hook")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
||||||
var podClient *e2epod.PodClient
|
var podClient *e2epod.PodClient
|
||||||
@ -545,7 +546,7 @@ func getSidecarPodWithHook(name string, image string, lifecycle *v1.Lifecycle) *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = SIGDescribe("[Feature:PodLifecycleSleepAction]", func() {
|
var _ = SIGDescribe(feature.PodLifecycleSleepAction, func() {
|
||||||
f := framework.NewDefaultFramework("pod-lifecycle-sleep-action")
|
f := framework.NewDefaultFramework("pod-lifecycle-sleep-action")
|
||||||
f.NamespacePodSecurityEnforceLevel = admissionapi.LevelBaseline
|
f.NamespacePodSecurityEnforceLevel = admissionapi.LevelBaseline
|
||||||
var podClient *e2epod.PodClient
|
var podClient *e2epod.PodClient
|
||||||
|
@ -32,7 +32,7 @@ import (
|
|||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("PodOSRejection [NodeConformance]", func() {
|
var _ = SIGDescribe("PodOSRejection", framework.WithNodeConformance(), func() {
|
||||||
f := framework.NewDefaultFramework("pod-os-rejection")
|
f := framework.NewDefaultFramework("pod-os-rejection")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
||||||
ginkgo.Context("Kubelet", func() {
|
ginkgo.Context("Kubelet", func() {
|
||||||
|
@ -202,7 +202,7 @@ var _ = SIGDescribe("Pods", func() {
|
|||||||
Testname: Pods, assigned hostip
|
Testname: Pods, assigned hostip
|
||||||
Description: Create a Pod. Pod status MUST return successfully and contains a valid IP address.
|
Description: Create a Pod. Pod status MUST return successfully and contains a valid IP address.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should get a host IP [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should get a host IP", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
name := "pod-hostip-" + string(uuid.NewUUID())
|
name := "pod-hostip-" + string(uuid.NewUUID())
|
||||||
testHostIP(ctx, podClient, e2epod.MustMixinRestrictedPodSecurity(&v1.Pod{
|
testHostIP(ctx, podClient, e2epod.MustMixinRestrictedPodSecurity(&v1.Pod{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -224,7 +224,7 @@ var _ = SIGDescribe("Pods", func() {
|
|||||||
Testname: Pods, lifecycle
|
Testname: Pods, lifecycle
|
||||||
Description: A Pod is created with a unique label. Pod MUST be accessible when queried using the label selector upon creation. Add a watch, check if the Pod is running. Pod then deleted, The pod deletion timestamp is observed. The watch MUST return the pod deleted event. Query with the original selector for the Pod MUST return empty list.
|
Description: A Pod is created with a unique label. Pod MUST be accessible when queried using the label selector upon creation. Add a watch, check if the Pod is running. Pod then deleted, The pod deletion timestamp is observed. The watch MUST return the pod deleted event. Query with the original selector for the Pod MUST return empty list.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be submitted and removed [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be submitted and removed", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
ginkgo.By("creating the pod")
|
ginkgo.By("creating the pod")
|
||||||
name := "pod-submit-remove-" + string(uuid.NewUUID())
|
name := "pod-submit-remove-" + string(uuid.NewUUID())
|
||||||
value := strconv.Itoa(time.Now().Nanosecond())
|
value := strconv.Itoa(time.Now().Nanosecond())
|
||||||
@ -342,7 +342,7 @@ var _ = SIGDescribe("Pods", func() {
|
|||||||
Testname: Pods, update
|
Testname: Pods, update
|
||||||
Description: Create a Pod with a unique label. Query for the Pod with the label as selector MUST be successful. Update the pod to change the value of the Label. Query for the Pod with the new value for the label MUST be successful.
|
Description: Create a Pod with a unique label. Query for the Pod with the label as selector MUST be successful. Update the pod to change the value of the Label. Query for the Pod with the new value for the label MUST be successful.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be updated [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be updated", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
ginkgo.By("creating the pod")
|
ginkgo.By("creating the pod")
|
||||||
name := "pod-update-" + string(uuid.NewUUID())
|
name := "pod-update-" + string(uuid.NewUUID())
|
||||||
value := strconv.Itoa(time.Now().Nanosecond())
|
value := strconv.Itoa(time.Now().Nanosecond())
|
||||||
@ -396,7 +396,7 @@ var _ = SIGDescribe("Pods", func() {
|
|||||||
Testname: Pods, ActiveDeadlineSeconds
|
Testname: Pods, ActiveDeadlineSeconds
|
||||||
Description: Create a Pod with a unique label. Query for the Pod with the label as selector MUST be successful. The Pod is updated with ActiveDeadlineSeconds set on the Pod spec. Pod MUST terminate of the specified time elapses.
|
Description: Create a Pod with a unique label. Query for the Pod with the label as selector MUST be successful. The Pod is updated with ActiveDeadlineSeconds set on the Pod spec. Pod MUST terminate of the specified time elapses.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should allow activeDeadlineSeconds to be updated [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should allow activeDeadlineSeconds to be updated", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
ginkgo.By("creating the pod")
|
ginkgo.By("creating the pod")
|
||||||
name := "pod-update-activedeadlineseconds-" + string(uuid.NewUUID())
|
name := "pod-update-activedeadlineseconds-" + string(uuid.NewUUID())
|
||||||
value := strconv.Itoa(time.Now().Nanosecond())
|
value := strconv.Itoa(time.Now().Nanosecond())
|
||||||
@ -442,7 +442,7 @@ var _ = SIGDescribe("Pods", func() {
|
|||||||
Testname: Pods, service environment variables
|
Testname: Pods, service environment variables
|
||||||
Description: Create a server Pod listening on port 9376. A Service called fooservice is created for the server Pod listening on port 8765 targeting port 8080. If a new Pod is created in the cluster then the Pod MUST have the fooservice environment variables available from this new Pod. The new create Pod MUST have environment variables such as FOOSERVICE_SERVICE_HOST, FOOSERVICE_SERVICE_PORT, FOOSERVICE_PORT, FOOSERVICE_PORT_8765_TCP_PORT, FOOSERVICE_PORT_8765_TCP_PROTO, FOOSERVICE_PORT_8765_TCP and FOOSERVICE_PORT_8765_TCP_ADDR that are populated with proper values.
|
Description: Create a server Pod listening on port 9376. A Service called fooservice is created for the server Pod listening on port 8765 targeting port 8080. If a new Pod is created in the cluster then the Pod MUST have the fooservice environment variables available from this new Pod. The new create Pod MUST have environment variables such as FOOSERVICE_SERVICE_HOST, FOOSERVICE_SERVICE_PORT, FOOSERVICE_PORT, FOOSERVICE_PORT_8765_TCP_PORT, FOOSERVICE_PORT_8765_TCP_PROTO, FOOSERVICE_PORT_8765_TCP and FOOSERVICE_PORT_8765_TCP_ADDR that are populated with proper values.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should contain environment variables for services [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should contain environment variables for services", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
// Make a pod that will be a service.
|
// Make a pod that will be a service.
|
||||||
// This pod serves its hostname via HTTP.
|
// This pod serves its hostname via HTTP.
|
||||||
serverName := "server-envvars-" + string(uuid.NewUUID())
|
serverName := "server-envvars-" + string(uuid.NewUUID())
|
||||||
@ -534,7 +534,7 @@ var _ = SIGDescribe("Pods", func() {
|
|||||||
Description: A Pod is created. Websocket is created to retrieve exec command output from this pod.
|
Description: A Pod is created. Websocket is created to retrieve exec command output from this pod.
|
||||||
Message retrieved form Websocket MUST match with expected exec command output.
|
Message retrieved form Websocket MUST match with expected exec command output.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should support remote command execution over websockets [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should support remote command execution over websockets", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
config, err := framework.LoadConfig()
|
config, err := framework.LoadConfig()
|
||||||
framework.ExpectNoError(err, "unable to get base config")
|
framework.ExpectNoError(err, "unable to get base config")
|
||||||
|
|
||||||
@ -616,7 +616,7 @@ var _ = SIGDescribe("Pods", func() {
|
|||||||
Description: A Pod is created. Websocket is created to retrieve log of a container from this pod.
|
Description: A Pod is created. Websocket is created to retrieve log of a container from this pod.
|
||||||
Message retrieved form Websocket MUST match with container's output.
|
Message retrieved form Websocket MUST match with container's output.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should support retrieving logs from the container over websockets [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should support retrieving logs from the container over websockets", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
config, err := framework.LoadConfig()
|
config, err := framework.LoadConfig()
|
||||||
framework.ExpectNoError(err, "unable to get base config")
|
framework.ExpectNoError(err, "unable to get base config")
|
||||||
|
|
||||||
@ -674,7 +674,7 @@ var _ = SIGDescribe("Pods", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Slow (~7 mins)
|
// Slow (~7 mins)
|
||||||
ginkgo.It("should have their auto-restart back-off timer reset on image update [Slow][NodeConformance]", func(ctx context.Context) {
|
f.It("should have their auto-restart back-off timer reset on image update", f.WithSlow(), f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "pod-back-off-image"
|
podName := "pod-back-off-image"
|
||||||
containerName := "back-off"
|
containerName := "back-off"
|
||||||
pod := e2epod.MustMixinRestrictedPodSecurity(&v1.Pod{
|
pod := e2epod.MustMixinRestrictedPodSecurity(&v1.Pod{
|
||||||
@ -715,7 +715,7 @@ var _ = SIGDescribe("Pods", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Slow by design (~27 mins) issue #19027
|
// Slow by design (~27 mins) issue #19027
|
||||||
ginkgo.It("should cap back-off at MaxContainerBackOff [Slow][NodeConformance]", func(ctx context.Context) {
|
f.It("should cap back-off at MaxContainerBackOff", f.WithSlow(), f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "back-off-cap"
|
podName := "back-off-cap"
|
||||||
containerName := "back-off-cap"
|
containerName := "back-off-cap"
|
||||||
pod := e2epod.MustMixinRestrictedPodSecurity(&v1.Pod{
|
pod := e2epod.MustMixinRestrictedPodSecurity(&v1.Pod{
|
||||||
@ -769,7 +769,7 @@ var _ = SIGDescribe("Pods", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should support pod readiness gates [NodeConformance]", func(ctx context.Context) {
|
f.It("should support pod readiness gates", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "pod-ready"
|
podName := "pod-ready"
|
||||||
readinessGate1 := "k8s.io/test-condition1"
|
readinessGate1 := "k8s.io/test-condition1"
|
||||||
readinessGate2 := "k8s.io/test-condition2"
|
readinessGate2 := "k8s.io/test-condition2"
|
||||||
|
@ -42,7 +42,7 @@ type PrivilegedPodTestConfig struct {
|
|||||||
pod *v1.Pod
|
pod *v1.Pod
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = SIGDescribe("PrivilegedPod [NodeConformance]", func() {
|
var _ = SIGDescribe("PrivilegedPod", framework.WithNodeConformance(), func() {
|
||||||
f := framework.NewDefaultFramework("e2e-privileged-pod")
|
f := framework.NewDefaultFramework("e2e-privileged-pod")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
config := &PrivilegedPodTestConfig{
|
config := &PrivilegedPodTestConfig{
|
||||||
|
@ -49,7 +49,7 @@ var _ = SIGDescribe("Container Runtime", func() {
|
|||||||
Testname: Container Runtime, Restart Policy, Pod Phases
|
Testname: Container Runtime, Restart Policy, Pod Phases
|
||||||
Description: If the restart policy is set to 'Always', Pod MUST be restarted when terminated, If restart policy is 'OnFailure', Pod MUST be started only if it is terminated with non-zero exit code. If the restart policy is 'Never', Pod MUST never be restarted. All these three test cases MUST verify the restart counts accordingly.
|
Description: If the restart policy is set to 'Always', Pod MUST be restarted when terminated, If restart policy is 'OnFailure', Pod MUST be started only if it is terminated with non-zero exit code. If the restart policy is 'Never', Pod MUST never be restarted. All these three test cases MUST verify the restart counts accordingly.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should run with the expected status [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should run with the expected status", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
restartCountVolumeName := "restart-count"
|
restartCountVolumeName := "restart-count"
|
||||||
restartCountVolumePath := "/restart-count"
|
restartCountVolumePath := "/restart-count"
|
||||||
testContainer := v1.Container{
|
testContainer := v1.Container{
|
||||||
@ -127,7 +127,7 @@ while true; do sleep 1; done
|
|||||||
ginkgo.By(fmt.Sprintf("Container '%s': should get the expected 'State'", testContainer.Name))
|
ginkgo.By(fmt.Sprintf("Container '%s': should get the expected 'State'", testContainer.Name))
|
||||||
gomega.Expect(GetContainerState(status.State)).To(gomega.Equal(testCase.State))
|
gomega.Expect(GetContainerState(status.State)).To(gomega.Equal(testCase.State))
|
||||||
|
|
||||||
ginkgo.By(fmt.Sprintf("Container '%s': should be possible to delete [NodeConformance]", testContainer.Name))
|
ginkgo.By(fmt.Sprintf("Container '%s': should be possible to delete", testContainer.Name))
|
||||||
gomega.Expect(terminateContainer.Delete(ctx)).To(gomega.Succeed())
|
gomega.Expect(terminateContainer.Delete(ctx)).To(gomega.Succeed())
|
||||||
gomega.Eventually(ctx, terminateContainer.Present, ContainerStatusRetryTimeout, ContainerStatusPollInterval).Should(gomega.BeFalse())
|
gomega.Eventually(ctx, terminateContainer.Present, ContainerStatusRetryTimeout, ContainerStatusPollInterval).Should(gomega.BeFalse())
|
||||||
}
|
}
|
||||||
@ -171,7 +171,7 @@ while true; do sleep 1; done
|
|||||||
gomega.Expect(c.Delete(ctx)).To(gomega.Succeed())
|
gomega.Expect(c.Delete(ctx)).To(gomega.Succeed())
|
||||||
}
|
}
|
||||||
|
|
||||||
ginkgo.It("should report termination message if TerminationMessagePath is set [NodeConformance]", func(ctx context.Context) {
|
f.It("should report termination message if TerminationMessagePath is set", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
container := v1.Container{
|
container := v1.Container{
|
||||||
Image: framework.BusyBoxImage,
|
Image: framework.BusyBoxImage,
|
||||||
Command: []string{"/bin/sh", "-c"},
|
Command: []string{"/bin/sh", "-c"},
|
||||||
@ -192,7 +192,7 @@ while true; do sleep 1; done
|
|||||||
Testname: Container Runtime, TerminationMessagePath, non-root user and non-default path
|
Testname: Container Runtime, TerminationMessagePath, non-root user and non-default path
|
||||||
Description: Create a pod with a container to run it as a non-root user with a custom TerminationMessagePath set. Pod redirects the output to the provided path successfully. When the container is terminated, the termination message MUST match the expected output logged in the provided custom path.
|
Description: Create a pod with a container to run it as a non-root user with a custom TerminationMessagePath set. Pod redirects the output to the provided path successfully. When the container is terminated, the termination message MUST match the expected output logged in the provided custom path.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should report termination message if TerminationMessagePath is set as non-root user and at a non-default path [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should report termination message if TerminationMessagePath is set as non-root user and at a non-default path", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
container := v1.Container{
|
container := v1.Container{
|
||||||
Image: framework.BusyBoxImage,
|
Image: framework.BusyBoxImage,
|
||||||
Command: []string{"/bin/sh", "-c"},
|
Command: []string{"/bin/sh", "-c"},
|
||||||
@ -213,7 +213,7 @@ while true; do sleep 1; done
|
|||||||
Testname: Container Runtime, TerminationMessage, from container's log output of failing container
|
Testname: Container Runtime, TerminationMessage, from container's log output of failing container
|
||||||
Description: Create a pod with an container. Container's output is recorded in log and container exits with an error. When container is terminated, termination message MUST match the expected output recorded from container's log.
|
Description: Create a pod with an container. Container's output is recorded in log and container exits with an error. When container is terminated, termination message MUST match the expected output recorded from container's log.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should report termination message from log output if TerminationMessagePolicy FallbackToLogsOnError is set [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should report termination message from log output if TerminationMessagePolicy FallbackToLogsOnError is set", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
container := v1.Container{
|
container := v1.Container{
|
||||||
Image: framework.BusyBoxImage,
|
Image: framework.BusyBoxImage,
|
||||||
Command: []string{"/bin/sh", "-c"},
|
Command: []string{"/bin/sh", "-c"},
|
||||||
@ -229,7 +229,7 @@ while true; do sleep 1; done
|
|||||||
Testname: Container Runtime, TerminationMessage, from log output of succeeding container
|
Testname: Container Runtime, TerminationMessage, from log output of succeeding container
|
||||||
Description: Create a pod with an container. Container's output is recorded in log and container exits successfully without an error. When container is terminated, terminationMessage MUST have no content as container succeed.
|
Description: Create a pod with an container. Container's output is recorded in log and container exits successfully without an error. When container is terminated, terminationMessage MUST have no content as container succeed.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should report termination message as empty when pod succeeds and TerminationMessagePolicy FallbackToLogsOnError is set [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should report termination message as empty when pod succeeds and TerminationMessagePolicy FallbackToLogsOnError is set", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
container := v1.Container{
|
container := v1.Container{
|
||||||
Image: framework.BusyBoxImage,
|
Image: framework.BusyBoxImage,
|
||||||
Command: []string{"/bin/sh", "-c"},
|
Command: []string{"/bin/sh", "-c"},
|
||||||
@ -245,7 +245,7 @@ while true; do sleep 1; done
|
|||||||
Testname: Container Runtime, TerminationMessage, from file of succeeding container
|
Testname: Container Runtime, TerminationMessage, from file of succeeding container
|
||||||
Description: Create a pod with an container. Container's output is recorded in a file and the container exits successfully without an error. When container is terminated, terminationMessage MUST match with the content from file.
|
Description: Create a pod with an container. Container's output is recorded in a file and the container exits successfully without an error. When container is terminated, terminationMessage MUST match with the content from file.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should report termination message from file when pod succeeds and TerminationMessagePolicy FallbackToLogsOnError is set [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should report termination message from file when pod succeeds and TerminationMessagePolicy FallbackToLogsOnError is set", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
container := v1.Container{
|
container := v1.Container{
|
||||||
Image: framework.BusyBoxImage,
|
Image: framework.BusyBoxImage,
|
||||||
Command: []string{"/bin/sh", "-c"},
|
Command: []string{"/bin/sh", "-c"},
|
||||||
@ -368,23 +368,23 @@ while true; do sleep 1; done
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ginkgo.It("should not be able to pull image from invalid registry [NodeConformance]", func(ctx context.Context) {
|
f.It("should not be able to pull image from invalid registry", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
image := imageutils.GetE2EImage(imageutils.InvalidRegistryImage)
|
image := imageutils.GetE2EImage(imageutils.InvalidRegistryImage)
|
||||||
imagePullTest(ctx, image, false, v1.PodPending, true, false)
|
imagePullTest(ctx, image, false, v1.PodPending, true, false)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should be able to pull image [NodeConformance]", func(ctx context.Context) {
|
f.It("should be able to pull image", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
// NOTE(claudiub): The agnhost image is supposed to work on both Linux and Windows.
|
// NOTE(claudiub): The agnhost image is supposed to work on both Linux and Windows.
|
||||||
image := imageutils.GetE2EImage(imageutils.Agnhost)
|
image := imageutils.GetE2EImage(imageutils.Agnhost)
|
||||||
imagePullTest(ctx, image, false, v1.PodRunning, false, false)
|
imagePullTest(ctx, image, false, v1.PodRunning, false, false)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should not be able to pull from private registry without secret [NodeConformance]", func(ctx context.Context) {
|
f.It("should not be able to pull from private registry without secret", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
image := imageutils.GetE2EImage(imageutils.AuthenticatedAlpine)
|
image := imageutils.GetE2EImage(imageutils.AuthenticatedAlpine)
|
||||||
imagePullTest(ctx, image, false, v1.PodPending, true, false)
|
imagePullTest(ctx, image, false, v1.PodPending, true, false)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should be able to pull from private registry with secret [NodeConformance]", func(ctx context.Context) {
|
f.It("should be able to pull from private registry with secret", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
image := imageutils.GetE2EImage(imageutils.AuthenticatedAlpine)
|
image := imageutils.GetE2EImage(imageutils.AuthenticatedAlpine)
|
||||||
isWindows := false
|
isWindows := false
|
||||||
if framework.NodeOSDistroIs("windows") {
|
if framework.NodeOSDistroIs("windows") {
|
||||||
|
@ -38,6 +38,7 @@ import (
|
|||||||
e2eruntimeclass "k8s.io/kubernetes/test/e2e/framework/node/runtimeclass"
|
e2eruntimeclass "k8s.io/kubernetes/test/e2e/framework/node/runtimeclass"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
|
"k8s.io/kubernetes/test/e2e/nodefeature"
|
||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
|
|
||||||
"github.com/onsi/ginkgo/v2"
|
"github.com/onsi/ginkgo/v2"
|
||||||
@ -53,13 +54,13 @@ var _ = SIGDescribe("RuntimeClass", func() {
|
|||||||
Testname: Pod with the non-existing RuntimeClass is rejected.
|
Testname: Pod with the non-existing RuntimeClass is rejected.
|
||||||
Description: The Pod requesting the non-existing RuntimeClass must be rejected.
|
Description: The Pod requesting the non-existing RuntimeClass must be rejected.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should reject a Pod requesting a non-existent RuntimeClass [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should reject a Pod requesting a non-existent RuntimeClass", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
rcName := f.Namespace.Name + "-nonexistent"
|
rcName := f.Namespace.Name + "-nonexistent"
|
||||||
expectPodRejection(ctx, f, e2eruntimeclass.NewRuntimeClassPod(rcName))
|
expectPodRejection(ctx, f, e2eruntimeclass.NewRuntimeClassPod(rcName))
|
||||||
})
|
})
|
||||||
|
|
||||||
// The test CANNOT be made a Conformance as it depends on a container runtime to have a specific handler not being installed.
|
// The test CANNOT be made a Conformance as it depends on a container runtime to have a specific handler not being installed.
|
||||||
ginkgo.It("should reject a Pod requesting a RuntimeClass with an unconfigured handler [NodeFeature:RuntimeHandler]", func(ctx context.Context) {
|
f.It("should reject a Pod requesting a RuntimeClass with an unconfigured handler", nodefeature.RuntimeHandler, func(ctx context.Context) {
|
||||||
handler := f.Namespace.Name + "-handler"
|
handler := f.Namespace.Name + "-handler"
|
||||||
rcName := createRuntimeClass(ctx, f, "unconfigured-handler", handler, nil)
|
rcName := createRuntimeClass(ctx, f, "unconfigured-handler", handler, nil)
|
||||||
ginkgo.DeferCleanup(deleteRuntimeClass, f, rcName)
|
ginkgo.DeferCleanup(deleteRuntimeClass, f, rcName)
|
||||||
@ -83,7 +84,7 @@ var _ = SIGDescribe("RuntimeClass", func() {
|
|||||||
|
|
||||||
// This test requires that the PreconfiguredRuntimeClassHandler has already been set up on nodes.
|
// This test requires that the PreconfiguredRuntimeClassHandler has already been set up on nodes.
|
||||||
// The test CANNOT be made a Conformance as it depends on a container runtime to have a specific handler installed and working.
|
// The test CANNOT be made a Conformance as it depends on a container runtime to have a specific handler installed and working.
|
||||||
ginkgo.It("should run a Pod requesting a RuntimeClass with a configured handler [NodeFeature:RuntimeHandler]", func(ctx context.Context) {
|
f.It("should run a Pod requesting a RuntimeClass with a configured handler", nodefeature.RuntimeHandler, func(ctx context.Context) {
|
||||||
if err := e2eruntimeclass.NodeSupportsPreconfiguredRuntimeClassHandler(ctx, f); err != nil {
|
if err := e2eruntimeclass.NodeSupportsPreconfiguredRuntimeClassHandler(ctx, f); err != nil {
|
||||||
e2eskipper.Skipf("Skipping test as node does not have E2E runtime class handler preconfigured in container runtime config: %v", err)
|
e2eskipper.Skipf("Skipping test as node does not have E2E runtime class handler preconfigured in container runtime config: %v", err)
|
||||||
}
|
}
|
||||||
@ -102,7 +103,7 @@ var _ = SIGDescribe("RuntimeClass", func() {
|
|||||||
depends on container runtime and preconfigured handler. Runtime-specific functionality
|
depends on container runtime and preconfigured handler. Runtime-specific functionality
|
||||||
is not being tested here.
|
is not being tested here.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should schedule a Pod requesting a RuntimeClass without PodOverhead [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should schedule a Pod requesting a RuntimeClass without PodOverhead", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
rcName := createRuntimeClass(ctx, f, "preconfigured-handler", e2eruntimeclass.PreconfiguredRuntimeClassHandler, nil)
|
rcName := createRuntimeClass(ctx, f, "preconfigured-handler", e2eruntimeclass.PreconfiguredRuntimeClassHandler, nil)
|
||||||
ginkgo.DeferCleanup(deleteRuntimeClass, f, rcName)
|
ginkgo.DeferCleanup(deleteRuntimeClass, f, rcName)
|
||||||
pod := e2epod.NewPodClient(f).Create(ctx, e2eruntimeclass.NewRuntimeClassPod(rcName))
|
pod := e2epod.NewPodClient(f).Create(ctx, e2eruntimeclass.NewRuntimeClassPod(rcName))
|
||||||
@ -127,7 +128,7 @@ var _ = SIGDescribe("RuntimeClass", func() {
|
|||||||
depends on container runtime and preconfigured handler. Runtime-specific functionality
|
depends on container runtime and preconfigured handler. Runtime-specific functionality
|
||||||
is not being tested here.
|
is not being tested here.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should schedule a Pod requesting a RuntimeClass and initialize its Overhead [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should schedule a Pod requesting a RuntimeClass and initialize its Overhead", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
rcName := createRuntimeClass(ctx, f, "preconfigured-handler", e2eruntimeclass.PreconfiguredRuntimeClassHandler, &nodev1.Overhead{
|
rcName := createRuntimeClass(ctx, f, "preconfigured-handler", e2eruntimeclass.PreconfiguredRuntimeClassHandler, &nodev1.Overhead{
|
||||||
PodFixed: v1.ResourceList{
|
PodFixed: v1.ResourceList{
|
||||||
v1.ResourceName(v1.ResourceCPU): resource.MustParse("10m"),
|
v1.ResourceName(v1.ResourceCPU): resource.MustParse("10m"),
|
||||||
@ -154,7 +155,7 @@ var _ = SIGDescribe("RuntimeClass", func() {
|
|||||||
Testname: Pod with the deleted RuntimeClass is rejected.
|
Testname: Pod with the deleted RuntimeClass is rejected.
|
||||||
Description: Pod requesting the deleted RuntimeClass must be rejected.
|
Description: Pod requesting the deleted RuntimeClass must be rejected.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should reject a Pod requesting a deleted RuntimeClass [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should reject a Pod requesting a deleted RuntimeClass", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
rcName := createRuntimeClass(ctx, f, "delete-me", "runc", nil)
|
rcName := createRuntimeClass(ctx, f, "delete-me", "runc", nil)
|
||||||
rcClient := f.ClientSet.NodeV1().RuntimeClasses()
|
rcClient := f.ClientSet.NodeV1().RuntimeClasses()
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ var _ = SIGDescribe("Secrets", func() {
|
|||||||
Testname: Secrets, pod environment field
|
Testname: Secrets, pod environment field
|
||||||
Description: Create a secret. Create a Pod with Container that declares a environment variable which references the secret created to extract a key value from the secret. Pod MUST have the environment variable that contains proper value for the key to the secret.
|
Description: Create a secret. Create a Pod with Container that declares a environment variable which references the secret created to extract a key value from the secret. Pod MUST have the environment variable that contains proper value for the key to the secret.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in env vars [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in env vars", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
name := "secret-test-" + string(uuid.NewUUID())
|
name := "secret-test-" + string(uuid.NewUUID())
|
||||||
secret := secretForTest(f.Namespace.Name, name)
|
secret := secretForTest(f.Namespace.Name, name)
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ var _ = SIGDescribe("Secrets", func() {
|
|||||||
Testname: Secrets, pod environment from source
|
Testname: Secrets, pod environment from source
|
||||||
Description: Create a secret. Create a Pod with Container that declares a environment variable using 'EnvFrom' which references the secret created to extract a key value from the secret. Pod MUST have the environment variable that contains proper value for the key to the secret.
|
Description: Create a secret. Create a Pod with Container that declares a environment variable using 'EnvFrom' which references the secret created to extract a key value from the secret. Pod MUST have the environment variable that contains proper value for the key to the secret.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable via the environment [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable via the environment", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
name := "secret-test-" + string(uuid.NewUUID())
|
name := "secret-test-" + string(uuid.NewUUID())
|
||||||
secret := secretForTest(f.Namespace.Name, name)
|
secret := secretForTest(f.Namespace.Name, name)
|
||||||
ginkgo.By(fmt.Sprintf("creating secret %v/%v", f.Namespace.Name, secret.Name))
|
ginkgo.By(fmt.Sprintf("creating secret %v/%v", f.Namespace.Name, secret.Name))
|
||||||
|
@ -26,10 +26,12 @@ import (
|
|||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/uuid"
|
"k8s.io/apimachinery/pkg/util/uuid"
|
||||||
"k8s.io/kubernetes/pkg/kubelet/events"
|
"k8s.io/kubernetes/pkg/kubelet/events"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
|
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
|
"k8s.io/kubernetes/test/e2e/nodefeature"
|
||||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
"k8s.io/utils/pointer"
|
"k8s.io/utils/pointer"
|
||||||
@ -72,7 +74,7 @@ var _ = SIGDescribe("Security Context", func() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ginkgo.It("must create the user namespace if set to false [LinuxOnly] [Feature:UserNamespacesSupport]", func(ctx context.Context) {
|
f.It("must create the user namespace if set to false [LinuxOnly]", feature.UserNamespacesSupport, func(ctx context.Context) {
|
||||||
// with hostUsers=false the pod must use a new user namespace
|
// with hostUsers=false the pod must use a new user namespace
|
||||||
podClient := e2epod.PodClientNS(f, f.Namespace.Name)
|
podClient := e2epod.PodClientNS(f, f.Namespace.Name)
|
||||||
|
|
||||||
@ -110,7 +112,7 @@ var _ = SIGDescribe("Security Context", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("must not create the user namespace if set to true [LinuxOnly] [Feature:UserNamespacesSupport]", func(ctx context.Context) {
|
f.It("must not create the user namespace if set to true [LinuxOnly]", feature.UserNamespacesSupport, func(ctx context.Context) {
|
||||||
// with hostUsers=true the pod must use the host user namespace
|
// with hostUsers=true the pod must use the host user namespace
|
||||||
pod := makePod(true)
|
pod := makePod(true)
|
||||||
// When running in the host's user namespace, the /proc/self/uid_map file content looks like:
|
// When running in the host's user namespace, the /proc/self/uid_map file content looks like:
|
||||||
@ -121,7 +123,7 @@ var _ = SIGDescribe("Security Context", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should mount all volumes with proper permissions with hostUsers=false [LinuxOnly] [Feature:UserNamespacesSupport]", func(ctx context.Context) {
|
f.It("should mount all volumes with proper permissions with hostUsers=false [LinuxOnly]", feature.UserNamespacesSupport, func(ctx context.Context) {
|
||||||
// Create all volume types supported: configmap, secret, downwardAPI, projected.
|
// Create all volume types supported: configmap, secret, downwardAPI, projected.
|
||||||
|
|
||||||
// Create configmap.
|
// Create configmap.
|
||||||
@ -245,7 +247,7 @@ var _ = SIGDescribe("Security Context", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should set FSGroup to user inside the container with hostUsers=false [LinuxOnly] [Feature:UserNamespacesSupport]", func(ctx context.Context) {
|
f.It("should set FSGroup to user inside the container with hostUsers=false [LinuxOnly]", feature.UserNamespacesSupport, func(ctx context.Context) {
|
||||||
// Create configmap.
|
// Create configmap.
|
||||||
name := "userns-volumes-test-" + string(uuid.NewUUID())
|
name := "userns-volumes-test-" + string(uuid.NewUUID())
|
||||||
configMap := newConfigMap(f, name)
|
configMap := newConfigMap(f, name)
|
||||||
@ -344,7 +346,7 @@ var _ = SIGDescribe("Security Context", func() {
|
|||||||
Description: Container is created with runAsUser option by passing uid 65534 to run as unpriviledged user. Pod MUST be in Succeeded phase.
|
Description: Container is created with runAsUser option by passing uid 65534 to run as unpriviledged user. Pod MUST be in Succeeded phase.
|
||||||
[LinuxOnly]: This test is marked as LinuxOnly since Windows does not support running as UID / GID.
|
[LinuxOnly]: This test is marked as LinuxOnly since Windows does not support running as UID / GID.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should run the container with uid 65534 [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should run the container with uid 65534 [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
createAndWaitUserPod(ctx, 65534)
|
createAndWaitUserPod(ctx, 65534)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -355,7 +357,7 @@ var _ = SIGDescribe("Security Context", func() {
|
|||||||
This e2e can not be promoted to Conformance because a Conformant platform may not allow to run containers with 'uid 0' or running privileged operations.
|
This e2e can not be promoted to Conformance because a Conformant platform may not allow to run containers with 'uid 0' or running privileged operations.
|
||||||
[LinuxOnly]: This test is marked as LinuxOnly since Windows does not support running as UID / GID.
|
[LinuxOnly]: This test is marked as LinuxOnly since Windows does not support running as UID / GID.
|
||||||
*/
|
*/
|
||||||
ginkgo.It("should run the container with uid 0 [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
f.It("should run the container with uid 0 [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
createAndWaitUserPod(ctx, 0)
|
createAndWaitUserPod(ctx, 0)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -473,7 +475,7 @@ var _ = SIGDescribe("Security Context", func() {
|
|||||||
At this moment we are not considering this test for Conformance due to use of SecurityContext.
|
At this moment we are not considering this test for Conformance due to use of SecurityContext.
|
||||||
[LinuxOnly]: This test is marked as LinuxOnly since Windows does not support creating containers with read-only access.
|
[LinuxOnly]: This test is marked as LinuxOnly since Windows does not support creating containers with read-only access.
|
||||||
*/
|
*/
|
||||||
ginkgo.It("should run the container with readonly rootfs when readOnlyRootFilesystem=true [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
f.It("should run the container with readonly rootfs when readOnlyRootFilesystem=true [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
createAndWaitUserPod(ctx, true)
|
createAndWaitUserPod(ctx, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -483,7 +485,7 @@ var _ = SIGDescribe("Security Context", func() {
|
|||||||
Description: Container is configured to run with readOnlyRootFilesystem to false.
|
Description: Container is configured to run with readOnlyRootFilesystem to false.
|
||||||
Write operation MUST be allowed and Pod MUST be in Succeeded state.
|
Write operation MUST be allowed and Pod MUST be in Succeeded state.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should run the container with writable rootfs when readOnlyRootFilesystem=false [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should run the container with writable rootfs when readOnlyRootFilesystem=false", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
createAndWaitUserPod(ctx, false)
|
createAndWaitUserPod(ctx, false)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -525,7 +527,7 @@ var _ = SIGDescribe("Security Context", func() {
|
|||||||
Description: Create a container to run in unprivileged mode by setting pod's SecurityContext Privileged option as false. Pod MUST be in Succeeded phase.
|
Description: Create a container to run in unprivileged mode by setting pod's SecurityContext Privileged option as false. Pod MUST be in Succeeded phase.
|
||||||
[LinuxOnly]: This test is marked as LinuxOnly since it runs a Linux-specific command.
|
[LinuxOnly]: This test is marked as LinuxOnly since it runs a Linux-specific command.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should run the container as unprivileged when false [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should run the container as unprivileged when false [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := createAndWaitUserPod(ctx, false)
|
podName := createAndWaitUserPod(ctx, false)
|
||||||
logs, err := e2epod.GetPodLogs(ctx, f.ClientSet, f.Namespace.Name, podName, podName)
|
logs, err := e2epod.GetPodLogs(ctx, f.ClientSet, f.Namespace.Name, podName, podName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -538,7 +540,7 @@ var _ = SIGDescribe("Security Context", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should run the container as privileged when true [LinuxOnly] [NodeFeature:HostAccess]", func(ctx context.Context) {
|
f.It("should run the container as privileged when true [LinuxOnly]", nodefeature.HostAccess, func(ctx context.Context) {
|
||||||
podName := createAndWaitUserPod(ctx, true)
|
podName := createAndWaitUserPod(ctx, true)
|
||||||
logs, err := e2epod.GetPodLogs(ctx, f.ClientSet, f.Namespace.Name, podName, podName)
|
logs, err := e2epod.GetPodLogs(ctx, f.ClientSet, f.Namespace.Name, podName, podName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -591,7 +593,7 @@ var _ = SIGDescribe("Security Context", func() {
|
|||||||
This e2e Can not be promoted to Conformance as it is Container Runtime dependent and not all conformant platforms will require this behavior.
|
This e2e Can not be promoted to Conformance as it is Container Runtime dependent and not all conformant platforms will require this behavior.
|
||||||
[LinuxOnly]: This test is marked LinuxOnly since Windows does not support running as UID / GID, or privilege escalation.
|
[LinuxOnly]: This test is marked LinuxOnly since Windows does not support running as UID / GID, or privilege escalation.
|
||||||
*/
|
*/
|
||||||
ginkgo.It("should allow privilege escalation when not explicitly set and uid != 0 [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
f.It("should allow privilege escalation when not explicitly set and uid != 0 [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "alpine-nnp-nil-" + string(uuid.NewUUID())
|
podName := "alpine-nnp-nil-" + string(uuid.NewUUID())
|
||||||
if err := createAndMatchOutput(ctx, podName, "Effective uid: 0", nil, nonRootTestUserID); err != nil {
|
if err := createAndMatchOutput(ctx, podName, "Effective uid: 0", nil, nonRootTestUserID); err != nil {
|
||||||
framework.Failf("Match output for pod %q failed: %v", podName, err)
|
framework.Failf("Match output for pod %q failed: %v", podName, err)
|
||||||
@ -606,7 +608,7 @@ var _ = SIGDescribe("Security Context", func() {
|
|||||||
When the container is run, container's output MUST match with expected output verifying container ran with given uid i.e. uid=1000.
|
When the container is run, container's output MUST match with expected output verifying container ran with given uid i.e. uid=1000.
|
||||||
[LinuxOnly]: This test is marked LinuxOnly since Windows does not support running as UID / GID, or privilege escalation.
|
[LinuxOnly]: This test is marked LinuxOnly since Windows does not support running as UID / GID, or privilege escalation.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should not allow privilege escalation when false [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should not allow privilege escalation when false [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "alpine-nnp-false-" + string(uuid.NewUUID())
|
podName := "alpine-nnp-false-" + string(uuid.NewUUID())
|
||||||
apeFalse := false
|
apeFalse := false
|
||||||
if err := createAndMatchOutput(ctx, podName, fmt.Sprintf("Effective uid: %d", nonRootTestUserID), &apeFalse, nonRootTestUserID); err != nil {
|
if err := createAndMatchOutput(ctx, podName, fmt.Sprintf("Effective uid: %d", nonRootTestUserID), &apeFalse, nonRootTestUserID); err != nil {
|
||||||
@ -623,7 +625,7 @@ var _ = SIGDescribe("Security Context", func() {
|
|||||||
This e2e Can not be promoted to Conformance as it is Container Runtime dependent and runtime may not allow to run.
|
This e2e Can not be promoted to Conformance as it is Container Runtime dependent and runtime may not allow to run.
|
||||||
[LinuxOnly]: This test is marked LinuxOnly since Windows does not support running as UID / GID.
|
[LinuxOnly]: This test is marked LinuxOnly since Windows does not support running as UID / GID.
|
||||||
*/
|
*/
|
||||||
ginkgo.It("should allow privilege escalation when true [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
f.It("should allow privilege escalation when true [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "alpine-nnp-true-" + string(uuid.NewUUID())
|
podName := "alpine-nnp-true-" + string(uuid.NewUUID())
|
||||||
apeTrue := true
|
apeTrue := true
|
||||||
if err := createAndMatchOutput(ctx, podName, "Effective uid: 0", &apeTrue, nonRootTestUserID); err != nil {
|
if err := createAndMatchOutput(ctx, podName, "Effective uid: 0", &apeTrue, nonRootTestUserID); err != nil {
|
||||||
|
@ -22,6 +22,7 @@ import (
|
|||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/uuid"
|
"k8s.io/apimachinery/pkg/util/uuid"
|
||||||
|
"k8s.io/kubernetes/test/e2e/environment"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
@ -32,7 +33,7 @@ import (
|
|||||||
"github.com/onsi/gomega"
|
"github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("Sysctls [LinuxOnly] [NodeConformance]", func() {
|
var _ = SIGDescribe("Sysctls [LinuxOnly]", framework.WithNodeConformance(), func() {
|
||||||
|
|
||||||
ginkgo.BeforeEach(func() {
|
ginkgo.BeforeEach(func() {
|
||||||
// sysctl is not supported on Windows.
|
// sysctl is not supported on Windows.
|
||||||
@ -75,7 +76,7 @@ var _ = SIGDescribe("Sysctls [LinuxOnly] [NodeConformance]", func() {
|
|||||||
[LinuxOnly]: This test is marked as LinuxOnly since Windows does not support sysctls
|
[LinuxOnly]: This test is marked as LinuxOnly since Windows does not support sysctls
|
||||||
[Environment:NotInUserNS]: The test fails in UserNS (as expected): `open /proc/sys/kernel/shm_rmid_forced: permission denied`
|
[Environment:NotInUserNS]: The test fails in UserNS (as expected): `open /proc/sys/kernel/shm_rmid_forced: permission denied`
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should support sysctls [MinimumKubeletVersion:1.21] [Environment:NotInUserNS]", func(ctx context.Context) {
|
framework.ConformanceIt("should support sysctls [MinimumKubeletVersion:1.21]", environment.NotInUserNS, func(ctx context.Context) {
|
||||||
pod := testPod()
|
pod := testPod()
|
||||||
pod.Spec.SecurityContext = &v1.PodSecurityContext{
|
pod.Spec.SecurityContext = &v1.PodSecurityContext{
|
||||||
Sysctls: []v1.Sysctl{
|
Sysctls: []v1.Sysctl{
|
||||||
@ -185,7 +186,7 @@ var _ = SIGDescribe("Sysctls [LinuxOnly] [NodeConformance]", func() {
|
|||||||
[LinuxOnly]: This test is marked as LinuxOnly since Windows does not support sysctls
|
[LinuxOnly]: This test is marked as LinuxOnly since Windows does not support sysctls
|
||||||
[Environment:NotInUserNS]: The test fails in UserNS (as expected): `open /proc/sys/kernel/shm_rmid_forced: permission denied`
|
[Environment:NotInUserNS]: The test fails in UserNS (as expected): `open /proc/sys/kernel/shm_rmid_forced: permission denied`
|
||||||
*/
|
*/
|
||||||
ginkgo.It("should support sysctls with slashes as separator [MinimumKubeletVersion:1.23] [Environment:NotInUserNS]", func(ctx context.Context) {
|
f.It("should support sysctls with slashes as separator [MinimumKubeletVersion:1.23]", environment.NotInUserNS, func(ctx context.Context) {
|
||||||
pod := testPod()
|
pod := testPod()
|
||||||
pod.Spec.SecurityContext = &v1.PodSecurityContext{
|
pod.Spec.SecurityContext = &v1.PodSecurityContext{
|
||||||
Sysctls: []v1.Sysctl{
|
Sysctls: []v1.Sysctl{
|
||||||
|
@ -31,6 +31,7 @@ import (
|
|||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
|
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
|
"k8s.io/kubernetes/test/e2e/nodefeature"
|
||||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
)
|
)
|
||||||
@ -44,7 +45,7 @@ var _ = SIGDescribe("ConfigMap", func() {
|
|||||||
Testname: ConfigMap Volume, without mapping
|
Testname: ConfigMap Volume, without mapping
|
||||||
Description: Create a ConfigMap, create a Pod that mounts a volume and populates the volume with data stored in the ConfigMap. The ConfigMap that is created MUST be accessible to read from the newly created Pod using the volume mount. The data content of the file MUST be readable and verified and file modes MUST default to 0x644.
|
Description: Create a ConfigMap, create a Pod that mounts a volume and populates the volume with data stored in the ConfigMap. The ConfigMap that is created MUST be accessible to read from the newly created Pod using the volume mount. The data content of the file MUST be readable and verified and file modes MUST default to 0x644.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doConfigMapE2EWithoutMappings(ctx, f, false, 0, nil)
|
doConfigMapE2EWithoutMappings(ctx, f, false, 0, nil)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -54,12 +55,12 @@ var _ = SIGDescribe("ConfigMap", func() {
|
|||||||
Description: Create a ConfigMap, create a Pod that mounts a volume and populates the volume with data stored in the ConfigMap. File mode is changed to a custom value of '0x400'. The ConfigMap that is created MUST be accessible to read from the newly created Pod using the volume mount. The data content of the file MUST be readable and verified and file modes MUST be set to the custom value of '0x400'
|
Description: Create a ConfigMap, create a Pod that mounts a volume and populates the volume with data stored in the ConfigMap. File mode is changed to a custom value of '0x400'. The ConfigMap that is created MUST be accessible to read from the newly created Pod using the volume mount. The data content of the file MUST be readable and verified and file modes MUST be set to the custom value of '0x400'
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume with defaultMode set [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume with defaultMode set [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
defaultMode := int32(0400)
|
defaultMode := int32(0400)
|
||||||
doConfigMapE2EWithoutMappings(ctx, f, false, 0, &defaultMode)
|
doConfigMapE2EWithoutMappings(ctx, f, false, 0, &defaultMode)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should be consumable from pods in volume as non-root with defaultMode and fsGroup set [LinuxOnly] [NodeFeature:FSGroup]", func(ctx context.Context) {
|
f.It("should be consumable from pods in volume as non-root with defaultMode and fsGroup set [LinuxOnly]", nodefeature.FSGroup, func(ctx context.Context) {
|
||||||
// Windows does not support RunAsUser / FSGroup SecurityContext options, and it does not support setting file permissions.
|
// Windows does not support RunAsUser / FSGroup SecurityContext options, and it does not support setting file permissions.
|
||||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||||
defaultMode := int32(0440) /* setting fsGroup sets mode to at least 440 */
|
defaultMode := int32(0440) /* setting fsGroup sets mode to at least 440 */
|
||||||
@ -71,11 +72,11 @@ var _ = SIGDescribe("ConfigMap", func() {
|
|||||||
Testname: ConfigMap Volume, without mapping, non-root user
|
Testname: ConfigMap Volume, without mapping, non-root user
|
||||||
Description: Create a ConfigMap, create a Pod that mounts a volume and populates the volume with data stored in the ConfigMap. Pod is run as a non-root user with uid=1000. The ConfigMap that is created MUST be accessible to read from the newly created Pod using the volume mount. The file on the volume MUST have file mode set to default value of 0x644.
|
Description: Create a ConfigMap, create a Pod that mounts a volume and populates the volume with data stored in the ConfigMap. Pod is run as a non-root user with uid=1000. The ConfigMap that is created MUST be accessible to read from the newly created Pod using the volume mount. The file on the volume MUST have file mode set to default value of 0x644.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume as non-root [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume as non-root", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doConfigMapE2EWithoutMappings(ctx, f, true, 0, nil)
|
doConfigMapE2EWithoutMappings(ctx, f, true, 0, nil)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should be consumable from pods in volume as non-root with FSGroup [LinuxOnly] [NodeFeature:FSGroup]", func(ctx context.Context) {
|
f.It("should be consumable from pods in volume as non-root with FSGroup [LinuxOnly]", nodefeature.FSGroup, func(ctx context.Context) {
|
||||||
// Windows does not support RunAsUser / FSGroup SecurityContext options.
|
// Windows does not support RunAsUser / FSGroup SecurityContext options.
|
||||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||||
doConfigMapE2EWithoutMappings(ctx, f, true, 1001, nil)
|
doConfigMapE2EWithoutMappings(ctx, f, true, 1001, nil)
|
||||||
@ -86,7 +87,7 @@ var _ = SIGDescribe("ConfigMap", func() {
|
|||||||
Testname: ConfigMap Volume, with mapping
|
Testname: ConfigMap Volume, with mapping
|
||||||
Description: Create a ConfigMap, create a Pod that mounts a volume and populates the volume with data stored in the ConfigMap. Files are mapped to a path in the volume. The ConfigMap that is created MUST be accessible to read from the newly created Pod using the volume mount. The data content of the file MUST be readable and verified and file modes MUST default to 0x644.
|
Description: Create a ConfigMap, create a Pod that mounts a volume and populates the volume with data stored in the ConfigMap. Files are mapped to a path in the volume. The ConfigMap that is created MUST be accessible to read from the newly created Pod using the volume mount. The data content of the file MUST be readable and verified and file modes MUST default to 0x644.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume with mappings [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume with mappings", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doConfigMapE2EWithMappings(ctx, f, false, 0, nil)
|
doConfigMapE2EWithMappings(ctx, f, false, 0, nil)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -96,7 +97,7 @@ var _ = SIGDescribe("ConfigMap", func() {
|
|||||||
Description: Create a ConfigMap, create a Pod that mounts a volume and populates the volume with data stored in the ConfigMap. Files are mapped to a path in the volume. File mode is changed to a custom value of '0x400'. The ConfigMap that is created MUST be accessible to read from the newly created Pod using the volume mount. The data content of the file MUST be readable and verified and file modes MUST be set to the custom value of '0x400'
|
Description: Create a ConfigMap, create a Pod that mounts a volume and populates the volume with data stored in the ConfigMap. Files are mapped to a path in the volume. File mode is changed to a custom value of '0x400'. The ConfigMap that is created MUST be accessible to read from the newly created Pod using the volume mount. The data content of the file MUST be readable and verified and file modes MUST be set to the custom value of '0x400'
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume with mappings and Item mode set [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume with mappings and Item mode set [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
mode := int32(0400)
|
mode := int32(0400)
|
||||||
doConfigMapE2EWithMappings(ctx, f, false, 0, &mode)
|
doConfigMapE2EWithMappings(ctx, f, false, 0, &mode)
|
||||||
})
|
})
|
||||||
@ -106,11 +107,11 @@ var _ = SIGDescribe("ConfigMap", func() {
|
|||||||
Testname: ConfigMap Volume, with mapping, non-root user
|
Testname: ConfigMap Volume, with mapping, non-root user
|
||||||
Description: Create a ConfigMap, create a Pod that mounts a volume and populates the volume with data stored in the ConfigMap. Files are mapped to a path in the volume. Pod is run as a non-root user with uid=1000. The ConfigMap that is created MUST be accessible to read from the newly created Pod using the volume mount. The file on the volume MUST have file mode set to default value of 0x644.
|
Description: Create a ConfigMap, create a Pod that mounts a volume and populates the volume with data stored in the ConfigMap. Files are mapped to a path in the volume. Pod is run as a non-root user with uid=1000. The ConfigMap that is created MUST be accessible to read from the newly created Pod using the volume mount. The file on the volume MUST have file mode set to default value of 0x644.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume with mappings as non-root [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume with mappings as non-root", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doConfigMapE2EWithMappings(ctx, f, true, 0, nil)
|
doConfigMapE2EWithMappings(ctx, f, true, 0, nil)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should be consumable from pods in volume with mappings as non-root with FSGroup [LinuxOnly] [NodeFeature:FSGroup]", func(ctx context.Context) {
|
f.It("should be consumable from pods in volume with mappings as non-root with FSGroup [LinuxOnly]", nodefeature.FSGroup, func(ctx context.Context) {
|
||||||
// Windows does not support RunAsUser / FSGroup SecurityContext options.
|
// Windows does not support RunAsUser / FSGroup SecurityContext options.
|
||||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||||
doConfigMapE2EWithMappings(ctx, f, true, 1001, nil)
|
doConfigMapE2EWithMappings(ctx, f, true, 1001, nil)
|
||||||
@ -121,7 +122,7 @@ var _ = SIGDescribe("ConfigMap", func() {
|
|||||||
Testname: ConfigMap Volume, update
|
Testname: ConfigMap Volume, update
|
||||||
Description: The ConfigMap that is created MUST be accessible to read from the newly created Pod using the volume mount that is mapped to custom path in the Pod. When the ConfigMap is updated the change to the config map MUST be verified by reading the content from the mounted file in the Pod.
|
Description: The ConfigMap that is created MUST be accessible to read from the newly created Pod using the volume mount that is mapped to custom path in the Pod. When the ConfigMap is updated the change to the config map MUST be verified by reading the content from the mounted file in the Pod.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("updates should be reflected in volume [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("updates should be reflected in volume", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podLogTimeout := e2epod.GetPodSecretUpdateTimeout(ctx, f.ClientSet)
|
podLogTimeout := e2epod.GetPodSecretUpdateTimeout(ctx, f.ClientSet)
|
||||||
containerTimeoutArg := fmt.Sprintf("--retry_time=%v", int(podLogTimeout.Seconds()))
|
containerTimeoutArg := fmt.Sprintf("--retry_time=%v", int(podLogTimeout.Seconds()))
|
||||||
|
|
||||||
@ -172,7 +173,7 @@ var _ = SIGDescribe("ConfigMap", func() {
|
|||||||
Testname: ConfigMap Volume, text data, binary data
|
Testname: ConfigMap Volume, text data, binary data
|
||||||
Description: The ConfigMap that is created with text data and binary data MUST be accessible to read from the newly created Pod using the volume mount that is mapped to custom path in the Pod. ConfigMap's text data and binary data MUST be verified by reading the content from the mounted files in the Pod.
|
Description: The ConfigMap that is created with text data and binary data MUST be accessible to read from the newly created Pod using the volume mount that is mapped to custom path in the Pod. ConfigMap's text data and binary data MUST be verified by reading the content from the mounted files in the Pod.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("binary data should be reflected in volume [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("binary data should be reflected in volume", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podLogTimeout := e2epod.GetPodSecretUpdateTimeout(ctx, f.ClientSet)
|
podLogTimeout := e2epod.GetPodSecretUpdateTimeout(ctx, f.ClientSet)
|
||||||
containerTimeoutArg := fmt.Sprintf("--retry_time=%v", int(podLogTimeout.Seconds()))
|
containerTimeoutArg := fmt.Sprintf("--retry_time=%v", int(podLogTimeout.Seconds()))
|
||||||
|
|
||||||
@ -237,7 +238,7 @@ var _ = SIGDescribe("ConfigMap", func() {
|
|||||||
Testname: ConfigMap Volume, create, update and delete
|
Testname: ConfigMap Volume, create, update and delete
|
||||||
Description: The ConfigMap that is created MUST be accessible to read from the newly created Pod using the volume mount that is mapped to custom path in the Pod. When the config map is updated the change to the config map MUST be verified by reading the content from the mounted file in the Pod. Also when the item(file) is deleted from the map that MUST result in a error reading that item(file).
|
Description: The ConfigMap that is created MUST be accessible to read from the newly created Pod using the volume mount that is mapped to custom path in the Pod. When the config map is updated the change to the config map MUST be verified by reading the content from the mounted file in the Pod. Also when the item(file) is deleted from the map that MUST result in a error reading that item(file).
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("optional updates should be reflected in volume [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("optional updates should be reflected in volume", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podLogTimeout := e2epod.GetPodSecretUpdateTimeout(ctx, f.ClientSet)
|
podLogTimeout := e2epod.GetPodSecretUpdateTimeout(ctx, f.ClientSet)
|
||||||
containerTimeoutArg := fmt.Sprintf("--retry_time=%v", int(podLogTimeout.Seconds()))
|
containerTimeoutArg := fmt.Sprintf("--retry_time=%v", int(podLogTimeout.Seconds()))
|
||||||
trueVal := true
|
trueVal := true
|
||||||
@ -420,7 +421,7 @@ var _ = SIGDescribe("ConfigMap", func() {
|
|||||||
Testname: ConfigMap Volume, multiple volume maps
|
Testname: ConfigMap Volume, multiple volume maps
|
||||||
Description: The ConfigMap that is created MUST be accessible to read from the newly created Pod using the volume mount that is mapped to multiple paths in the Pod. The content MUST be accessible from all the mapped volume mounts.
|
Description: The ConfigMap that is created MUST be accessible to read from the newly created Pod using the volume mount that is mapped to multiple paths in the Pod. The content MUST be accessible from all the mapped volume mounts.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable in multiple volumes in the same pod [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable in multiple volumes in the same pod", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
var (
|
var (
|
||||||
name = "configmap-test-volume-" + string(uuid.NewUUID())
|
name = "configmap-test-volume-" + string(uuid.NewUUID())
|
||||||
volumeName = "configmap-volume"
|
volumeName = "configmap-volume"
|
||||||
@ -554,7 +555,7 @@ var _ = SIGDescribe("ConfigMap", func() {
|
|||||||
// The pod is in pending during volume creation until the configMap objects are available
|
// The pod is in pending during volume creation until the configMap objects are available
|
||||||
// or until mount the configMap volume times out. There is no configMap object defined for the pod, so it should return timeout exception unless it is marked optional.
|
// or until mount the configMap volume times out. There is no configMap object defined for the pod, so it should return timeout exception unless it is marked optional.
|
||||||
// Slow (~5 mins)
|
// Slow (~5 mins)
|
||||||
ginkgo.It("Should fail non-optional pod creation due to configMap object does not exist [Slow]", func(ctx context.Context) {
|
f.It("Should fail non-optional pod creation due to configMap object does not exist", f.WithSlow(), func(ctx context.Context) {
|
||||||
volumeMountPath := "/etc/configmap-volumes"
|
volumeMountPath := "/etc/configmap-volumes"
|
||||||
pod := createNonOptionalConfigMapPod(ctx, f, volumeMountPath)
|
pod := createNonOptionalConfigMapPod(ctx, f, volumeMountPath)
|
||||||
getPod := e2epod.Get(f.ClientSet, pod)
|
getPod := e2epod.Get(f.ClientSet, pod)
|
||||||
@ -564,7 +565,7 @@ var _ = SIGDescribe("ConfigMap", func() {
|
|||||||
// ConfigMap object defined for the pod, If a key is specified which is not present in the ConfigMap,
|
// ConfigMap object defined for the pod, If a key is specified which is not present in the ConfigMap,
|
||||||
// the volume setup will error unless it is marked optional, during the pod creation.
|
// the volume setup will error unless it is marked optional, during the pod creation.
|
||||||
// Slow (~5 mins)
|
// Slow (~5 mins)
|
||||||
ginkgo.It("Should fail non-optional pod creation due to the key in the configMap object does not exist [Slow]", func(ctx context.Context) {
|
f.It("Should fail non-optional pod creation due to the key in the configMap object does not exist", f.WithSlow(), func(ctx context.Context) {
|
||||||
volumeMountPath := "/etc/configmap-volumes"
|
volumeMountPath := "/etc/configmap-volumes"
|
||||||
pod := createNonOptionalConfigMapPodWithConfig(ctx, f, volumeMountPath)
|
pod := createNonOptionalConfigMapPodWithConfig(ctx, f, volumeMountPath)
|
||||||
getPod := e2epod.Get(f.ClientSet, pod)
|
getPod := e2epod.Get(f.ClientSet, pod)
|
||||||
|
@ -24,6 +24,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/api/resource"
|
"k8s.io/apimachinery/pkg/api/resource"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/uuid"
|
"k8s.io/apimachinery/pkg/util/uuid"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
|
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
|
||||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||||
@ -32,7 +33,7 @@ import (
|
|||||||
"github.com/onsi/ginkgo/v2"
|
"github.com/onsi/ginkgo/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("Downward API [Serial] [Disruptive] [Feature:EphemeralStorage]", func() {
|
var _ = SIGDescribe("Downward API", framework.WithSerial(), framework.WithDisruptive(), feature.EphemeralStorage, func() {
|
||||||
f := framework.NewDefaultFramework("downward-api")
|
f := framework.NewDefaultFramework("downward-api")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ import (
|
|||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
|
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
|
"k8s.io/kubernetes/test/e2e/nodefeature"
|
||||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
|
|
||||||
@ -51,7 +52,7 @@ var _ = SIGDescribe("Downward API volume", func() {
|
|||||||
Testname: DownwardAPI volume, pod name
|
Testname: DownwardAPI volume, pod name
|
||||||
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains a item for the Pod name. The container runtime MUST be able to access Pod name from the specified path on the mounted volume.
|
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains a item for the Pod name. The container runtime MUST be able to access Pod name from the specified path on the mounted volume.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide podname only [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide podname only", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
||||||
pod := downwardAPIVolumePodForSimpleTest(podName, "/etc/podinfo/podname")
|
pod := downwardAPIVolumePodForSimpleTest(podName, "/etc/podinfo/podname")
|
||||||
|
|
||||||
@ -66,7 +67,7 @@ var _ = SIGDescribe("Downward API volume", func() {
|
|||||||
Description: A Pod is configured with DownwardAPIVolumeSource with the volumesource mode set to -r-------- and DownwardAPIVolumeFiles contains a item for the Pod name. The container runtime MUST be able to access Pod name from the specified path on the mounted volume.
|
Description: A Pod is configured with DownwardAPIVolumeSource with the volumesource mode set to -r-------- and DownwardAPIVolumeFiles contains a item for the Pod name. The container runtime MUST be able to access Pod name from the specified path on the mounted volume.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should set DefaultMode on files [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should set DefaultMode on files [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
||||||
defaultMode := int32(0400)
|
defaultMode := int32(0400)
|
||||||
pod := downwardAPIVolumePodForModeTest(podName, "/etc/podinfo/podname", nil, &defaultMode)
|
pod := downwardAPIVolumePodForModeTest(podName, "/etc/podinfo/podname", nil, &defaultMode)
|
||||||
@ -82,7 +83,7 @@ var _ = SIGDescribe("Downward API volume", func() {
|
|||||||
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains a item for the Pod name with the file mode set to -r--------. The container runtime MUST be able to access Pod name from the specified path on the mounted volume.
|
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains a item for the Pod name with the file mode set to -r--------. The container runtime MUST be able to access Pod name from the specified path on the mounted volume.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should set mode on item file [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should set mode on item file [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
||||||
mode := int32(0400)
|
mode := int32(0400)
|
||||||
pod := downwardAPIVolumePodForModeTest(podName, "/etc/podinfo/podname", &mode, nil)
|
pod := downwardAPIVolumePodForModeTest(podName, "/etc/podinfo/podname", &mode, nil)
|
||||||
@ -92,7 +93,7 @@ var _ = SIGDescribe("Downward API volume", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should provide podname as non-root with fsgroup [LinuxOnly] [NodeFeature:FSGroup]", func(ctx context.Context) {
|
f.It("should provide podname as non-root with fsgroup [LinuxOnly]", nodefeature.FSGroup, func(ctx context.Context) {
|
||||||
// Windows does not support RunAsUser / FSGroup SecurityContext options.
|
// Windows does not support RunAsUser / FSGroup SecurityContext options.
|
||||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||||
podName := "metadata-volume-" + string(uuid.NewUUID())
|
podName := "metadata-volume-" + string(uuid.NewUUID())
|
||||||
@ -107,7 +108,7 @@ var _ = SIGDescribe("Downward API volume", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should provide podname as non-root with fsgroup and defaultMode [LinuxOnly] [NodeFeature:FSGroup]", func(ctx context.Context) {
|
f.It("should provide podname as non-root with fsgroup and defaultMode [LinuxOnly]", nodefeature.FSGroup, func(ctx context.Context) {
|
||||||
// Windows does not support RunAsUser / FSGroup SecurityContext options, and it does not support setting file permissions.
|
// Windows does not support RunAsUser / FSGroup SecurityContext options, and it does not support setting file permissions.
|
||||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||||
podName := "metadata-volume-" + string(uuid.NewUUID())
|
podName := "metadata-volume-" + string(uuid.NewUUID())
|
||||||
@ -128,7 +129,7 @@ var _ = SIGDescribe("Downward API volume", func() {
|
|||||||
Testname: DownwardAPI volume, update label
|
Testname: DownwardAPI volume, update label
|
||||||
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains list of items for each of the Pod labels. The container runtime MUST be able to access Pod labels from the specified path on the mounted volume. Update the labels by adding a new label to the running Pod. The new label MUST be available from the mounted volume.
|
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains list of items for each of the Pod labels. The container runtime MUST be able to access Pod labels from the specified path on the mounted volume. Update the labels by adding a new label to the running Pod. The new label MUST be available from the mounted volume.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should update labels on modification [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should update labels on modification", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
labels := map[string]string{}
|
labels := map[string]string{}
|
||||||
labels["key1"] = "value1"
|
labels["key1"] = "value1"
|
||||||
labels["key2"] = "value2"
|
labels["key2"] = "value2"
|
||||||
@ -160,7 +161,7 @@ var _ = SIGDescribe("Downward API volume", func() {
|
|||||||
Testname: DownwardAPI volume, update annotations
|
Testname: DownwardAPI volume, update annotations
|
||||||
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains list of items for each of the Pod annotations. The container runtime MUST be able to access Pod annotations from the specified path on the mounted volume. Update the annotations by adding a new annotation to the running Pod. The new annotation MUST be available from the mounted volume.
|
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains list of items for each of the Pod annotations. The container runtime MUST be able to access Pod annotations from the specified path on the mounted volume. Update the annotations by adding a new annotation to the running Pod. The new annotation MUST be available from the mounted volume.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should update annotations on modification [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should update annotations on modification", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
annotations := map[string]string{}
|
annotations := map[string]string{}
|
||||||
annotations["builder"] = "bar"
|
annotations["builder"] = "bar"
|
||||||
podName := "annotationupdate" + string(uuid.NewUUID())
|
podName := "annotationupdate" + string(uuid.NewUUID())
|
||||||
@ -191,7 +192,7 @@ var _ = SIGDescribe("Downward API volume", func() {
|
|||||||
Testname: DownwardAPI volume, CPU limits
|
Testname: DownwardAPI volume, CPU limits
|
||||||
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains a item for the CPU limits. The container runtime MUST be able to access CPU limits from the specified path on the mounted volume.
|
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains a item for the CPU limits. The container runtime MUST be able to access CPU limits from the specified path on the mounted volume.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide container's cpu limit [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide container's cpu limit", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
||||||
pod := downwardAPIVolumeForContainerResources(podName, "/etc/podinfo/cpu_limit")
|
pod := downwardAPIVolumeForContainerResources(podName, "/etc/podinfo/cpu_limit")
|
||||||
|
|
||||||
@ -205,7 +206,7 @@ var _ = SIGDescribe("Downward API volume", func() {
|
|||||||
Testname: DownwardAPI volume, memory limits
|
Testname: DownwardAPI volume, memory limits
|
||||||
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains a item for the memory limits. The container runtime MUST be able to access memory limits from the specified path on the mounted volume.
|
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains a item for the memory limits. The container runtime MUST be able to access memory limits from the specified path on the mounted volume.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide container's memory limit [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide container's memory limit", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
||||||
pod := downwardAPIVolumeForContainerResources(podName, "/etc/podinfo/memory_limit")
|
pod := downwardAPIVolumeForContainerResources(podName, "/etc/podinfo/memory_limit")
|
||||||
|
|
||||||
@ -219,7 +220,7 @@ var _ = SIGDescribe("Downward API volume", func() {
|
|||||||
Testname: DownwardAPI volume, CPU request
|
Testname: DownwardAPI volume, CPU request
|
||||||
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains a item for the CPU request. The container runtime MUST be able to access CPU request from the specified path on the mounted volume.
|
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains a item for the CPU request. The container runtime MUST be able to access CPU request from the specified path on the mounted volume.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide container's cpu request [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide container's cpu request", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
||||||
pod := downwardAPIVolumeForContainerResources(podName, "/etc/podinfo/cpu_request")
|
pod := downwardAPIVolumeForContainerResources(podName, "/etc/podinfo/cpu_request")
|
||||||
|
|
||||||
@ -233,7 +234,7 @@ var _ = SIGDescribe("Downward API volume", func() {
|
|||||||
Testname: DownwardAPI volume, memory request
|
Testname: DownwardAPI volume, memory request
|
||||||
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains a item for the memory request. The container runtime MUST be able to access memory request from the specified path on the mounted volume.
|
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains a item for the memory request. The container runtime MUST be able to access memory request from the specified path on the mounted volume.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide container's memory request [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide container's memory request", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
||||||
pod := downwardAPIVolumeForContainerResources(podName, "/etc/podinfo/memory_request")
|
pod := downwardAPIVolumeForContainerResources(podName, "/etc/podinfo/memory_request")
|
||||||
|
|
||||||
@ -247,7 +248,7 @@ var _ = SIGDescribe("Downward API volume", func() {
|
|||||||
Testname: DownwardAPI volume, CPU limit, default node allocatable
|
Testname: DownwardAPI volume, CPU limit, default node allocatable
|
||||||
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains a item for the CPU limits. CPU limits is not specified for the container. The container runtime MUST be able to access CPU limits from the specified path on the mounted volume and the value MUST be default node allocatable.
|
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains a item for the CPU limits. CPU limits is not specified for the container. The container runtime MUST be able to access CPU limits from the specified path on the mounted volume and the value MUST be default node allocatable.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide node allocatable (cpu) as default cpu limit if the limit is not set [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide node allocatable (cpu) as default cpu limit if the limit is not set", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
||||||
pod := downwardAPIVolumeForDefaultContainerResources(podName, "/etc/podinfo/cpu_limit")
|
pod := downwardAPIVolumeForDefaultContainerResources(podName, "/etc/podinfo/cpu_limit")
|
||||||
|
|
||||||
@ -259,7 +260,7 @@ var _ = SIGDescribe("Downward API volume", func() {
|
|||||||
Testname: DownwardAPI volume, memory limit, default node allocatable
|
Testname: DownwardAPI volume, memory limit, default node allocatable
|
||||||
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains a item for the memory limits. memory limits is not specified for the container. The container runtime MUST be able to access memory limits from the specified path on the mounted volume and the value MUST be default node allocatable.
|
Description: A Pod is configured with DownwardAPIVolumeSource and DownwardAPIVolumeFiles contains a item for the memory limits. memory limits is not specified for the container. The container runtime MUST be able to access memory limits from the specified path on the mounted volume and the value MUST be default node allocatable.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide node allocatable (memory) as default memory limit if the limit is not set [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide node allocatable (memory) as default memory limit if the limit is not set", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
||||||
pod := downwardAPIVolumeForDefaultContainerResources(podName, "/etc/podinfo/memory_limit")
|
pod := downwardAPIVolumeForDefaultContainerResources(podName, "/etc/podinfo/memory_limit")
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ import (
|
|||||||
|
|
||||||
"github.com/onsi/ginkgo/v2"
|
"github.com/onsi/ginkgo/v2"
|
||||||
"github.com/onsi/gomega"
|
"github.com/onsi/gomega"
|
||||||
|
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/api/resource"
|
"k8s.io/apimachinery/pkg/api/resource"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@ -31,6 +32,7 @@ import (
|
|||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
|
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
|
"k8s.io/kubernetes/test/e2e/nodefeature"
|
||||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
)
|
)
|
||||||
@ -47,7 +49,7 @@ var _ = SIGDescribe("EmptyDir volumes", func() {
|
|||||||
f := framework.NewDefaultFramework("emptydir")
|
f := framework.NewDefaultFramework("emptydir")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
||||||
|
|
||||||
ginkgo.Context("when FSGroup is specified [LinuxOnly] [NodeFeature:FSGroup]", func() {
|
f.Context("when FSGroup is specified [LinuxOnly]", nodefeature.FSGroup, func() {
|
||||||
|
|
||||||
ginkgo.BeforeEach(func() {
|
ginkgo.BeforeEach(func() {
|
||||||
// Windows does not support the FSGroup SecurityContext option.
|
// Windows does not support the FSGroup SecurityContext option.
|
||||||
@ -85,7 +87,7 @@ var _ = SIGDescribe("EmptyDir volumes", func() {
|
|||||||
Description: A Pod created with an 'emptyDir' Volume and 'medium' as 'Memory', the volume MUST have mode set as -rwxrwxrwx and mount type set to tmpfs.
|
Description: A Pod created with an 'emptyDir' Volume and 'medium' as 'Memory', the volume MUST have mode set as -rwxrwxrwx and mount type set to tmpfs.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or the medium = 'Memory'.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or the medium = 'Memory'.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("volume on tmpfs should have the correct mode [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("volume on tmpfs should have the correct mode [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doTestVolumeMode(ctx, f, 0, v1.StorageMediumMemory)
|
doTestVolumeMode(ctx, f, 0, v1.StorageMediumMemory)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -95,7 +97,7 @@ var _ = SIGDescribe("EmptyDir volumes", func() {
|
|||||||
Description: A Pod created with an 'emptyDir' Volume and 'medium' as 'Memory', the volume mode set to 0644. The volume MUST have mode -rw-r--r-- and mount type set to tmpfs and the contents MUST be readable.
|
Description: A Pod created with an 'emptyDir' Volume and 'medium' as 'Memory', the volume mode set to 0644. The volume MUST have mode -rw-r--r-- and mount type set to tmpfs and the contents MUST be readable.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID, or the medium = 'Memory'.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID, or the medium = 'Memory'.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should support (root,0644,tmpfs) [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should support (root,0644,tmpfs) [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doTest0644(ctx, f, 0, v1.StorageMediumMemory)
|
doTest0644(ctx, f, 0, v1.StorageMediumMemory)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -105,7 +107,7 @@ var _ = SIGDescribe("EmptyDir volumes", func() {
|
|||||||
Description: A Pod created with an 'emptyDir' Volume and 'medium' as 'Memory', the volume mode set to 0666. The volume MUST have mode -rw-rw-rw- and mount type set to tmpfs and the contents MUST be readable.
|
Description: A Pod created with an 'emptyDir' Volume and 'medium' as 'Memory', the volume mode set to 0666. The volume MUST have mode -rw-rw-rw- and mount type set to tmpfs and the contents MUST be readable.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID, or the medium = 'Memory'.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID, or the medium = 'Memory'.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should support (root,0666,tmpfs) [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should support (root,0666,tmpfs) [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doTest0666(ctx, f, 0, v1.StorageMediumMemory)
|
doTest0666(ctx, f, 0, v1.StorageMediumMemory)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -115,7 +117,7 @@ var _ = SIGDescribe("EmptyDir volumes", func() {
|
|||||||
Description: A Pod created with an 'emptyDir' Volume and 'medium' as 'Memory', the volume mode set to 0777. The volume MUST have mode set as -rwxrwxrwx and mount type set to tmpfs and the contents MUST be readable.
|
Description: A Pod created with an 'emptyDir' Volume and 'medium' as 'Memory', the volume mode set to 0777. The volume MUST have mode set as -rwxrwxrwx and mount type set to tmpfs and the contents MUST be readable.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID, or the medium = 'Memory'.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID, or the medium = 'Memory'.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should support (root,0777,tmpfs) [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should support (root,0777,tmpfs) [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doTest0777(ctx, f, 0, v1.StorageMediumMemory)
|
doTest0777(ctx, f, 0, v1.StorageMediumMemory)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -125,7 +127,7 @@ var _ = SIGDescribe("EmptyDir volumes", func() {
|
|||||||
Description: A Pod created with an 'emptyDir' Volume and 'medium' as 'Memory', the volume mode set to 0644. Volume is mounted into the container where container is run as a non-root user. The volume MUST have mode -rw-r--r-- and mount type set to tmpfs and the contents MUST be readable.
|
Description: A Pod created with an 'emptyDir' Volume and 'medium' as 'Memory', the volume mode set to 0644. Volume is mounted into the container where container is run as a non-root user. The volume MUST have mode -rw-r--r-- and mount type set to tmpfs and the contents MUST be readable.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID, or the medium = 'Memory'.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID, or the medium = 'Memory'.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should support (non-root,0644,tmpfs) [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should support (non-root,0644,tmpfs) [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doTest0644(ctx, f, nonRootUID, v1.StorageMediumMemory)
|
doTest0644(ctx, f, nonRootUID, v1.StorageMediumMemory)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -135,7 +137,7 @@ var _ = SIGDescribe("EmptyDir volumes", func() {
|
|||||||
Description: A Pod created with an 'emptyDir' Volume and 'medium' as 'Memory', the volume mode set to 0666. Volume is mounted into the container where container is run as a non-root user. The volume MUST have mode -rw-rw-rw- and mount type set to tmpfs and the contents MUST be readable.
|
Description: A Pod created with an 'emptyDir' Volume and 'medium' as 'Memory', the volume mode set to 0666. Volume is mounted into the container where container is run as a non-root user. The volume MUST have mode -rw-rw-rw- and mount type set to tmpfs and the contents MUST be readable.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID, or the medium = 'Memory'.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID, or the medium = 'Memory'.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should support (non-root,0666,tmpfs) [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should support (non-root,0666,tmpfs) [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doTest0666(ctx, f, nonRootUID, v1.StorageMediumMemory)
|
doTest0666(ctx, f, nonRootUID, v1.StorageMediumMemory)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -145,7 +147,7 @@ var _ = SIGDescribe("EmptyDir volumes", func() {
|
|||||||
Description: A Pod created with an 'emptyDir' Volume and 'medium' as 'Memory', the volume mode set to 0777. Volume is mounted into the container where container is run as a non-root user. The volume MUST have mode -rwxrwxrwx and mount type set to tmpfs and the contents MUST be readable.
|
Description: A Pod created with an 'emptyDir' Volume and 'medium' as 'Memory', the volume mode set to 0777. Volume is mounted into the container where container is run as a non-root user. The volume MUST have mode -rwxrwxrwx and mount type set to tmpfs and the contents MUST be readable.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID, or the medium = 'Memory'.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID, or the medium = 'Memory'.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should support (non-root,0777,tmpfs) [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should support (non-root,0777,tmpfs) [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doTest0777(ctx, f, nonRootUID, v1.StorageMediumMemory)
|
doTest0777(ctx, f, nonRootUID, v1.StorageMediumMemory)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -155,7 +157,7 @@ var _ = SIGDescribe("EmptyDir volumes", func() {
|
|||||||
Description: A Pod created with an 'emptyDir' Volume, the volume MUST have mode set as -rwxrwxrwx and mount type set to tmpfs.
|
Description: A Pod created with an 'emptyDir' Volume, the volume MUST have mode set as -rwxrwxrwx and mount type set to tmpfs.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("volume on default medium should have the correct mode [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("volume on default medium should have the correct mode [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doTestVolumeMode(ctx, f, 0, v1.StorageMediumDefault)
|
doTestVolumeMode(ctx, f, 0, v1.StorageMediumDefault)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -165,7 +167,7 @@ var _ = SIGDescribe("EmptyDir volumes", func() {
|
|||||||
Description: A Pod created with an 'emptyDir' Volume, the volume mode set to 0644. The volume MUST have mode -rw-r--r-- and mount type set to tmpfs and the contents MUST be readable.
|
Description: A Pod created with an 'emptyDir' Volume, the volume mode set to 0644. The volume MUST have mode -rw-r--r-- and mount type set to tmpfs and the contents MUST be readable.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should support (root,0644,default) [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should support (root,0644,default) [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doTest0644(ctx, f, 0, v1.StorageMediumDefault)
|
doTest0644(ctx, f, 0, v1.StorageMediumDefault)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -175,7 +177,7 @@ var _ = SIGDescribe("EmptyDir volumes", func() {
|
|||||||
Description: A Pod created with an 'emptyDir' Volume, the volume mode set to 0666. The volume MUST have mode -rw-rw-rw- and mount type set to tmpfs and the contents MUST be readable.
|
Description: A Pod created with an 'emptyDir' Volume, the volume mode set to 0666. The volume MUST have mode -rw-rw-rw- and mount type set to tmpfs and the contents MUST be readable.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should support (root,0666,default) [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should support (root,0666,default) [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doTest0666(ctx, f, 0, v1.StorageMediumDefault)
|
doTest0666(ctx, f, 0, v1.StorageMediumDefault)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -185,7 +187,7 @@ var _ = SIGDescribe("EmptyDir volumes", func() {
|
|||||||
Description: A Pod created with an 'emptyDir' Volume, the volume mode set to 0777. The volume MUST have mode set as -rwxrwxrwx and mount type set to tmpfs and the contents MUST be readable.
|
Description: A Pod created with an 'emptyDir' Volume, the volume mode set to 0777. The volume MUST have mode set as -rwxrwxrwx and mount type set to tmpfs and the contents MUST be readable.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should support (root,0777,default) [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should support (root,0777,default) [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doTest0777(ctx, f, 0, v1.StorageMediumDefault)
|
doTest0777(ctx, f, 0, v1.StorageMediumDefault)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -195,7 +197,7 @@ var _ = SIGDescribe("EmptyDir volumes", func() {
|
|||||||
Description: A Pod created with an 'emptyDir' Volume, the volume mode set to 0644. Volume is mounted into the container where container is run as a non-root user. The volume MUST have mode -rw-r--r-- and mount type set to tmpfs and the contents MUST be readable.
|
Description: A Pod created with an 'emptyDir' Volume, the volume mode set to 0644. Volume is mounted into the container where container is run as a non-root user. The volume MUST have mode -rw-r--r-- and mount type set to tmpfs and the contents MUST be readable.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should support (non-root,0644,default) [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should support (non-root,0644,default) [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doTest0644(ctx, f, nonRootUID, v1.StorageMediumDefault)
|
doTest0644(ctx, f, nonRootUID, v1.StorageMediumDefault)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -205,7 +207,7 @@ var _ = SIGDescribe("EmptyDir volumes", func() {
|
|||||||
Description: A Pod created with an 'emptyDir' Volume, the volume mode set to 0666. Volume is mounted into the container where container is run as a non-root user. The volume MUST have mode -rw-rw-rw- and mount type set to tmpfs and the contents MUST be readable.
|
Description: A Pod created with an 'emptyDir' Volume, the volume mode set to 0666. Volume is mounted into the container where container is run as a non-root user. The volume MUST have mode -rw-rw-rw- and mount type set to tmpfs and the contents MUST be readable.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should support (non-root,0666,default) [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should support (non-root,0666,default) [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doTest0666(ctx, f, nonRootUID, v1.StorageMediumDefault)
|
doTest0666(ctx, f, nonRootUID, v1.StorageMediumDefault)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -215,7 +217,7 @@ var _ = SIGDescribe("EmptyDir volumes", func() {
|
|||||||
Description: A Pod created with an 'emptyDir' Volume, the volume mode set to 0777. Volume is mounted into the container where container is run as a non-root user. The volume MUST have mode -rwxrwxrwx and mount type set to tmpfs and the contents MUST be readable.
|
Description: A Pod created with an 'emptyDir' Volume, the volume mode set to 0777. Volume is mounted into the container where container is run as a non-root user. The volume MUST have mode -rwxrwxrwx and mount type set to tmpfs and the contents MUST be readable.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should support (non-root,0777,default) [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should support (non-root,0777,default) [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doTest0777(ctx, f, nonRootUID, v1.StorageMediumDefault)
|
doTest0777(ctx, f, nonRootUID, v1.StorageMediumDefault)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ var _ = SIGDescribe("HostPath", func() {
|
|||||||
Create a Pod with host volume mounted. The volume mounted MUST be a directory with permissions mode -rwxrwxrwx and that is has the sticky bit (mode flag t) set.
|
Create a Pod with host volume mounted. The volume mounted MUST be a directory with permissions mode -rwxrwxrwx and that is has the sticky bit (mode flag t) set.
|
||||||
This test is marked LinuxOnly since Windows does not support setting the sticky bit (mode flag t).
|
This test is marked LinuxOnly since Windows does not support setting the sticky bit (mode flag t).
|
||||||
*/
|
*/
|
||||||
ginkgo.It("should give a volume the correct mode [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
f.It("should give a volume the correct mode [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
source := &v1.HostPathVolumeSource{
|
source := &v1.HostPathVolumeSource{
|
||||||
Path: "/tmp",
|
Path: "/tmp",
|
||||||
}
|
}
|
||||||
@ -66,7 +66,7 @@ var _ = SIGDescribe("HostPath", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// This test requires mounting a folder into a container with write privileges.
|
// This test requires mounting a folder into a container with write privileges.
|
||||||
ginkgo.It("should support r/w [NodeConformance]", func(ctx context.Context) {
|
f.It("should support r/w", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
filePath := path.Join(volumePath, "test-file")
|
filePath := path.Join(volumePath, "test-file")
|
||||||
retryDuration := 180
|
retryDuration := 180
|
||||||
source := &v1.HostPathVolumeSource{
|
source := &v1.HostPathVolumeSource{
|
||||||
@ -94,7 +94,7 @@ var _ = SIGDescribe("HostPath", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should support subPath [NodeConformance]", func(ctx context.Context) {
|
f.It("should support subPath", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
subPath := "sub-path"
|
subPath := "sub-path"
|
||||||
fileName := "test-file"
|
fileName := "test-file"
|
||||||
retryDuration := 180
|
retryDuration := 180
|
||||||
|
@ -41,7 +41,7 @@ var _ = SIGDescribe("Projected combined", func() {
|
|||||||
Testname: Projected Volume, multiple projections
|
Testname: Projected Volume, multiple projections
|
||||||
Description: A Pod is created with a projected volume source for secrets, configMap and downwardAPI with pod name, cpu and memory limits and cpu and memory requests. Pod MUST be able to read the secrets, configMap values and the cpu and memory limits as well as cpu and memory requests from the mounted DownwardAPIVolumeFiles.
|
Description: A Pod is created with a projected volume source for secrets, configMap and downwardAPI with pod name, cpu and memory limits and cpu and memory requests. Pod MUST be able to read the secrets, configMap values and the cpu and memory limits as well as cpu and memory requests from the mounted DownwardAPIVolumeFiles.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should project all components that make up the projection API [Projection][NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should project all components that make up the projection API [Projection]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
var err error
|
var err error
|
||||||
podName := "projected-volume-" + string(uuid.NewUUID())
|
podName := "projected-volume-" + string(uuid.NewUUID())
|
||||||
secretName := "secret-projected-all-test-volume-" + string(uuid.NewUUID())
|
secretName := "secret-projected-all-test-volume-" + string(uuid.NewUUID())
|
||||||
|
@ -28,6 +28,7 @@ import (
|
|||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
|
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
|
"k8s.io/kubernetes/test/e2e/nodefeature"
|
||||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
|
|
||||||
@ -44,7 +45,7 @@ var _ = SIGDescribe("Projected configMap", func() {
|
|||||||
Testname: Projected Volume, ConfigMap, volume mode default
|
Testname: Projected Volume, ConfigMap, volume mode default
|
||||||
Description: A Pod is created with projected volume source 'ConfigMap' to store a configMap with default permission mode. Pod MUST be able to read the content of the ConfigMap successfully and the mode on the volume MUST be -rw-r--r--.
|
Description: A Pod is created with projected volume source 'ConfigMap' to store a configMap with default permission mode. Pod MUST be able to read the content of the ConfigMap successfully and the mode on the volume MUST be -rw-r--r--.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doProjectedConfigMapE2EWithoutMappings(ctx, f, false, 0, nil)
|
doProjectedConfigMapE2EWithoutMappings(ctx, f, false, 0, nil)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -54,12 +55,12 @@ var _ = SIGDescribe("Projected configMap", func() {
|
|||||||
Description: A Pod is created with projected volume source 'ConfigMap' to store a configMap with permission mode set to 0400. Pod MUST be able to read the content of the ConfigMap successfully and the mode on the volume MUST be -r--------.
|
Description: A Pod is created with projected volume source 'ConfigMap' to store a configMap with permission mode set to 0400. Pod MUST be able to read the content of the ConfigMap successfully and the mode on the volume MUST be -r--------.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume with defaultMode set [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume with defaultMode set [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
defaultMode := int32(0400)
|
defaultMode := int32(0400)
|
||||||
doProjectedConfigMapE2EWithoutMappings(ctx, f, false, 0, &defaultMode)
|
doProjectedConfigMapE2EWithoutMappings(ctx, f, false, 0, &defaultMode)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should be consumable from pods in volume as non-root with defaultMode and fsGroup set [LinuxOnly] [NodeFeature:FSGroup]", func(ctx context.Context) {
|
f.It("should be consumable from pods in volume as non-root with defaultMode and fsGroup set [LinuxOnly]", nodefeature.FSGroup, func(ctx context.Context) {
|
||||||
// Windows does not support RunAsUser / FSGroup SecurityContext options, and it does not support setting file permissions.
|
// Windows does not support RunAsUser / FSGroup SecurityContext options, and it does not support setting file permissions.
|
||||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||||
defaultMode := int32(0440) /* setting fsGroup sets mode to at least 440 */
|
defaultMode := int32(0440) /* setting fsGroup sets mode to at least 440 */
|
||||||
@ -71,11 +72,11 @@ var _ = SIGDescribe("Projected configMap", func() {
|
|||||||
Testname: Projected Volume, ConfigMap, non-root user
|
Testname: Projected Volume, ConfigMap, non-root user
|
||||||
Description: A Pod is created with projected volume source 'ConfigMap' to store a configMap as non-root user with uid 1000. Pod MUST be able to read the content of the ConfigMap successfully and the mode on the volume MUST be -rw-r--r--.
|
Description: A Pod is created with projected volume source 'ConfigMap' to store a configMap as non-root user with uid 1000. Pod MUST be able to read the content of the ConfigMap successfully and the mode on the volume MUST be -rw-r--r--.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume as non-root [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume as non-root", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doProjectedConfigMapE2EWithoutMappings(ctx, f, true, 0, nil)
|
doProjectedConfigMapE2EWithoutMappings(ctx, f, true, 0, nil)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should be consumable from pods in volume as non-root with FSGroup [LinuxOnly] [NodeFeature:FSGroup]", func(ctx context.Context) {
|
f.It("should be consumable from pods in volume as non-root with FSGroup [LinuxOnly]", nodefeature.FSGroup, func(ctx context.Context) {
|
||||||
// Windows does not support RunAsUser / FSGroup SecurityContext options.
|
// Windows does not support RunAsUser / FSGroup SecurityContext options.
|
||||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||||
doProjectedConfigMapE2EWithoutMappings(ctx, f, true, 1001, nil)
|
doProjectedConfigMapE2EWithoutMappings(ctx, f, true, 1001, nil)
|
||||||
@ -86,7 +87,7 @@ var _ = SIGDescribe("Projected configMap", func() {
|
|||||||
Testname: Projected Volume, ConfigMap, mapped
|
Testname: Projected Volume, ConfigMap, mapped
|
||||||
Description: A Pod is created with projected volume source 'ConfigMap' to store a configMap with default permission mode. The ConfigMap is also mapped to a custom path. Pod MUST be able to read the content of the ConfigMap from the custom location successfully and the mode on the volume MUST be -rw-r--r--.
|
Description: A Pod is created with projected volume source 'ConfigMap' to store a configMap with default permission mode. The ConfigMap is also mapped to a custom path. Pod MUST be able to read the content of the ConfigMap from the custom location successfully and the mode on the volume MUST be -rw-r--r--.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume with mappings [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume with mappings", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doProjectedConfigMapE2EWithMappings(ctx, f, false, 0, nil)
|
doProjectedConfigMapE2EWithMappings(ctx, f, false, 0, nil)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -96,7 +97,7 @@ var _ = SIGDescribe("Projected configMap", func() {
|
|||||||
Description: A Pod is created with projected volume source 'ConfigMap' to store a configMap with permission mode set to 0400. The ConfigMap is also mapped to a custom path. Pod MUST be able to read the content of the ConfigMap from the custom location successfully and the mode on the volume MUST be -r--r--r--.
|
Description: A Pod is created with projected volume source 'ConfigMap' to store a configMap with permission mode set to 0400. The ConfigMap is also mapped to a custom path. Pod MUST be able to read the content of the ConfigMap from the custom location successfully and the mode on the volume MUST be -r--r--r--.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume with mappings and Item mode set [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume with mappings and Item mode set [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
mode := int32(0400)
|
mode := int32(0400)
|
||||||
doProjectedConfigMapE2EWithMappings(ctx, f, false, 0, &mode)
|
doProjectedConfigMapE2EWithMappings(ctx, f, false, 0, &mode)
|
||||||
})
|
})
|
||||||
@ -106,11 +107,11 @@ var _ = SIGDescribe("Projected configMap", func() {
|
|||||||
Testname: Projected Volume, ConfigMap, mapped, non-root user
|
Testname: Projected Volume, ConfigMap, mapped, non-root user
|
||||||
Description: A Pod is created with projected volume source 'ConfigMap' to store a configMap as non-root user with uid 1000. The ConfigMap is also mapped to a custom path. Pod MUST be able to read the content of the ConfigMap from the custom location successfully and the mode on the volume MUST be -r--r--r--.
|
Description: A Pod is created with projected volume source 'ConfigMap' to store a configMap as non-root user with uid 1000. The ConfigMap is also mapped to a custom path. Pod MUST be able to read the content of the ConfigMap from the custom location successfully and the mode on the volume MUST be -r--r--r--.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume with mappings as non-root [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume with mappings as non-root", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doProjectedConfigMapE2EWithMappings(ctx, f, true, 0, nil)
|
doProjectedConfigMapE2EWithMappings(ctx, f, true, 0, nil)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should be consumable from pods in volume with mappings as non-root with FSGroup [LinuxOnly] [NodeFeature:FSGroup]", func(ctx context.Context) {
|
f.It("should be consumable from pods in volume with mappings as non-root with FSGroup [LinuxOnly]", nodefeature.FSGroup, func(ctx context.Context) {
|
||||||
// Windows does not support RunAsUser / FSGroup SecurityContext options.
|
// Windows does not support RunAsUser / FSGroup SecurityContext options.
|
||||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||||
doProjectedConfigMapE2EWithMappings(ctx, f, true, 1001, nil)
|
doProjectedConfigMapE2EWithMappings(ctx, f, true, 1001, nil)
|
||||||
@ -121,7 +122,7 @@ var _ = SIGDescribe("Projected configMap", func() {
|
|||||||
Testname: Projected Volume, ConfigMap, update
|
Testname: Projected Volume, ConfigMap, update
|
||||||
Description: A Pod is created with projected volume source 'ConfigMap' to store a configMap and performs a create and update to new value. Pod MUST be able to create the configMap with value-1. Pod MUST be able to update the value in the confgiMap to value-2.
|
Description: A Pod is created with projected volume source 'ConfigMap' to store a configMap and performs a create and update to new value. Pod MUST be able to create the configMap with value-1. Pod MUST be able to update the value in the confgiMap to value-2.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("updates should be reflected in volume [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("updates should be reflected in volume", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podLogTimeout := e2epod.GetPodSecretUpdateTimeout(ctx, f.ClientSet)
|
podLogTimeout := e2epod.GetPodSecretUpdateTimeout(ctx, f.ClientSet)
|
||||||
containerTimeoutArg := fmt.Sprintf("--retry_time=%v", int(podLogTimeout.Seconds()))
|
containerTimeoutArg := fmt.Sprintf("--retry_time=%v", int(podLogTimeout.Seconds()))
|
||||||
|
|
||||||
@ -171,7 +172,7 @@ var _ = SIGDescribe("Projected configMap", func() {
|
|||||||
Testname: Projected Volume, ConfigMap, create, update and delete
|
Testname: Projected Volume, ConfigMap, create, update and delete
|
||||||
Description: Create a Pod with three containers with ConfigMaps namely a create, update and delete container. Create Container when started MUST not have configMap, update and delete containers MUST be created with a ConfigMap value as 'value-1'. Create a configMap in the create container, the Pod MUST be able to read the configMap from the create container. Update the configMap in the update container, Pod MUST be able to read the updated configMap value. Delete the configMap in the delete container. Pod MUST fail to read the configMap from the delete container.
|
Description: Create a Pod with three containers with ConfigMaps namely a create, update and delete container. Create Container when started MUST not have configMap, update and delete containers MUST be created with a ConfigMap value as 'value-1'. Create a configMap in the create container, the Pod MUST be able to read the configMap from the create container. Update the configMap in the update container, Pod MUST be able to read the updated configMap value. Delete the configMap in the delete container. Pod MUST fail to read the configMap from the delete container.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("optional updates should be reflected in volume [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("optional updates should be reflected in volume", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podLogTimeout := e2epod.GetPodSecretUpdateTimeout(ctx, f.ClientSet)
|
podLogTimeout := e2epod.GetPodSecretUpdateTimeout(ctx, f.ClientSet)
|
||||||
containerTimeoutArg := fmt.Sprintf("--retry_time=%v", int(podLogTimeout.Seconds()))
|
containerTimeoutArg := fmt.Sprintf("--retry_time=%v", int(podLogTimeout.Seconds()))
|
||||||
trueVal := true
|
trueVal := true
|
||||||
@ -372,7 +373,7 @@ var _ = SIGDescribe("Projected configMap", func() {
|
|||||||
Testname: Projected Volume, ConfigMap, multiple volume paths
|
Testname: Projected Volume, ConfigMap, multiple volume paths
|
||||||
Description: A Pod is created with a projected volume source 'ConfigMap' to store a configMap. The configMap is mapped to two different volume mounts. Pod MUST be able to read the content of the configMap successfully from the two volume mounts.
|
Description: A Pod is created with a projected volume source 'ConfigMap' to store a configMap. The configMap is mapped to two different volume mounts. Pod MUST be able to read the content of the configMap successfully from the two volume mounts.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable in multiple volumes in the same pod [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable in multiple volumes in the same pod", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
var (
|
var (
|
||||||
name = "projected-configmap-test-volume-" + string(uuid.NewUUID())
|
name = "projected-configmap-test-volume-" + string(uuid.NewUUID())
|
||||||
volumeName = "projected-configmap-volume"
|
volumeName = "projected-configmap-volume"
|
||||||
@ -460,7 +461,7 @@ var _ = SIGDescribe("Projected configMap", func() {
|
|||||||
//The pod is in pending during volume creation until the configMap objects are available
|
//The pod is in pending during volume creation until the configMap objects are available
|
||||||
//or until mount the configMap volume times out. There is no configMap object defined for the pod, so it should return timeout exception unless it is marked optional.
|
//or until mount the configMap volume times out. There is no configMap object defined for the pod, so it should return timeout exception unless it is marked optional.
|
||||||
//Slow (~5 mins)
|
//Slow (~5 mins)
|
||||||
ginkgo.It("Should fail non-optional pod creation due to configMap object does not exist [Slow]", func(ctx context.Context) {
|
f.It("Should fail non-optional pod creation due to configMap object does not exist", f.WithSlow(), func(ctx context.Context) {
|
||||||
volumeMountPath := "/etc/projected-configmap-volumes"
|
volumeMountPath := "/etc/projected-configmap-volumes"
|
||||||
pod := createNonOptionalConfigMapPod(ctx, f, volumeMountPath)
|
pod := createNonOptionalConfigMapPod(ctx, f, volumeMountPath)
|
||||||
getPod := e2epod.Get(f.ClientSet, pod)
|
getPod := e2epod.Get(f.ClientSet, pod)
|
||||||
@ -470,7 +471,7 @@ var _ = SIGDescribe("Projected configMap", func() {
|
|||||||
//ConfigMap object defined for the pod, If a key is specified which is not present in the ConfigMap,
|
//ConfigMap object defined for the pod, If a key is specified which is not present in the ConfigMap,
|
||||||
// the volume setup will error unless it is marked optional, during the pod creation.
|
// the volume setup will error unless it is marked optional, during the pod creation.
|
||||||
//Slow (~5 mins)
|
//Slow (~5 mins)
|
||||||
ginkgo.It("Should fail non-optional pod creation due to the key in the configMap object does not exist [Slow]", func(ctx context.Context) {
|
f.It("Should fail non-optional pod creation due to the key in the configMap object does not exist", f.WithSlow(), func(ctx context.Context) {
|
||||||
volumeMountPath := "/etc/configmap-volumes"
|
volumeMountPath := "/etc/configmap-volumes"
|
||||||
pod := createNonOptionalConfigMapPodWithConfig(ctx, f, volumeMountPath)
|
pod := createNonOptionalConfigMapPodWithConfig(ctx, f, volumeMountPath)
|
||||||
getPod := e2epod.Get(f.ClientSet, pod)
|
getPod := e2epod.Get(f.ClientSet, pod)
|
||||||
|
@ -28,6 +28,7 @@ import (
|
|||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
|
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
|
"k8s.io/kubernetes/test/e2e/nodefeature"
|
||||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
|
|
||||||
@ -51,7 +52,7 @@ var _ = SIGDescribe("Projected downwardAPI", func() {
|
|||||||
Testname: Projected Volume, DownwardAPI, pod name
|
Testname: Projected Volume, DownwardAPI, pod name
|
||||||
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests. Pod MUST be able to read the pod name from the mounted DownwardAPIVolumeFiles.
|
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests. Pod MUST be able to read the pod name from the mounted DownwardAPIVolumeFiles.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide podname only [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide podname only", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
||||||
pod := downwardAPIVolumePodForSimpleTest(podName, "/etc/podinfo/podname")
|
pod := downwardAPIVolumePodForSimpleTest(podName, "/etc/podinfo/podname")
|
||||||
|
|
||||||
@ -66,7 +67,7 @@ var _ = SIGDescribe("Projected downwardAPI", func() {
|
|||||||
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests. The default mode for the volume mount is set to 0400. Pod MUST be able to read the pod name from the mounted DownwardAPIVolumeFiles and the volume mode must be -r--------.
|
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests. The default mode for the volume mount is set to 0400. Pod MUST be able to read the pod name from the mounted DownwardAPIVolumeFiles and the volume mode must be -r--------.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should set DefaultMode on files [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should set DefaultMode on files [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
||||||
defaultMode := int32(0400)
|
defaultMode := int32(0400)
|
||||||
pod := projectedDownwardAPIVolumePodForModeTest(podName, "/etc/podinfo/podname", nil, &defaultMode)
|
pod := projectedDownwardAPIVolumePodForModeTest(podName, "/etc/podinfo/podname", nil, &defaultMode)
|
||||||
@ -82,7 +83,7 @@ var _ = SIGDescribe("Projected downwardAPI", func() {
|
|||||||
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests. The default mode for the volume mount is set to 0400. Pod MUST be able to read the pod name from the mounted DownwardAPIVolumeFiles and the volume mode must be -r--------.
|
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests. The default mode for the volume mount is set to 0400. Pod MUST be able to read the pod name from the mounted DownwardAPIVolumeFiles and the volume mode must be -r--------.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should set mode on item file [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should set mode on item file [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
||||||
mode := int32(0400)
|
mode := int32(0400)
|
||||||
pod := projectedDownwardAPIVolumePodForModeTest(podName, "/etc/podinfo/podname", &mode, nil)
|
pod := projectedDownwardAPIVolumePodForModeTest(podName, "/etc/podinfo/podname", &mode, nil)
|
||||||
@ -92,7 +93,7 @@ var _ = SIGDescribe("Projected downwardAPI", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should provide podname as non-root with fsgroup [LinuxOnly] [NodeFeature:FSGroup]", func(ctx context.Context) {
|
f.It("should provide podname as non-root with fsgroup [LinuxOnly]", nodefeature.FSGroup, func(ctx context.Context) {
|
||||||
// Windows does not support RunAsUser / FSGroup SecurityContext options.
|
// Windows does not support RunAsUser / FSGroup SecurityContext options.
|
||||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||||
podName := "metadata-volume-" + string(uuid.NewUUID())
|
podName := "metadata-volume-" + string(uuid.NewUUID())
|
||||||
@ -107,7 +108,7 @@ var _ = SIGDescribe("Projected downwardAPI", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should provide podname as non-root with fsgroup and defaultMode [LinuxOnly] [NodeFeature:FSGroup]", func(ctx context.Context) {
|
f.It("should provide podname as non-root with fsgroup and defaultMode [LinuxOnly]", nodefeature.FSGroup, func(ctx context.Context) {
|
||||||
// Windows does not support RunAsUser / FSGroup SecurityContext options, and it does not support setting file permissions.
|
// Windows does not support RunAsUser / FSGroup SecurityContext options, and it does not support setting file permissions.
|
||||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||||
podName := "metadata-volume-" + string(uuid.NewUUID())
|
podName := "metadata-volume-" + string(uuid.NewUUID())
|
||||||
@ -128,7 +129,7 @@ var _ = SIGDescribe("Projected downwardAPI", func() {
|
|||||||
Testname: Projected Volume, DownwardAPI, update labels
|
Testname: Projected Volume, DownwardAPI, update labels
|
||||||
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests and label items. Pod MUST be able to read the labels from the mounted DownwardAPIVolumeFiles. Labels are then updated. Pod MUST be able to read the updated values for the Labels.
|
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests and label items. Pod MUST be able to read the labels from the mounted DownwardAPIVolumeFiles. Labels are then updated. Pod MUST be able to read the updated values for the Labels.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should update labels on modification [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should update labels on modification", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
labels := map[string]string{}
|
labels := map[string]string{}
|
||||||
labels["key1"] = "value1"
|
labels["key1"] = "value1"
|
||||||
labels["key2"] = "value2"
|
labels["key2"] = "value2"
|
||||||
@ -160,7 +161,7 @@ var _ = SIGDescribe("Projected downwardAPI", func() {
|
|||||||
Testname: Projected Volume, DownwardAPI, update annotation
|
Testname: Projected Volume, DownwardAPI, update annotation
|
||||||
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests and annotation items. Pod MUST be able to read the annotations from the mounted DownwardAPIVolumeFiles. Annotations are then updated. Pod MUST be able to read the updated values for the Annotations.
|
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests and annotation items. Pod MUST be able to read the annotations from the mounted DownwardAPIVolumeFiles. Annotations are then updated. Pod MUST be able to read the updated values for the Annotations.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should update annotations on modification [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should update annotations on modification", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
annotations := map[string]string{}
|
annotations := map[string]string{}
|
||||||
annotations["builder"] = "bar"
|
annotations["builder"] = "bar"
|
||||||
podName := "annotationupdate" + string(uuid.NewUUID())
|
podName := "annotationupdate" + string(uuid.NewUUID())
|
||||||
@ -191,7 +192,7 @@ var _ = SIGDescribe("Projected downwardAPI", func() {
|
|||||||
Testname: Projected Volume, DownwardAPI, CPU limits
|
Testname: Projected Volume, DownwardAPI, CPU limits
|
||||||
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests. Pod MUST be able to read the cpu limits from the mounted DownwardAPIVolumeFiles.
|
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests. Pod MUST be able to read the cpu limits from the mounted DownwardAPIVolumeFiles.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide container's cpu limit [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide container's cpu limit", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
||||||
pod := downwardAPIVolumeForContainerResources(podName, "/etc/podinfo/cpu_limit")
|
pod := downwardAPIVolumeForContainerResources(podName, "/etc/podinfo/cpu_limit")
|
||||||
|
|
||||||
@ -205,7 +206,7 @@ var _ = SIGDescribe("Projected downwardAPI", func() {
|
|||||||
Testname: Projected Volume, DownwardAPI, memory limits
|
Testname: Projected Volume, DownwardAPI, memory limits
|
||||||
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests. Pod MUST be able to read the memory limits from the mounted DownwardAPIVolumeFiles.
|
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests. Pod MUST be able to read the memory limits from the mounted DownwardAPIVolumeFiles.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide container's memory limit [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide container's memory limit", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
||||||
pod := downwardAPIVolumeForContainerResources(podName, "/etc/podinfo/memory_limit")
|
pod := downwardAPIVolumeForContainerResources(podName, "/etc/podinfo/memory_limit")
|
||||||
|
|
||||||
@ -219,7 +220,7 @@ var _ = SIGDescribe("Projected downwardAPI", func() {
|
|||||||
Testname: Projected Volume, DownwardAPI, CPU request
|
Testname: Projected Volume, DownwardAPI, CPU request
|
||||||
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests. Pod MUST be able to read the cpu request from the mounted DownwardAPIVolumeFiles.
|
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests. Pod MUST be able to read the cpu request from the mounted DownwardAPIVolumeFiles.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide container's cpu request [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide container's cpu request", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
||||||
pod := downwardAPIVolumeForContainerResources(podName, "/etc/podinfo/cpu_request")
|
pod := downwardAPIVolumeForContainerResources(podName, "/etc/podinfo/cpu_request")
|
||||||
|
|
||||||
@ -233,7 +234,7 @@ var _ = SIGDescribe("Projected downwardAPI", func() {
|
|||||||
Testname: Projected Volume, DownwardAPI, memory request
|
Testname: Projected Volume, DownwardAPI, memory request
|
||||||
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests. Pod MUST be able to read the memory request from the mounted DownwardAPIVolumeFiles.
|
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests. Pod MUST be able to read the memory request from the mounted DownwardAPIVolumeFiles.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide container's memory request [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide container's memory request", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
||||||
pod := downwardAPIVolumeForContainerResources(podName, "/etc/podinfo/memory_request")
|
pod := downwardAPIVolumeForContainerResources(podName, "/etc/podinfo/memory_request")
|
||||||
|
|
||||||
@ -247,7 +248,7 @@ var _ = SIGDescribe("Projected downwardAPI", func() {
|
|||||||
Testname: Projected Volume, DownwardAPI, CPU limit, node allocatable
|
Testname: Projected Volume, DownwardAPI, CPU limit, node allocatable
|
||||||
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests. The CPU and memory resources for requests and limits are NOT specified for the container. Pod MUST be able to read the default cpu limits from the mounted DownwardAPIVolumeFiles.
|
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests. The CPU and memory resources for requests and limits are NOT specified for the container. Pod MUST be able to read the default cpu limits from the mounted DownwardAPIVolumeFiles.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide node allocatable (cpu) as default cpu limit if the limit is not set [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide node allocatable (cpu) as default cpu limit if the limit is not set", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
||||||
pod := downwardAPIVolumeForDefaultContainerResources(podName, "/etc/podinfo/cpu_limit")
|
pod := downwardAPIVolumeForDefaultContainerResources(podName, "/etc/podinfo/cpu_limit")
|
||||||
|
|
||||||
@ -259,7 +260,7 @@ var _ = SIGDescribe("Projected downwardAPI", func() {
|
|||||||
Testname: Projected Volume, DownwardAPI, memory limit, node allocatable
|
Testname: Projected Volume, DownwardAPI, memory limit, node allocatable
|
||||||
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests. The CPU and memory resources for requests and limits are NOT specified for the container. Pod MUST be able to read the default memory limits from the mounted DownwardAPIVolumeFiles.
|
Description: A Pod is created with a projected volume source for downwardAPI with pod name, cpu and memory limits and cpu and memory requests. The CPU and memory resources for requests and limits are NOT specified for the container. Pod MUST be able to read the default memory limits from the mounted DownwardAPIVolumeFiles.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should provide node allocatable (memory) as default memory limit if the limit is not set [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should provide node allocatable (memory) as default memory limit if the limit is not set", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
podName := "downwardapi-volume-" + string(uuid.NewUUID())
|
||||||
pod := downwardAPIVolumeForDefaultContainerResources(podName, "/etc/podinfo/memory_limit")
|
pod := downwardAPIVolumeForDefaultContainerResources(podName, "/etc/podinfo/memory_limit")
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ var _ = SIGDescribe("Projected secret", func() {
|
|||||||
Testname: Projected Volume, Secrets, volume mode default
|
Testname: Projected Volume, Secrets, volume mode default
|
||||||
Description: A Pod is created with a projected volume source 'secret' to store a secret with a specified key with default permission mode. Pod MUST be able to read the content of the key successfully and the mode MUST be -rw-r--r-- by default.
|
Description: A Pod is created with a projected volume source 'secret' to store a secret with a specified key with default permission mode. Pod MUST be able to read the content of the key successfully and the mode MUST be -rw-r--r-- by default.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doProjectedSecretE2EWithoutMapping(ctx, f, nil /* default mode */, "projected-secret-test-"+string(uuid.NewUUID()), nil, nil)
|
doProjectedSecretE2EWithoutMapping(ctx, f, nil /* default mode */, "projected-secret-test-"+string(uuid.NewUUID()), nil, nil)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ var _ = SIGDescribe("Projected secret", func() {
|
|||||||
Description: A Pod is created with a projected volume source 'secret' to store a secret with a specified key with permission mode set to 0x400 on the Pod. Pod MUST be able to read the content of the key successfully and the mode MUST be -r--------.
|
Description: A Pod is created with a projected volume source 'secret' to store a secret with a specified key with permission mode set to 0x400 on the Pod. Pod MUST be able to read the content of the key successfully and the mode MUST be -r--------.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume with defaultMode set [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume with defaultMode set [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
defaultMode := int32(0400)
|
defaultMode := int32(0400)
|
||||||
doProjectedSecretE2EWithoutMapping(ctx, f, &defaultMode, "projected-secret-test-"+string(uuid.NewUUID()), nil, nil)
|
doProjectedSecretE2EWithoutMapping(ctx, f, &defaultMode, "projected-secret-test-"+string(uuid.NewUUID()), nil, nil)
|
||||||
})
|
})
|
||||||
@ -64,7 +64,7 @@ var _ = SIGDescribe("Projected secret", func() {
|
|||||||
Description: A Pod is created with a projected volume source 'secret' to store a secret with a specified key. The volume has permission mode set to 0440, fsgroup set to 1001 and user set to non-root uid of 1000. Pod MUST be able to read the content of the key successfully and the mode MUST be -r--r-----.
|
Description: A Pod is created with a projected volume source 'secret' to store a secret with a specified key. The volume has permission mode set to 0440, fsgroup set to 1001 and user set to non-root uid of 1000. Pod MUST be able to read the content of the key successfully and the mode MUST be -r--r-----.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume as non-root with defaultMode and fsGroup set [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume as non-root with defaultMode and fsGroup set [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
defaultMode := int32(0440) /* setting fsGroup sets mode to at least 440 */
|
defaultMode := int32(0440) /* setting fsGroup sets mode to at least 440 */
|
||||||
fsGroup := int64(1001)
|
fsGroup := int64(1001)
|
||||||
doProjectedSecretE2EWithoutMapping(ctx, f, &defaultMode, "projected-secret-test-"+string(uuid.NewUUID()), &fsGroup, &nonRootTestUserID)
|
doProjectedSecretE2EWithoutMapping(ctx, f, &defaultMode, "projected-secret-test-"+string(uuid.NewUUID()), &fsGroup, &nonRootTestUserID)
|
||||||
@ -75,7 +75,7 @@ var _ = SIGDescribe("Projected secret", func() {
|
|||||||
Testname: Projected Volume, Secrets, mapped
|
Testname: Projected Volume, Secrets, mapped
|
||||||
Description: A Pod is created with a projected volume source 'secret' to store a secret with a specified key with default permission mode. The secret is also mapped to a custom path. Pod MUST be able to read the content of the key successfully and the mode MUST be -r--------on the mapped volume.
|
Description: A Pod is created with a projected volume source 'secret' to store a secret with a specified key with default permission mode. The secret is also mapped to a custom path. Pod MUST be able to read the content of the key successfully and the mode MUST be -r--------on the mapped volume.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume with mappings [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume with mappings", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doProjectedSecretE2EWithMapping(ctx, f, nil)
|
doProjectedSecretE2EWithMapping(ctx, f, nil)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -85,12 +85,12 @@ var _ = SIGDescribe("Projected secret", func() {
|
|||||||
Description: A Pod is created with a projected volume source 'secret' to store a secret with a specified key with permission mode set to 0400. The secret is also mapped to a specific name. Pod MUST be able to read the content of the key successfully and the mode MUST be -r-------- on the mapped volume.
|
Description: A Pod is created with a projected volume source 'secret' to store a secret with a specified key with permission mode set to 0400. The secret is also mapped to a specific name. Pod MUST be able to read the content of the key successfully and the mode MUST be -r-------- on the mapped volume.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume with mappings and Item Mode set [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume with mappings and Item Mode set [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
mode := int32(0400)
|
mode := int32(0400)
|
||||||
doProjectedSecretE2EWithMapping(ctx, f, &mode)
|
doProjectedSecretE2EWithMapping(ctx, f, &mode)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should be able to mount in a volume regardless of a different secret existing with same name in different namespace [NodeConformance]", func(ctx context.Context) {
|
f.It("should be able to mount in a volume regardless of a different secret existing with same name in different namespace", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
var (
|
var (
|
||||||
namespace2 *v1.Namespace
|
namespace2 *v1.Namespace
|
||||||
err error
|
err error
|
||||||
@ -116,7 +116,7 @@ var _ = SIGDescribe("Projected secret", func() {
|
|||||||
Testname: Projected Volume, Secrets, mapped, multiple paths
|
Testname: Projected Volume, Secrets, mapped, multiple paths
|
||||||
Description: A Pod is created with a projected volume source 'secret' to store a secret with a specified key. The secret is mapped to two different volume mounts. Pod MUST be able to read the content of the key successfully from the two volume mounts and the mode MUST be -r-------- on the mapped volumes.
|
Description: A Pod is created with a projected volume source 'secret' to store a secret with a specified key. The secret is mapped to two different volume mounts. Pod MUST be able to read the content of the key successfully from the two volume mounts and the mode MUST be -r-------- on the mapped volumes.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable in multiple volumes in a pod [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable in multiple volumes in a pod", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
// This test ensures that the same secret can be mounted in multiple
|
// This test ensures that the same secret can be mounted in multiple
|
||||||
// volumes in the same pod. This test case exists to prevent
|
// volumes in the same pod. This test case exists to prevent
|
||||||
// regressions that break this use-case.
|
// regressions that break this use-case.
|
||||||
@ -212,7 +212,7 @@ var _ = SIGDescribe("Projected secret", func() {
|
|||||||
Testname: Projected Volume, Secrets, create, update delete
|
Testname: Projected Volume, Secrets, create, update delete
|
||||||
Description: Create a Pod with three containers with secrets namely a create, update and delete container. Create Container when started MUST no have a secret, update and delete containers MUST be created with a secret value. Create a secret in the create container, the Pod MUST be able to read the secret from the create container. Update the secret in the update container, Pod MUST be able to read the updated secret value. Delete the secret in the delete container. Pod MUST fail to read the secret from the delete container.
|
Description: Create a Pod with three containers with secrets namely a create, update and delete container. Create Container when started MUST no have a secret, update and delete containers MUST be created with a secret value. Create a secret in the create container, the Pod MUST be able to read the secret from the create container. Update the secret in the update container, Pod MUST be able to read the updated secret value. Delete the secret in the delete container. Pod MUST fail to read the secret from the delete container.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("optional updates should be reflected in volume [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("optional updates should be reflected in volume", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podLogTimeout := e2epod.GetPodSecretUpdateTimeout(ctx, f.ClientSet)
|
podLogTimeout := e2epod.GetPodSecretUpdateTimeout(ctx, f.ClientSet)
|
||||||
containerTimeoutArg := fmt.Sprintf("--retry_time=%v", int(podLogTimeout.Seconds()))
|
containerTimeoutArg := fmt.Sprintf("--retry_time=%v", int(podLogTimeout.Seconds()))
|
||||||
trueVal := true
|
trueVal := true
|
||||||
@ -411,7 +411,7 @@ var _ = SIGDescribe("Projected secret", func() {
|
|||||||
//The secret is in pending during volume creation until the secret objects are available
|
//The secret is in pending during volume creation until the secret objects are available
|
||||||
//or until mount the secret volume times out. There is no secret object defined for the pod, so it should return timeout exception unless it is marked optional.
|
//or until mount the secret volume times out. There is no secret object defined for the pod, so it should return timeout exception unless it is marked optional.
|
||||||
//Slow (~5 mins)
|
//Slow (~5 mins)
|
||||||
ginkgo.It("Should fail non-optional pod creation due to secret object does not exist [Slow]", func(ctx context.Context) {
|
f.It("Should fail non-optional pod creation due to secret object does not exist", f.WithSlow(), func(ctx context.Context) {
|
||||||
volumeMountPath := "/etc/projected-secret-volumes"
|
volumeMountPath := "/etc/projected-secret-volumes"
|
||||||
podName := "pod-secrets-" + string(uuid.NewUUID())
|
podName := "pod-secrets-" + string(uuid.NewUUID())
|
||||||
pod := createNonOptionalSecretPod(ctx, f, volumeMountPath, podName)
|
pod := createNonOptionalSecretPod(ctx, f, volumeMountPath, podName)
|
||||||
@ -422,7 +422,7 @@ var _ = SIGDescribe("Projected secret", func() {
|
|||||||
//Secret object defined for the pod, If a key is specified which is not present in the secret,
|
//Secret object defined for the pod, If a key is specified which is not present in the secret,
|
||||||
// the volume setup will error unless it is marked optional, during the pod creation.
|
// the volume setup will error unless it is marked optional, during the pod creation.
|
||||||
//Slow (~5 mins)
|
//Slow (~5 mins)
|
||||||
ginkgo.It("Should fail non-optional pod creation due to the key in the secret object does not exist [Slow]", func(ctx context.Context) {
|
f.It("Should fail non-optional pod creation due to the key in the secret object does not exist", f.WithSlow(), func(ctx context.Context) {
|
||||||
volumeMountPath := "/etc/secret-volumes"
|
volumeMountPath := "/etc/secret-volumes"
|
||||||
podName := "pod-secrets-" + string(uuid.NewUUID())
|
podName := "pod-secrets-" + string(uuid.NewUUID())
|
||||||
pod := createNonOptionalSecretPodWithSecret(ctx, f, volumeMountPath, podName)
|
pod := createNonOptionalSecretPodWithSecret(ctx, f, volumeMountPath, podName)
|
||||||
|
@ -44,7 +44,7 @@ var _ = SIGDescribe("Secrets", func() {
|
|||||||
Testname: Secrets Volume, default
|
Testname: Secrets Volume, default
|
||||||
Description: Create a secret. Create a Pod with secret volume source configured into the container. Pod MUST be able to read the secret from the mounted volume from the container runtime and the file mode of the secret MUST be -rw-r--r-- by default.
|
Description: Create a secret. Create a Pod with secret volume source configured into the container. Pod MUST be able to read the secret from the mounted volume from the container runtime and the file mode of the secret MUST be -rw-r--r-- by default.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doSecretE2EWithoutMapping(ctx, f, nil /* default mode */, "secret-test-"+string(uuid.NewUUID()), nil, nil)
|
doSecretE2EWithoutMapping(ctx, f, nil /* default mode */, "secret-test-"+string(uuid.NewUUID()), nil, nil)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ var _ = SIGDescribe("Secrets", func() {
|
|||||||
Description: Create a secret. Create a Pod with secret volume source configured into the container with file mode set to 0x400. Pod MUST be able to read the secret from the mounted volume from the container runtime and the file mode of the secret MUST be -r-------- by default.
|
Description: Create a secret. Create a Pod with secret volume source configured into the container with file mode set to 0x400. Pod MUST be able to read the secret from the mounted volume from the container runtime and the file mode of the secret MUST be -r-------- by default.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume with defaultMode set [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume with defaultMode set [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
defaultMode := int32(0400)
|
defaultMode := int32(0400)
|
||||||
doSecretE2EWithoutMapping(ctx, f, &defaultMode, "secret-test-"+string(uuid.NewUUID()), nil, nil)
|
doSecretE2EWithoutMapping(ctx, f, &defaultMode, "secret-test-"+string(uuid.NewUUID()), nil, nil)
|
||||||
})
|
})
|
||||||
@ -65,7 +65,7 @@ var _ = SIGDescribe("Secrets", func() {
|
|||||||
Description: Create a secret. Create a Pod with secret volume source configured into the container with file mode set to 0x440 as a non-root user with uid 1000 and fsGroup id 1001. Pod MUST be able to read the secret from the mounted volume from the container runtime and the file mode of the secret MUST be -r--r-----by default.
|
Description: Create a secret. Create a Pod with secret volume source configured into the container with file mode set to 0x440 as a non-root user with uid 1000 and fsGroup id 1001. Pod MUST be able to read the secret from the mounted volume from the container runtime and the file mode of the secret MUST be -r--r-----by default.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume as non-root with defaultMode and fsGroup set [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume as non-root with defaultMode and fsGroup set [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
defaultMode := int32(0440) /* setting fsGroup sets mode to at least 440 */
|
defaultMode := int32(0440) /* setting fsGroup sets mode to at least 440 */
|
||||||
fsGroup := int64(1001)
|
fsGroup := int64(1001)
|
||||||
doSecretE2EWithoutMapping(ctx, f, &defaultMode, "secret-test-"+string(uuid.NewUUID()), &fsGroup, &nonRootTestUserID)
|
doSecretE2EWithoutMapping(ctx, f, &defaultMode, "secret-test-"+string(uuid.NewUUID()), &fsGroup, &nonRootTestUserID)
|
||||||
@ -76,7 +76,7 @@ var _ = SIGDescribe("Secrets", func() {
|
|||||||
Testname: Secrets Volume, mapping
|
Testname: Secrets Volume, mapping
|
||||||
Description: Create a secret. Create a Pod with secret volume source configured into the container with a custom path. Pod MUST be able to read the secret from the mounted volume from the specified custom path. The file mode of the secret MUST be -rw-r--r-- by default.
|
Description: Create a secret. Create a Pod with secret volume source configured into the container with a custom path. Pod MUST be able to read the secret from the mounted volume from the specified custom path. The file mode of the secret MUST be -rw-r--r-- by default.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume with mappings [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume with mappings", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
doSecretE2EWithMapping(ctx, f, nil)
|
doSecretE2EWithMapping(ctx, f, nil)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ var _ = SIGDescribe("Secrets", func() {
|
|||||||
Description: Create a secret. Create a Pod with secret volume source configured into the container with a custom path and file mode set to 0x400. Pod MUST be able to read the secret from the mounted volume from the specified custom path. The file mode of the secret MUST be -r--r--r--.
|
Description: Create a secret. Create a Pod with secret volume source configured into the container with a custom path and file mode set to 0x400. Pod MUST be able to read the secret from the mounted volume from the specified custom path. The file mode of the secret MUST be -r--r--r--.
|
||||||
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
This test is marked LinuxOnly since Windows does not support setting specific file permissions.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable from pods in volume with mappings and Item Mode set [LinuxOnly] [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable from pods in volume with mappings and Item Mode set [LinuxOnly]", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
mode := int32(0400)
|
mode := int32(0400)
|
||||||
doSecretE2EWithMapping(ctx, f, &mode)
|
doSecretE2EWithMapping(ctx, f, &mode)
|
||||||
})
|
})
|
||||||
@ -96,7 +96,7 @@ var _ = SIGDescribe("Secrets", func() {
|
|||||||
Testname: Secrets Volume, volume mode default, secret with same name in different namespace
|
Testname: Secrets Volume, volume mode default, secret with same name in different namespace
|
||||||
Description: Create a secret with same name in two namespaces. Create a Pod with secret volume source configured into the container. Pod MUST be able to read the secrets from the mounted volume from the container runtime and only secrets which are associated with namespace where pod is created. The file mode of the secret MUST be -rw-r--r-- by default.
|
Description: Create a secret with same name in two namespaces. Create a Pod with secret volume source configured into the container. Pod MUST be able to read the secrets from the mounted volume from the container runtime and only secrets which are associated with namespace where pod is created. The file mode of the secret MUST be -rw-r--r-- by default.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be able to mount in a volume regardless of a different secret existing with same name in different namespace [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be able to mount in a volume regardless of a different secret existing with same name in different namespace", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
var (
|
var (
|
||||||
namespace2 *v1.Namespace
|
namespace2 *v1.Namespace
|
||||||
err error
|
err error
|
||||||
@ -122,7 +122,7 @@ var _ = SIGDescribe("Secrets", func() {
|
|||||||
Testname: Secrets Volume, mapping multiple volume paths
|
Testname: Secrets Volume, mapping multiple volume paths
|
||||||
Description: Create a secret. Create a Pod with two secret volume sources configured into the container in to two different custom paths. Pod MUST be able to read the secret from the both the mounted volumes from the two specified custom paths.
|
Description: Create a secret. Create a Pod with two secret volume sources configured into the container in to two different custom paths. Pod MUST be able to read the secret from the both the mounted volumes from the two specified custom paths.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should be consumable in multiple volumes in a pod [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("should be consumable in multiple volumes in a pod", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
// This test ensures that the same secret can be mounted in multiple
|
// This test ensures that the same secret can be mounted in multiple
|
||||||
// volumes in the same pod. This test case exists to prevent
|
// volumes in the same pod. This test case exists to prevent
|
||||||
// regressions that break this use-case.
|
// regressions that break this use-case.
|
||||||
@ -202,7 +202,7 @@ var _ = SIGDescribe("Secrets", func() {
|
|||||||
Testname: Secrets Volume, create, update and delete
|
Testname: Secrets Volume, create, update and delete
|
||||||
Description: Create a Pod with three containers with secrets volume sources namely a create, update and delete container. Create Container when started MUST not have secret, update and delete containers MUST be created with a secret value. Create a secret in the create container, the Pod MUST be able to read the secret from the create container. Update the secret in the update container, Pod MUST be able to read the updated secret value. Delete the secret in the delete container. Pod MUST fail to read the secret from the delete container.
|
Description: Create a Pod with three containers with secrets volume sources namely a create, update and delete container. Create Container when started MUST not have secret, update and delete containers MUST be created with a secret value. Create a secret in the create container, the Pod MUST be able to read the secret from the create container. Update the secret in the update container, Pod MUST be able to read the updated secret value. Delete the secret in the delete container. Pod MUST fail to read the secret from the delete container.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("optional updates should be reflected in volume [NodeConformance]", func(ctx context.Context) {
|
framework.ConformanceIt("optional updates should be reflected in volume", f.WithNodeConformance(), func(ctx context.Context) {
|
||||||
podLogTimeout := e2epod.GetPodSecretUpdateTimeout(ctx, f.ClientSet)
|
podLogTimeout := e2epod.GetPodSecretUpdateTimeout(ctx, f.ClientSet)
|
||||||
containerTimeoutArg := fmt.Sprintf("--retry_time=%v", int(podLogTimeout.Seconds()))
|
containerTimeoutArg := fmt.Sprintf("--retry_time=%v", int(podLogTimeout.Seconds()))
|
||||||
trueVal := true
|
trueVal := true
|
||||||
@ -436,7 +436,7 @@ var _ = SIGDescribe("Secrets", func() {
|
|||||||
// The secret is in pending during volume creation until the secret objects are available
|
// The secret is in pending during volume creation until the secret objects are available
|
||||||
// or until mount the secret volume times out. There is no secret object defined for the pod, so it should return timeout exception unless it is marked optional.
|
// or until mount the secret volume times out. There is no secret object defined for the pod, so it should return timeout exception unless it is marked optional.
|
||||||
// Slow (~5 mins)
|
// Slow (~5 mins)
|
||||||
ginkgo.It("Should fail non-optional pod creation due to secret object does not exist [Slow]", func(ctx context.Context) {
|
f.It("Should fail non-optional pod creation due to secret object does not exist", f.WithSlow(), func(ctx context.Context) {
|
||||||
volumeMountPath := "/etc/secret-volumes"
|
volumeMountPath := "/etc/secret-volumes"
|
||||||
podName := "pod-secrets-" + string(uuid.NewUUID())
|
podName := "pod-secrets-" + string(uuid.NewUUID())
|
||||||
pod := createNonOptionalSecretPod(ctx, f, volumeMountPath, podName)
|
pod := createNonOptionalSecretPod(ctx, f, volumeMountPath, podName)
|
||||||
@ -447,7 +447,7 @@ var _ = SIGDescribe("Secrets", func() {
|
|||||||
// Secret object defined for the pod, If a key is specified which is not present in the secret,
|
// Secret object defined for the pod, If a key is specified which is not present in the secret,
|
||||||
// the volume setup will error unless it is marked optional, during the pod creation.
|
// the volume setup will error unless it is marked optional, during the pod creation.
|
||||||
// Slow (~5 mins)
|
// Slow (~5 mins)
|
||||||
ginkgo.It("Should fail non-optional pod creation due to the key in the secret object does not exist [Slow]", func(ctx context.Context) {
|
f.It("Should fail non-optional pod creation due to the key in the secret object does not exist", f.WithSlow(), func(ctx context.Context) {
|
||||||
volumeMountPath := "/etc/secret-volumes"
|
volumeMountPath := "/etc/secret-volumes"
|
||||||
podName := "pod-secrets-" + string(uuid.NewUUID())
|
podName := "pod-secrets-" + string(uuid.NewUUID())
|
||||||
pod := createNonOptionalSecretPodWithSecret(ctx, f, volumeMountPath, podName)
|
pod := createNonOptionalSecretPodWithSecret(ctx, f, volumeMountPath, podName)
|
||||||
|
@ -35,6 +35,7 @@ import (
|
|||||||
"k8s.io/dynamic-resource-allocation/controller"
|
"k8s.io/dynamic-resource-allocation/controller"
|
||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
"k8s.io/kubernetes/test/e2e/dra/test-driver/app"
|
"k8s.io/kubernetes/test/e2e/dra/test-driver/app"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
@ -53,7 +54,7 @@ func networkResources() app.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = ginkgo.Describe("[sig-node] DRA [Feature:DynamicResourceAllocation]", func() {
|
var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, func() {
|
||||||
f := framework.NewDefaultFramework("dra")
|
f := framework.NewDefaultFramework("dra")
|
||||||
|
|
||||||
// The driver containers have to run with sufficient privileges to
|
// The driver containers have to run with sufficient privileges to
|
||||||
@ -523,7 +524,7 @@ var _ = ginkgo.Describe("[sig-node] DRA [Feature:DynamicResourceAllocation]", fu
|
|||||||
// https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/2268-non-graceful-shutdown
|
// https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/2268-non-graceful-shutdown
|
||||||
// NOTE: this test depends on kind. It will only work with kind cluster as it shuts down one of the
|
// NOTE: this test depends on kind. It will only work with kind cluster as it shuts down one of the
|
||||||
// nodes by running `docker stop <node name>`, which is very kind-specific.
|
// nodes by running `docker stop <node name>`, which is very kind-specific.
|
||||||
ginkgo.It("[Serial] [Disruptive] [Slow] must deallocate on non graceful node shutdown", func(ctx context.Context) {
|
f.It(f.WithSerial(), f.WithDisruptive(), f.WithSlow(), "must deallocate on non graceful node shutdown", func(ctx context.Context) {
|
||||||
ginkgo.By("create test pod")
|
ginkgo.By("create test pod")
|
||||||
parameters := b.parameters()
|
parameters := b.parameters()
|
||||||
label := "app.kubernetes.io/instance"
|
label := "app.kubernetes.io/instance"
|
||||||
|
@ -103,6 +103,7 @@ var (
|
|||||||
SeccompDefault = framework.WithFeature(framework.ValidFeatures.Add("SeccompDefault"))
|
SeccompDefault = framework.WithFeature(framework.ValidFeatures.Add("SeccompDefault"))
|
||||||
SELinux = framework.WithFeature(framework.ValidFeatures.Add("SELinux"))
|
SELinux = framework.WithFeature(framework.ValidFeatures.Add("SELinux"))
|
||||||
SELinuxMountReadWriteOncePod = framework.WithFeature(framework.ValidFeatures.Add("SELinuxMountReadWriteOncePod"))
|
SELinuxMountReadWriteOncePod = framework.WithFeature(framework.ValidFeatures.Add("SELinuxMountReadWriteOncePod"))
|
||||||
|
ServiceCIDRs = framework.WithFeature(framework.ValidFeatures.Add("ServiceCIDRs"))
|
||||||
SidecarContainers = framework.WithFeature(framework.ValidFeatures.Add("SidecarContainers"))
|
SidecarContainers = framework.WithFeature(framework.ValidFeatures.Add("SidecarContainers"))
|
||||||
StackdriverAcceleratorMonitoring = framework.WithFeature(framework.ValidFeatures.Add("StackdriverAcceleratorMonitoring"))
|
StackdriverAcceleratorMonitoring = framework.WithFeature(framework.ValidFeatures.Add("StackdriverAcceleratorMonitoring"))
|
||||||
StackdriverCustomMetrics = framework.WithFeature(framework.ValidFeatures.Add("StackdriverCustomMetrics"))
|
StackdriverCustomMetrics = framework.WithFeature(framework.ValidFeatures.Add("StackdriverCustomMetrics"))
|
||||||
|
@ -43,7 +43,7 @@ var loggingSoak struct {
|
|||||||
}
|
}
|
||||||
var _ = e2econfig.AddOptions(&loggingSoak, "instrumentation.logging.soak")
|
var _ = e2econfig.AddOptions(&loggingSoak, "instrumentation.logging.soak")
|
||||||
|
|
||||||
var _ = instrumentation.SIGDescribe("Logging soak [Performance] [Slow] [Disruptive]", func() {
|
var _ = instrumentation.SIGDescribe("Logging soak [Performance]", framework.WithSlow(), framework.WithDisruptive(), func() {
|
||||||
|
|
||||||
f := framework.NewDefaultFramework("logging-soak")
|
f := framework.NewDefaultFramework("logging-soak")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
|
@ -25,6 +25,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/api/resource"
|
"k8s.io/apimachinery/pkg/api/resource"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2egpu "k8s.io/kubernetes/test/e2e/framework/gpu"
|
e2egpu "k8s.io/kubernetes/test/e2e/framework/gpu"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
@ -56,7 +57,7 @@ var _ = instrumentation.SIGDescribe("Stackdriver Monitoring", func() {
|
|||||||
f := framework.NewDefaultFramework("stackdriver-monitoring")
|
f := framework.NewDefaultFramework("stackdriver-monitoring")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
|
|
||||||
ginkgo.It("should have accelerator metrics [Feature:StackdriverAcceleratorMonitoring]", func(ctx context.Context) {
|
f.It("should have accelerator metrics", feature.StackdriverAcceleratorMonitoring, func(ctx context.Context) {
|
||||||
testStackdriverAcceleratorMonitoring(ctx, f)
|
testStackdriverAcceleratorMonitoring(ctx, f)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ import (
|
|||||||
cacheddiscovery "k8s.io/client-go/discovery/cached/memory"
|
cacheddiscovery "k8s.io/client-go/discovery/cached/memory"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
"k8s.io/client-go/restmapper"
|
"k8s.io/client-go/restmapper"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
instrumentation "k8s.io/kubernetes/test/e2e/instrumentation/common"
|
instrumentation "k8s.io/kubernetes/test/e2e/instrumentation/common"
|
||||||
@ -56,7 +57,7 @@ var _ = instrumentation.SIGDescribe("Stackdriver Monitoring", func() {
|
|||||||
f := framework.NewDefaultFramework("stackdriver-monitoring")
|
f := framework.NewDefaultFramework("stackdriver-monitoring")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
|
|
||||||
ginkgo.It("should run Custom Metrics - Stackdriver Adapter for old resource model [Feature:StackdriverCustomMetrics]", func(ctx context.Context) {
|
f.It("should run Custom Metrics - Stackdriver Adapter for old resource model", feature.StackdriverCustomMetrics, func(ctx context.Context) {
|
||||||
kubeClient := f.ClientSet
|
kubeClient := f.ClientSet
|
||||||
config, err := framework.LoadConfig()
|
config, err := framework.LoadConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -71,7 +72,7 @@ var _ = instrumentation.SIGDescribe("Stackdriver Monitoring", func() {
|
|||||||
testCustomMetrics(ctx, f, kubeClient, customMetricsClient, discoveryClient, AdapterForOldResourceModel)
|
testCustomMetrics(ctx, f, kubeClient, customMetricsClient, discoveryClient, AdapterForOldResourceModel)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should run Custom Metrics - Stackdriver Adapter for new resource model [Feature:StackdriverCustomMetrics]", func(ctx context.Context) {
|
f.It("should run Custom Metrics - Stackdriver Adapter for new resource model", feature.StackdriverCustomMetrics, func(ctx context.Context) {
|
||||||
kubeClient := f.ClientSet
|
kubeClient := f.ClientSet
|
||||||
config, err := framework.LoadConfig()
|
config, err := framework.LoadConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -86,7 +87,7 @@ var _ = instrumentation.SIGDescribe("Stackdriver Monitoring", func() {
|
|||||||
testCustomMetrics(ctx, f, kubeClient, customMetricsClient, discoveryClient, AdapterForNewResourceModel)
|
testCustomMetrics(ctx, f, kubeClient, customMetricsClient, discoveryClient, AdapterForNewResourceModel)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should run Custom Metrics - Stackdriver Adapter for external metrics [Feature:StackdriverExternalMetrics]", func(ctx context.Context) {
|
f.It("should run Custom Metrics - Stackdriver Adapter for external metrics", feature.StackdriverExternalMetrics, func(ctx context.Context) {
|
||||||
kubeClient := f.ClientSet
|
kubeClient := f.ClientSet
|
||||||
config, err := framework.LoadConfig()
|
config, err := framework.LoadConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -24,6 +24,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2eautoscaling "k8s.io/kubernetes/test/e2e/framework/autoscaling"
|
e2eautoscaling "k8s.io/kubernetes/test/e2e/framework/autoscaling"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
@ -68,7 +69,7 @@ var _ = instrumentation.SIGDescribe("Stackdriver Monitoring", func() {
|
|||||||
f := framework.NewDefaultFramework("stackdriver-monitoring")
|
f := framework.NewDefaultFramework("stackdriver-monitoring")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
|
|
||||||
ginkgo.It("should have cluster metrics [Feature:StackdriverMonitoring]", func(ctx context.Context) {
|
f.It("should have cluster metrics", feature.StackdriverMonitoring, func(ctx context.Context) {
|
||||||
testStackdriverMonitoring(ctx, f, 1, 100, 200)
|
testStackdriverMonitoring(ctx, f, 1, 100, 200)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ import (
|
|||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
@ -54,7 +55,7 @@ var _ = instrumentation.SIGDescribe("Stackdriver Monitoring", func() {
|
|||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
var kubeClient clientset.Interface
|
var kubeClient clientset.Interface
|
||||||
|
|
||||||
ginkgo.It("should run Stackdriver Metadata Agent [Feature:StackdriverMetadataAgent]", func(ctx context.Context) {
|
f.It("should run Stackdriver Metadata Agent", feature.StackdriverMetadataAgent, func(ctx context.Context) {
|
||||||
kubeClient = f.ClientSet
|
kubeClient = f.ClientSet
|
||||||
testAgent(ctx, f, kubeClient)
|
testAgent(ctx, f, kubeClient)
|
||||||
})
|
})
|
||||||
|
@ -710,7 +710,7 @@ metadata:
|
|||||||
gomega.Expect(ee.ExitStatus()).To(gomega.Equal(42))
|
gomega.Expect(ee.ExitStatus()).To(gomega.Equal(42))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("[Slow] running a failing command without --restart=Never", func(ctx context.Context) {
|
f.It(f.WithSlow(), "running a failing command without --restart=Never", func(ctx context.Context) {
|
||||||
_, err := e2ekubectl.NewKubectlCommand(ns, "run", "-i", "--image="+busyboxImage, "--restart=OnFailure", podRunningTimeoutArg, "failure-2", "--", "/bin/sh", "-c", "cat && exit 42").
|
_, err := e2ekubectl.NewKubectlCommand(ns, "run", "-i", "--image="+busyboxImage, "--restart=OnFailure", podRunningTimeoutArg, "failure-2", "--", "/bin/sh", "-c", "cat && exit 42").
|
||||||
WithStdinData("abcd1234").
|
WithStdinData("abcd1234").
|
||||||
Exec()
|
Exec()
|
||||||
@ -723,7 +723,7 @@ metadata:
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("[Slow] running a failing command without --restart=Never, but with --rm", func(ctx context.Context) {
|
f.It(f.WithSlow(), "running a failing command without --restart=Never, but with --rm", func(ctx context.Context) {
|
||||||
_, err := e2ekubectl.NewKubectlCommand(ns, "run", "-i", "--image="+busyboxImage, "--restart=OnFailure", "--rm", podRunningTimeoutArg, "failure-3", "--", "/bin/sh", "-c", "cat && exit 42").
|
_, err := e2ekubectl.NewKubectlCommand(ns, "run", "-i", "--image="+busyboxImage, "--restart=OnFailure", "--rm", podRunningTimeoutArg, "failure-3", "--", "/bin/sh", "-c", "cat && exit 42").
|
||||||
WithStdinData("abcd1234").
|
WithStdinData("abcd1234").
|
||||||
Exec()
|
Exec()
|
||||||
@ -737,7 +737,7 @@ metadata:
|
|||||||
framework.ExpectNoError(e2epod.WaitForPodNotFoundInNamespace(ctx, f.ClientSet, "failure-3", ns, 2*v1.DefaultTerminationGracePeriodSeconds*time.Second))
|
framework.ExpectNoError(e2epod.WaitForPodNotFoundInNamespace(ctx, f.ClientSet, "failure-3", ns, 2*v1.DefaultTerminationGracePeriodSeconds*time.Second))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("[Slow] running a failing command with --leave-stdin-open", func(ctx context.Context) {
|
f.It(f.WithSlow(), "running a failing command with --leave-stdin-open", func(ctx context.Context) {
|
||||||
_, err := e2ekubectl.NewKubectlCommand(ns, "run", "-i", "--image="+busyboxImage, "--restart=Never", podRunningTimeoutArg, "failure-4", "--leave-stdin-open", "--", "/bin/sh", "-c", "exit 42").
|
_, err := e2ekubectl.NewKubectlCommand(ns, "run", "-i", "--image="+busyboxImage, "--restart=Never", podRunningTimeoutArg, "failure-4", "--leave-stdin-open", "--", "/bin/sh", "-c", "exit 42").
|
||||||
WithStdinData("abcd1234").
|
WithStdinData("abcd1234").
|
||||||
Exec()
|
Exec()
|
||||||
@ -1892,7 +1892,7 @@ metadata:
|
|||||||
|
|
||||||
// This test must run [Serial] because it modifies the node so it doesn't allow pods to execute on
|
// This test must run [Serial] because it modifies the node so it doesn't allow pods to execute on
|
||||||
// it, which will affect anything else running in parallel.
|
// it, which will affect anything else running in parallel.
|
||||||
ginkgo.Describe("Kubectl taint [Serial]", func() {
|
f.Describe("Kubectl taint", framework.WithSerial(), func() {
|
||||||
ginkgo.It("should update the taint on a node", func(ctx context.Context) {
|
ginkgo.It("should update the taint on a node", func(ctx context.Context) {
|
||||||
testTaint := v1.Taint{
|
testTaint := v1.Taint{
|
||||||
Key: fmt.Sprintf("kubernetes.io/e2e-taint-key-001-%s", string(uuid.NewUUID())),
|
Key: fmt.Sprintf("kubernetes.io/e2e-taint-key-001-%s", string(uuid.NewUUID())),
|
||||||
|
@ -24,6 +24,7 @@ import (
|
|||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
bootstrapapi "k8s.io/cluster-bootstrap/token/api"
|
bootstrapapi "k8s.io/cluster-bootstrap/token/api"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
"k8s.io/kubernetes/test/e2e/lifecycle"
|
"k8s.io/kubernetes/test/e2e/lifecycle"
|
||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
@ -37,7 +38,7 @@ const (
|
|||||||
TokenSecretBytes = 8
|
TokenSecretBytes = 8
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = lifecycle.SIGDescribe("[Feature:BootstrapTokens]", func() {
|
var _ = lifecycle.SIGDescribe(feature.BootstrapTokens, func() {
|
||||||
|
|
||||||
var c clientset.Interface
|
var c clientset.Interface
|
||||||
|
|
||||||
@ -70,7 +71,7 @@ var _ = lifecycle.SIGDescribe("[Feature:BootstrapTokens]", func() {
|
|||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should resign the bootstrap tokens when the clusterInfo ConfigMap updated [Serial][Disruptive]", func(ctx context.Context) {
|
f.It("should resign the bootstrap tokens when the clusterInfo ConfigMap updated", f.WithSerial(), f.WithDisruptive(), func(ctx context.Context) {
|
||||||
ginkgo.By("create a new bootstrap token secret")
|
ginkgo.By("create a new bootstrap token secret")
|
||||||
tokenID, err := GenerateTokenID()
|
tokenID, err := GenerateTokenID()
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
|
@ -25,13 +25,14 @@ import (
|
|||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
bootstrapapi "k8s.io/cluster-bootstrap/token/api"
|
bootstrapapi "k8s.io/cluster-bootstrap/token/api"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
"k8s.io/kubernetes/test/e2e/lifecycle"
|
"k8s.io/kubernetes/test/e2e/lifecycle"
|
||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
var secretNeedClean string
|
var secretNeedClean string
|
||||||
var _ = lifecycle.SIGDescribe("[Feature:BootstrapTokens]", func() {
|
var _ = lifecycle.SIGDescribe(feature.BootstrapTokens, func() {
|
||||||
|
|
||||||
var c clientset.Interface
|
var c clientset.Interface
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ var _ = common.SIGDescribe("DNS configMap nameserver", func() {
|
|||||||
ginkgo.Context("Change stubDomain", func() {
|
ginkgo.Context("Change stubDomain", func() {
|
||||||
nsTest := &dnsNameserverTest{dnsTestCommon: newDNSTestCommon()}
|
nsTest := &dnsNameserverTest{dnsTestCommon: newDNSTestCommon()}
|
||||||
|
|
||||||
ginkgo.It("should be able to change stubDomain configuration [Slow][Serial]", func(ctx context.Context) {
|
framework.It("should be able to change stubDomain configuration", framework.WithSlow(), framework.WithSerial(), func(ctx context.Context) {
|
||||||
nsTest.c = nsTest.f.ClientSet
|
nsTest.c = nsTest.f.ClientSet
|
||||||
nsTest.run(ctx, framework.TestContext.ClusterIsIPv6())
|
nsTest.run(ctx, framework.TestContext.ClusterIsIPv6())
|
||||||
})
|
})
|
||||||
@ -325,7 +325,7 @@ var _ = common.SIGDescribe("DNS configMap nameserver", func() {
|
|||||||
ginkgo.Context("Forward PTR lookup", func() {
|
ginkgo.Context("Forward PTR lookup", func() {
|
||||||
fwdTest := &dnsPtrFwdTest{dnsTestCommon: newDNSTestCommon()}
|
fwdTest := &dnsPtrFwdTest{dnsTestCommon: newDNSTestCommon()}
|
||||||
|
|
||||||
ginkgo.It("should forward PTR records lookup to upstream nameserver [Slow][Serial]", func(ctx context.Context) {
|
framework.It("should forward PTR records lookup to upstream nameserver", framework.WithSlow(), framework.WithSerial(), func(ctx context.Context) {
|
||||||
fwdTest.c = fwdTest.f.ClientSet
|
fwdTest.c = fwdTest.f.ClientSet
|
||||||
fwdTest.run(ctx, framework.TestContext.ClusterIsIPv6())
|
fwdTest.run(ctx, framework.TestContext.ClusterIsIPv6())
|
||||||
})
|
})
|
||||||
@ -334,7 +334,7 @@ var _ = common.SIGDescribe("DNS configMap nameserver", func() {
|
|||||||
ginkgo.Context("Forward external name lookup", func() {
|
ginkgo.Context("Forward external name lookup", func() {
|
||||||
externalNameTest := &dnsExternalNameTest{dnsTestCommon: newDNSTestCommon()}
|
externalNameTest := &dnsExternalNameTest{dnsTestCommon: newDNSTestCommon()}
|
||||||
|
|
||||||
ginkgo.It("should forward externalname lookup to upstream nameserver [Slow][Serial]", func(ctx context.Context) {
|
framework.It("should forward externalname lookup to upstream nameserver", framework.WithSlow(), framework.WithSerial(), func(ctx context.Context) {
|
||||||
externalNameTest.c = externalNameTest.f.ClientSet
|
externalNameTest.c = externalNameTest.f.ClientSet
|
||||||
externalNameTest.run(ctx, framework.TestContext.ClusterIsIPv6())
|
externalNameTest.run(ctx, framework.TestContext.ClusterIsIPv6())
|
||||||
})
|
})
|
||||||
|
@ -26,6 +26,7 @@ import (
|
|||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
"k8s.io/client-go/util/workqueue"
|
"k8s.io/client-go/util/workqueue"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
"k8s.io/kubernetes/test/e2e/network/common"
|
"k8s.io/kubernetes/test/e2e/network/common"
|
||||||
@ -42,7 +43,7 @@ const (
|
|||||||
checkServicePercent = 0.05
|
checkServicePercent = 0.05
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = common.SIGDescribe("[Feature:PerformanceDNS][Serial]", func() {
|
var _ = common.SIGDescribe(feature.PerformanceDNS, framework.WithSerial(), func() {
|
||||||
f := framework.NewDefaultFramework("performancedns")
|
f := framework.NewDefaultFramework("performancedns")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ import (
|
|||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2edeployment "k8s.io/kubernetes/test/e2e/framework/deployment"
|
e2edeployment "k8s.io/kubernetes/test/e2e/framework/deployment"
|
||||||
e2enetwork "k8s.io/kubernetes/test/e2e/framework/network"
|
e2enetwork "k8s.io/kubernetes/test/e2e/framework/network"
|
||||||
@ -44,7 +45,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Tests for ipv4-ipv6 dual-stack feature
|
// Tests for ipv4-ipv6 dual-stack feature
|
||||||
var _ = common.SIGDescribe("[Feature:IPv6DualStack]", func() {
|
var _ = common.SIGDescribe(feature.IPv6DualStack, func() {
|
||||||
f := framework.NewDefaultFramework("dualstack")
|
f := framework.NewDefaultFramework("dualstack")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
|
|
||||||
@ -111,7 +112,7 @@ var _ = common.SIGDescribe("[Feature:IPv6DualStack]", func() {
|
|||||||
framework.ExpectNoError(err, "failed to delete pod")
|
framework.ExpectNoError(err, "failed to delete pod")
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should create pod, add ipv6 and ipv4 ip to host ips [Feature:PodHostIPs]", func(ctx context.Context) {
|
f.It("should create pod, add ipv6 and ipv4 ip to host ips", feature.PodHostIPs, func(ctx context.Context) {
|
||||||
podName := "pod-dualstack-ips"
|
podName := "pod-dualstack-ips"
|
||||||
|
|
||||||
pod := &v1.Pod{
|
pod := &v1.Pod{
|
||||||
@ -498,7 +499,7 @@ var _ = common.SIGDescribe("[Feature:IPv6DualStack]", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should function for pod-Service: sctp [Feature:SCTPConnectivity]", func(ctx context.Context) {
|
f.It("should function for pod-Service: sctp", feature.SCTPConnectivity, func(ctx context.Context) {
|
||||||
config := e2enetwork.NewNetworkingTestConfig(ctx, f, e2enetwork.EnableDualStack, e2enetwork.EnableSCTP)
|
config := e2enetwork.NewNetworkingTestConfig(ctx, f, e2enetwork.EnableDualStack, e2enetwork.EnableSCTP)
|
||||||
ginkgo.By(fmt.Sprintf("dialing(sctp) %v --> %v:%v (config.clusterIP)", config.TestContainerPod.Name, config.SecondaryClusterIP, e2enetwork.ClusterSCTPPort))
|
ginkgo.By(fmt.Sprintf("dialing(sctp) %v --> %v:%v (config.clusterIP)", config.TestContainerPod.Name, config.SecondaryClusterIP, e2enetwork.ClusterSCTPPort))
|
||||||
err := config.DialFromTestContainer(ctx, "sctp", config.SecondaryClusterIP, e2enetwork.ClusterSCTPPort, config.MaxTries, 0, config.EndpointHostnames())
|
err := config.DialFromTestContainer(ctx, "sctp", config.SecondaryClusterIP, e2enetwork.ClusterSCTPPort, config.MaxTries, 0, config.EndpointHostnames())
|
||||||
|
@ -31,6 +31,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
api "k8s.io/kubernetes/pkg/apis/core"
|
api "k8s.io/kubernetes/pkg/apis/core"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl"
|
e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl"
|
||||||
e2enetwork "k8s.io/kubernetes/test/e2e/framework/network"
|
e2enetwork "k8s.io/kubernetes/test/e2e/framework/network"
|
||||||
@ -58,7 +59,7 @@ try:
|
|||||||
except:
|
except:
|
||||||
print('err')`
|
print('err')`
|
||||||
|
|
||||||
var _ = common.SIGDescribe("ClusterDns [Feature:Example]", func() {
|
var _ = common.SIGDescribe("ClusterDns", feature.Example, func() {
|
||||||
f := framework.NewDefaultFramework("cluster-dns")
|
f := framework.NewDefaultFramework("cluster-dns")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ var _ = common.SIGDescribe("Firewall rule", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// This test takes around 6 minutes to run
|
// This test takes around 6 minutes to run
|
||||||
ginkgo.It("[Slow] [Serial] should create valid firewall rules for LoadBalancer type service", func(ctx context.Context) {
|
f.It(f.WithSlow(), f.WithSerial(), "should create valid firewall rules for LoadBalancer type service", func(ctx context.Context) {
|
||||||
ns := f.Namespace.Name
|
ns := f.Namespace.Name
|
||||||
// This source ranges is just used to examine we have exact same things on LB firewall rules
|
// This source ranges is just used to examine we have exact same things on LB firewall rules
|
||||||
firewallTestSourceRanges := []string{"0.0.0.0/1", "128.0.0.0/1"}
|
firewallTestSourceRanges := []string{"0.0.0.0/1", "128.0.0.0/1"}
|
||||||
|
@ -35,6 +35,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/watch"
|
"k8s.io/apimachinery/pkg/watch"
|
||||||
"k8s.io/apiserver/pkg/authentication/serviceaccount"
|
"k8s.io/apiserver/pkg/authentication/serviceaccount"
|
||||||
"k8s.io/client-go/util/retry"
|
"k8s.io/client-go/util/retry"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2eauth "k8s.io/kubernetes/test/e2e/framework/auth"
|
e2eauth "k8s.io/kubernetes/test/e2e/framework/auth"
|
||||||
e2eingress "k8s.io/kubernetes/test/e2e/framework/ingress"
|
e2eingress "k8s.io/kubernetes/test/e2e/framework/ingress"
|
||||||
@ -85,7 +86,7 @@ var _ = common.SIGDescribe("Loadbalancing: L7", func() {
|
|||||||
//
|
//
|
||||||
// Slow by design ~10m for each "It" block dominated by loadbalancer setup time
|
// Slow by design ~10m for each "It" block dominated by loadbalancer setup time
|
||||||
// TODO: write similar tests for nginx, haproxy and AWS Ingress.
|
// TODO: write similar tests for nginx, haproxy and AWS Ingress.
|
||||||
ginkgo.Describe("GCE [Slow] [Feature:Ingress]", func() {
|
f.Describe("GCE", framework.WithSlow(), feature.Ingress, func() {
|
||||||
var gceController *gce.IngressController
|
var gceController *gce.IngressController
|
||||||
|
|
||||||
// Platform specific setup
|
// Platform specific setup
|
||||||
@ -130,7 +131,7 @@ var _ = common.SIGDescribe("Loadbalancing: L7", func() {
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.Describe("GCE [Slow] [Feature:NEG]", func() {
|
f.Describe("GCE", framework.WithSlow(), feature.NEG, func() {
|
||||||
var gceController *gce.IngressController
|
var gceController *gce.IngressController
|
||||||
|
|
||||||
// Platform specific setup
|
// Platform specific setup
|
||||||
|
@ -19,6 +19,7 @@ package network
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
"k8s.io/kubernetes/test/e2e/network/common"
|
"k8s.io/kubernetes/test/e2e/network/common"
|
||||||
@ -40,7 +41,7 @@ var _ = common.SIGDescribe("Loadbalancing: L7 Scalability", func() {
|
|||||||
ns = f.Namespace.Name
|
ns = f.Namespace.Name
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.Describe("GCE [Slow] [Serial] [Feature:IngressScale]", func() {
|
f.Describe("GCE", framework.WithSlow(), framework.WithSerial(), feature.IngressScale, func() {
|
||||||
var (
|
var (
|
||||||
scaleFramework *scale.IngressScaleFramework
|
scaleFramework *scale.IngressScaleFramework
|
||||||
)
|
)
|
||||||
|
@ -29,6 +29,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
"k8s.io/apimachinery/pkg/watch"
|
"k8s.io/apimachinery/pkg/watch"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
"k8s.io/kubernetes/test/e2e/network/common"
|
"k8s.io/kubernetes/test/e2e/network/common"
|
||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
@ -38,7 +39,7 @@ import (
|
|||||||
"github.com/onsi/gomega"
|
"github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = common.SIGDescribe("IngressClass [Feature:Ingress]", func() {
|
var _ = common.SIGDescribe("IngressClass", feature.Ingress, func() {
|
||||||
f := framework.NewDefaultFramework("ingressclass")
|
f := framework.NewDefaultFramework("ingressclass")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
var cs clientset.Interface
|
var cs clientset.Interface
|
||||||
@ -46,7 +47,7 @@ var _ = common.SIGDescribe("IngressClass [Feature:Ingress]", func() {
|
|||||||
cs = f.ClientSet
|
cs = f.ClientSet
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should set default value on new IngressClass [Serial]", func(ctx context.Context) {
|
f.It("should set default value on new IngressClass", f.WithSerial(), func(ctx context.Context) {
|
||||||
ingressClass1, err := createIngressClass(ctx, cs, "ingressclass1", true, f.UniqueName)
|
ingressClass1, err := createIngressClass(ctx, cs, "ingressclass1", true, f.UniqueName)
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
ginkgo.DeferCleanup(deleteIngressClass, cs, ingressClass1.Name)
|
ginkgo.DeferCleanup(deleteIngressClass, cs, ingressClass1.Name)
|
||||||
@ -83,7 +84,7 @@ var _ = common.SIGDescribe("IngressClass [Feature:Ingress]", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should not set default value if no default IngressClass [Serial]", func(ctx context.Context) {
|
f.It("should not set default value if no default IngressClass", f.WithSerial(), func(ctx context.Context) {
|
||||||
ingressClass1, err := createIngressClass(ctx, cs, "ingressclass1", false, f.UniqueName)
|
ingressClass1, err := createIngressClass(ctx, cs, "ingressclass1", false, f.UniqueName)
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
ginkgo.DeferCleanup(deleteIngressClass, cs, ingressClass1.Name)
|
ginkgo.DeferCleanup(deleteIngressClass, cs, ingressClass1.Name)
|
||||||
@ -117,7 +118,7 @@ var _ = common.SIGDescribe("IngressClass [Feature:Ingress]", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should choose the one with the later CreationTimestamp, if equal the one with the lower name when two ingressClasses are marked as default[Serial]", func(ctx context.Context) {
|
f.It("should choose the one with the later CreationTimestamp, if equal the one with the lower name when two ingressClasses are marked as default", f.WithSerial(), func(ctx context.Context) {
|
||||||
ingressClass1, err := createIngressClass(ctx, cs, "ingressclass1", true, f.UniqueName)
|
ingressClass1, err := createIngressClass(ctx, cs, "ingressclass1", true, f.UniqueName)
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
ginkgo.DeferCleanup(deleteIngressClass, cs, ingressClass1.Name)
|
ginkgo.DeferCleanup(deleteIngressClass, cs, ingressClass1.Name)
|
||||||
@ -165,7 +166,7 @@ var _ = common.SIGDescribe("IngressClass [Feature:Ingress]", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should allow IngressClass to have Namespace-scoped parameters [Serial]", func(ctx context.Context) {
|
f.It("should allow IngressClass to have Namespace-scoped parameters", f.WithSerial(), func(ctx context.Context) {
|
||||||
ingressClass := &networkingv1.IngressClass{
|
ingressClass := &networkingv1.IngressClass{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "ingressclass1",
|
Name: "ingressclass1",
|
||||||
|
@ -137,7 +137,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should be able to change the type and ports of a TCP service [Slow]", func(ctx context.Context) {
|
f.It("should be able to change the type and ports of a TCP service", f.WithSlow(), func(ctx context.Context) {
|
||||||
// requires cloud load-balancer support
|
// requires cloud load-balancer support
|
||||||
e2eskipper.SkipUnlessProviderIs("gce", "gke", "aws")
|
e2eskipper.SkipUnlessProviderIs("gce", "gke", "aws")
|
||||||
|
|
||||||
@ -330,7 +330,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
|
|||||||
testNotReachableHTTP(tcpIngressIP, svcPort, loadBalancerLagTimeout)
|
testNotReachableHTTP(tcpIngressIP, svcPort, loadBalancerLagTimeout)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should be able to change the type and ports of a UDP service [Slow]", func(ctx context.Context) {
|
f.It("should be able to change the type and ports of a UDP service", f.WithSlow(), func(ctx context.Context) {
|
||||||
// requires cloud load-balancer support
|
// requires cloud load-balancer support
|
||||||
e2eskipper.SkipUnlessProviderIs("gce", "gke")
|
e2eskipper.SkipUnlessProviderIs("gce", "gke")
|
||||||
|
|
||||||
@ -524,7 +524,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
|
|||||||
testNotReachableUDP(udpIngressIP, svcPort, loadBalancerLagTimeout)
|
testNotReachableUDP(udpIngressIP, svcPort, loadBalancerLagTimeout)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should only allow access from service loadbalancer source ranges [Slow]", func(ctx context.Context) {
|
f.It("should only allow access from service loadbalancer source ranges", f.WithSlow(), func(ctx context.Context) {
|
||||||
// this feature currently supported only on GCE/GKE/AWS/AZURE
|
// this feature currently supported only on GCE/GKE/AWS/AZURE
|
||||||
e2eskipper.SkipUnlessProviderIs("gce", "gke", "aws", "azure")
|
e2eskipper.SkipUnlessProviderIs("gce", "gke", "aws", "azure")
|
||||||
|
|
||||||
@ -608,7 +608,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
|
|||||||
checkReachabilityFromPod(true, loadBalancerCreateTimeout, namespace, dropPod.Name, svcIP)
|
checkReachabilityFromPod(true, loadBalancerCreateTimeout, namespace, dropPod.Name, svcIP)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should be able to create an internal type load balancer [Slow]", func(ctx context.Context) {
|
f.It("should be able to create an internal type load balancer", f.WithSlow(), func(ctx context.Context) {
|
||||||
e2eskipper.SkipUnlessProviderIs("azure", "gke", "gce")
|
e2eskipper.SkipUnlessProviderIs("azure", "gke", "gce")
|
||||||
|
|
||||||
createTimeout := e2eservice.GetServiceLoadBalancerCreationTimeout(ctx, cs)
|
createTimeout := e2eservice.GetServiceLoadBalancerCreationTimeout(ctx, cs)
|
||||||
@ -738,7 +738,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// [LinuxOnly]: Windows does not support session affinity.
|
// [LinuxOnly]: Windows does not support session affinity.
|
||||||
ginkgo.It("should have session affinity work for LoadBalancer service with ESIPP on [Slow] [LinuxOnly]", func(ctx context.Context) {
|
f.It("should have session affinity work for LoadBalancer service with ESIPP on", f.WithSlow(), "[LinuxOnly]", func(ctx context.Context) {
|
||||||
// L4 load balancer affinity `ClientIP` is not supported on AWS ELB.
|
// L4 load balancer affinity `ClientIP` is not supported on AWS ELB.
|
||||||
e2eskipper.SkipIfProviderIs("aws")
|
e2eskipper.SkipIfProviderIs("aws")
|
||||||
|
|
||||||
@ -749,7 +749,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// [LinuxOnly]: Windows does not support session affinity.
|
// [LinuxOnly]: Windows does not support session affinity.
|
||||||
ginkgo.It("should be able to switch session affinity for LoadBalancer service with ESIPP on [Slow] [LinuxOnly]", func(ctx context.Context) {
|
f.It("should be able to switch session affinity for LoadBalancer service with ESIPP on", f.WithSlow(), "[LinuxOnly]", func(ctx context.Context) {
|
||||||
// L4 load balancer affinity `ClientIP` is not supported on AWS ELB.
|
// L4 load balancer affinity `ClientIP` is not supported on AWS ELB.
|
||||||
e2eskipper.SkipIfProviderIs("aws")
|
e2eskipper.SkipIfProviderIs("aws")
|
||||||
|
|
||||||
@ -760,7 +760,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// [LinuxOnly]: Windows does not support session affinity.
|
// [LinuxOnly]: Windows does not support session affinity.
|
||||||
ginkgo.It("should have session affinity work for LoadBalancer service with ESIPP off [Slow] [LinuxOnly]", func(ctx context.Context) {
|
f.It("should have session affinity work for LoadBalancer service with ESIPP off", f.WithSlow(), "[LinuxOnly]", func(ctx context.Context) {
|
||||||
// L4 load balancer affinity `ClientIP` is not supported on AWS ELB.
|
// L4 load balancer affinity `ClientIP` is not supported on AWS ELB.
|
||||||
e2eskipper.SkipIfProviderIs("aws")
|
e2eskipper.SkipIfProviderIs("aws")
|
||||||
|
|
||||||
@ -771,7 +771,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// [LinuxOnly]: Windows does not support session affinity.
|
// [LinuxOnly]: Windows does not support session affinity.
|
||||||
ginkgo.It("should be able to switch session affinity for LoadBalancer service with ESIPP off [Slow] [LinuxOnly]", func(ctx context.Context) {
|
f.It("should be able to switch session affinity for LoadBalancer service with ESIPP off", f.WithSlow(), "[LinuxOnly]", func(ctx context.Context) {
|
||||||
// L4 load balancer affinity `ClientIP` is not supported on AWS ELB.
|
// L4 load balancer affinity `ClientIP` is not supported on AWS ELB.
|
||||||
e2eskipper.SkipIfProviderIs("aws")
|
e2eskipper.SkipIfProviderIs("aws")
|
||||||
|
|
||||||
@ -787,7 +787,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
|
|||||||
// 2. Update service to type=ClusterIP. Finalizer should be removed.
|
// 2. Update service to type=ClusterIP. Finalizer should be removed.
|
||||||
// 3. Update service to type=LoadBalancer. Finalizer should be added.
|
// 3. Update service to type=LoadBalancer. Finalizer should be added.
|
||||||
// 4. Delete service with type=LoadBalancer. Finalizer should be removed.
|
// 4. Delete service with type=LoadBalancer. Finalizer should be removed.
|
||||||
ginkgo.It("should handle load balancer cleanup finalizer for service [Slow]", func(ctx context.Context) {
|
f.It("should handle load balancer cleanup finalizer for service", f.WithSlow(), func(ctx context.Context) {
|
||||||
jig := e2eservice.NewTestJig(cs, f.Namespace.Name, "lb-finalizer")
|
jig := e2eservice.NewTestJig(cs, f.Namespace.Name, "lb-finalizer")
|
||||||
|
|
||||||
ginkgo.By("Create load balancer service")
|
ginkgo.By("Create load balancer service")
|
||||||
@ -819,7 +819,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
|
|||||||
e2eservice.WaitForServiceUpdatedWithFinalizer(ctx, cs, svc.Namespace, svc.Name, true)
|
e2eservice.WaitForServiceUpdatedWithFinalizer(ctx, cs, svc.Namespace, svc.Name, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should be able to create LoadBalancer Service without NodePort and change it [Slow]", func(ctx context.Context) {
|
f.It("should be able to create LoadBalancer Service without NodePort and change it", f.WithSlow(), func(ctx context.Context) {
|
||||||
// requires cloud load-balancer support
|
// requires cloud load-balancer support
|
||||||
e2eskipper.SkipUnlessProviderIs("gce", "gke", "aws")
|
e2eskipper.SkipUnlessProviderIs("gce", "gke", "aws")
|
||||||
|
|
||||||
@ -1203,7 +1203,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should not have connectivity disruption during rolling update with externalTrafficPolicy=Cluster [Slow]", func(ctx context.Context) {
|
f.It("should not have connectivity disruption during rolling update with externalTrafficPolicy=Cluster", f.WithSlow(), func(ctx context.Context) {
|
||||||
// We start with a low but reasonable threshold to analyze the results.
|
// We start with a low but reasonable threshold to analyze the results.
|
||||||
// The goal is to achieve 99% minimum success rate.
|
// The goal is to achieve 99% minimum success rate.
|
||||||
// TODO: We should do incremental steps toward the goal.
|
// TODO: We should do incremental steps toward the goal.
|
||||||
@ -1212,7 +1212,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
|
|||||||
testRollingUpdateLBConnectivityDisruption(ctx, f, v1.ServiceExternalTrafficPolicyTypeCluster, minSuccessRate)
|
testRollingUpdateLBConnectivityDisruption(ctx, f, v1.ServiceExternalTrafficPolicyTypeCluster, minSuccessRate)
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should not have connectivity disruption during rolling update with externalTrafficPolicy=Local [Slow]", func(ctx context.Context) {
|
f.It("should not have connectivity disruption during rolling update with externalTrafficPolicy=Local", f.WithSlow(), func(ctx context.Context) {
|
||||||
// We start with a low but reasonable threshold to analyze the results.
|
// We start with a low but reasonable threshold to analyze the results.
|
||||||
// The goal is to achieve 99% minimum success rate.
|
// The goal is to achieve 99% minimum success rate.
|
||||||
// TODO: We should do incremental steps toward the goal.
|
// TODO: We should do incremental steps toward the goal.
|
||||||
@ -1222,7 +1222,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
var _ = common.SIGDescribe("LoadBalancers ESIPP [Slow]", func() {
|
var _ = common.SIGDescribe("LoadBalancers ESIPP", framework.WithSlow(), func() {
|
||||||
f := framework.NewDefaultFramework("esipp")
|
f := framework.NewDefaultFramework("esipp")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
||||||
var loadBalancerCreateTimeout time.Duration
|
var loadBalancerCreateTimeout time.Duration
|
||||||
|
@ -29,6 +29,7 @@ import (
|
|||||||
"github.com/onsi/ginkgo/v2"
|
"github.com/onsi/ginkgo/v2"
|
||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||||
"k8s.io/kubernetes/test/e2e/network/common"
|
"k8s.io/kubernetes/test/e2e/network/common"
|
||||||
@ -116,7 +117,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ginkgo.Context("NetworkPolicy between server and client", func() {
|
ginkgo.Context("NetworkPolicy between server and client", func() {
|
||||||
var k8s *kubeManager
|
var k8s *kubeManager
|
||||||
|
|
||||||
ginkgo.It("should support a 'default-deny-ingress' policy [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should support a 'default-deny-ingress' policy", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
|
|
||||||
// Only poll TCP
|
// Only poll TCP
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
@ -143,7 +144,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should support a 'default-deny-all' policy [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should support a 'default-deny-all' policy", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
policy := GenNetworkPolicyWithNameAndPodSelector("deny-all", metav1.LabelSelector{}, SetSpecIngressRules(), SetSpecEgressRules())
|
policy := GenNetworkPolicyWithNameAndPodSelector("deny-all", metav1.LabelSelector{}, SetSpecIngressRules(), SetSpecEgressRules())
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
@ -158,7 +159,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce policy to allow traffic from pods within server namespace based on PodSelector [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce policy to allow traffic from pods within server namespace based on PodSelector", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
allowedPods := metav1.LabelSelector{
|
allowedPods := metav1.LabelSelector{
|
||||||
MatchLabels: map[string]string{
|
MatchLabels: map[string]string{
|
||||||
"pod": "b",
|
"pod": "b",
|
||||||
@ -181,7 +182,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce policy to allow ingress traffic for a target [Feature:NetworkPolicy] ", func(ctx context.Context) {
|
f.It("should enforce policy to allow ingress traffic for a target", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -206,7 +207,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce policy to allow ingress traffic from pods in all namespaces [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce policy to allow ingress traffic from pods in all namespaces", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -220,7 +221,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce policy to allow traffic only from a different namespace, based on NamespaceSelector [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce policy to allow traffic only from a different namespace, based on NamespaceSelector", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -238,7 +239,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce policy based on PodSelector with MatchExpressions[Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce policy based on PodSelector with MatchExpressions", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
allowedPods := metav1.LabelSelector{
|
allowedPods := metav1.LabelSelector{
|
||||||
MatchExpressions: []metav1.LabelSelectorRequirement{{
|
MatchExpressions: []metav1.LabelSelectorRequirement{{
|
||||||
Key: "pod",
|
Key: "pod",
|
||||||
@ -263,7 +264,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce policy based on NamespaceSelector with MatchExpressions[Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce policy based on NamespaceSelector with MatchExpressions", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -288,7 +289,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce policy based on PodSelector or NamespaceSelector [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce policy based on PodSelector or NamespaceSelector", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -317,7 +318,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce policy based on PodSelector and NamespaceSelector [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce policy based on PodSelector and NamespaceSelector", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -347,7 +348,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce policy based on Multiple PodSelectors and NamespaceSelectors [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce policy based on Multiple PodSelectors and NamespaceSelectors", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -380,7 +381,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce policy based on any PodSelectors [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce policy based on any PodSelectors", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -402,7 +403,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce policy to allow traffic only from a pod in a different namespace based on PodSelector and NamespaceSelector [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce policy to allow traffic only from a pod in a different namespace based on PodSelector and NamespaceSelector", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -429,7 +430,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce policy based on Ports [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce policy based on Ports", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
ginkgo.By("Creating a network allowPort81Policy which only allows allow listed namespaces (y) to connect on exactly one port (81)")
|
ginkgo.By("Creating a network allowPort81Policy which only allows allow listed namespaces (y) to connect on exactly one port (81)")
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{81}
|
ports := []int32{81}
|
||||||
@ -454,7 +455,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce multiple, stacked policies with overlapping podSelectors [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce multiple, stacked policies with overlapping podSelectors", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
ginkgo.By("Creating a network allowPort81Policy which only allows allow listed namespaces (y) to connect on exactly one port (81)")
|
ginkgo.By("Creating a network allowPort81Policy which only allows allow listed namespaces (y) to connect on exactly one port (81)")
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80, 81}
|
ports := []int32{80, 81}
|
||||||
@ -496,7 +497,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachabilityALLOW})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachabilityALLOW})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should support allow-all policy [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should support allow-all policy", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
ginkgo.By("Creating a network policy which allows all traffic.")
|
ginkgo.By("Creating a network policy which allows all traffic.")
|
||||||
policy := GenNetworkPolicyWithNameAndPodMatchLabel("allow-all", map[string]string{}, SetSpecIngressRules(networkingv1.NetworkPolicyIngressRule{}))
|
policy := GenNetworkPolicyWithNameAndPodMatchLabel("allow-all", map[string]string{}, SetSpecIngressRules(networkingv1.NetworkPolicyIngressRule{}))
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
@ -511,7 +512,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should allow ingress access on one named port [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should allow ingress access on one named port", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
IngressRules := networkingv1.NetworkPolicyIngressRule{}
|
IngressRules := networkingv1.NetworkPolicyIngressRule{}
|
||||||
IngressRules.Ports = append(IngressRules.Ports, networkingv1.NetworkPolicyPort{Port: &intstr.IntOrString{Type: intstr.String, StrVal: "serve-81-tcp"}})
|
IngressRules.Ports = append(IngressRules.Ports, networkingv1.NetworkPolicyPort{Port: &intstr.IntOrString{Type: intstr.String, StrVal: "serve-81-tcp"}})
|
||||||
policy := GenNetworkPolicyWithNameAndPodMatchLabel("allow-all", map[string]string{}, SetSpecIngressRules(IngressRules))
|
policy := GenNetworkPolicyWithNameAndPodMatchLabel("allow-all", map[string]string{}, SetSpecIngressRules(IngressRules))
|
||||||
@ -532,7 +533,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachabilityPort80})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachabilityPort80})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should allow ingress access from namespace on one named port [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should allow ingress access from namespace on one named port", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80, 81}
|
ports := []int32{80, 81}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -562,7 +563,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolTCP, Reachability: reachabilityFAIL})
|
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolTCP, Reachability: reachabilityFAIL})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should allow egress access on one named port [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should allow egress access on one named port", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
ginkgo.By("validating egress from port 81 to port 80")
|
ginkgo.By("validating egress from port 81 to port 80")
|
||||||
egressRule := networkingv1.NetworkPolicyEgressRule{}
|
egressRule := networkingv1.NetworkPolicyEgressRule{}
|
||||||
egressRule.Ports = append(egressRule.Ports, networkingv1.NetworkPolicyPort{Port: &intstr.IntOrString{Type: intstr.String, StrVal: "serve-80-tcp"}})
|
egressRule.Ports = append(egressRule.Ports, networkingv1.NetworkPolicyPort{Port: &intstr.IntOrString{Type: intstr.String, StrVal: "serve-80-tcp"}})
|
||||||
@ -583,7 +584,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolTCP, Reachability: reachabilityPort81})
|
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolTCP, Reachability: reachabilityPort81})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce updated policy [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce updated policy", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
ginkgo.By("Using the simplest possible mutation: start with allow all, then switch to deny all")
|
ginkgo.By("Using the simplest possible mutation: start with allow all, then switch to deny all")
|
||||||
// part 1) allow all
|
// part 1) allow all
|
||||||
policy := GenNetworkPolicyWithNameAndPodMatchLabel("allow-all-mutate-to-deny-all", map[string]string{}, SetSpecIngressRules(networkingv1.NetworkPolicyIngressRule{}))
|
policy := GenNetworkPolicyWithNameAndPodMatchLabel("allow-all-mutate-to-deny-all", map[string]string{}, SetSpecIngressRules(networkingv1.NetworkPolicyIngressRule{}))
|
||||||
@ -605,7 +606,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolTCP, Reachability: reachabilityDeny})
|
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolTCP, Reachability: reachabilityDeny})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should allow ingress access from updated namespace [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should allow ingress access from updated namespace", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -636,7 +637,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachabilityWithLabel})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachabilityWithLabel})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should allow ingress access from updated pod [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should allow ingress access from updated pod", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -665,7 +666,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachabilityWithLabel})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachabilityWithLabel})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should deny ingress from pods on other namespaces [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should deny ingress from pods on other namespaces", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -682,7 +683,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should deny ingress access to updated pod [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should deny ingress access to updated pod", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -704,7 +705,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachabilityIsolated})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachabilityIsolated})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should deny egress from pods based on PodSelector [Feature:NetworkPolicy] ", func(ctx context.Context) {
|
f.It("should deny egress from pods based on PodSelector", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -718,7 +719,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should deny egress from all pods in a namespace [Feature:NetworkPolicy] ", func(ctx context.Context) {
|
f.It("should deny egress from all pods in a namespace", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -732,7 +733,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should work with Ingress, Egress specified together [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should work with Ingress, Egress specified together", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
allowedPodLabels := &metav1.LabelSelector{MatchLabels: map[string]string{"pod": "b"}}
|
allowedPodLabels := &metav1.LabelSelector{MatchLabels: map[string]string{"pod": "b"}}
|
||||||
ingressRule := networkingv1.NetworkPolicyIngressRule{}
|
ingressRule := networkingv1.NetworkPolicyIngressRule{}
|
||||||
ingressRule.From = append(ingressRule.From, networkingv1.NetworkPolicyPeer{PodSelector: allowedPodLabels})
|
ingressRule.From = append(ingressRule.From, networkingv1.NetworkPolicyPeer{PodSelector: allowedPodLabels})
|
||||||
@ -770,7 +771,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolTCP, Reachability: reachabilityPort81})
|
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolTCP, Reachability: reachabilityPort81})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should support denying of egress traffic on the client side (even if the server explicitly allows this traffic) [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should support denying of egress traffic on the client side (even if the server explicitly allows this traffic)", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
// x/a --> y/a and y/b
|
// x/a --> y/a and y/b
|
||||||
// Egress allowed to y/a only. Egress to y/b should be blocked
|
// Egress allowed to y/a only. Egress to y/b should be blocked
|
||||||
// Ingress on y/a and y/b allow traffic from x/a
|
// Ingress on y/a and y/b allow traffic from x/a
|
||||||
@ -866,7 +867,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce egress policy allowing traffic to a server in a different namespace based on PodSelector and NamespaceSelector [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce egress policy allowing traffic to a server in a different namespace based on PodSelector and NamespaceSelector", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -892,7 +893,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce ingress policy allowing any port traffic to a server on a specific protocol [Feature:NetworkPolicy] [Feature:UDP]", func(ctx context.Context) {
|
f.It("should enforce ingress policy allowing any port traffic to a server on a specific protocol", feature.NetworkPolicy, feature.UDP, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP, protocolUDP}
|
protocols := []v1.Protocol{protocolTCP, protocolUDP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -910,7 +911,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolUDP, Reachability: reachabilityUDP})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolUDP, Reachability: reachabilityUDP})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce multiple ingress policies with ingress allow-all policy taking precedence [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce multiple ingress policies with ingress allow-all policy taking precedence", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{81}
|
ports := []int32{81}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -935,7 +936,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolTCP, Reachability: reachabilityAll})
|
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolTCP, Reachability: reachabilityAll})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce multiple egress policies with egress allow-all policy taking precedence [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce multiple egress policies with egress allow-all policy taking precedence", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
egressRule := networkingv1.NetworkPolicyEgressRule{}
|
egressRule := networkingv1.NetworkPolicyEgressRule{}
|
||||||
egressRule.Ports = append(egressRule.Ports, networkingv1.NetworkPolicyPort{Port: &intstr.IntOrString{Type: intstr.Int, IntVal: 80}})
|
egressRule.Ports = append(egressRule.Ports, networkingv1.NetworkPolicyPort{Port: &intstr.IntOrString{Type: intstr.Int, IntVal: 80}})
|
||||||
policyAllowPort80 := GenNetworkPolicyWithNameAndPodMatchLabel("allow-egress-port-80", map[string]string{}, SetSpecEgressRules(egressRule))
|
policyAllowPort80 := GenNetworkPolicyWithNameAndPodMatchLabel("allow-egress-port-80", map[string]string{}, SetSpecEgressRules(egressRule))
|
||||||
@ -960,7 +961,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolTCP, Reachability: reachabilityAll})
|
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolTCP, Reachability: reachabilityAll})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should stop enforcing policies after they are deleted [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should stop enforcing policies after they are deleted", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
ginkgo.By("Creating a network policy for the server which denies all traffic.")
|
ginkgo.By("Creating a network policy for the server which denies all traffic.")
|
||||||
|
|
||||||
// Deny all traffic into and out of "x".
|
// Deny all traffic into and out of "x".
|
||||||
@ -988,7 +989,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
|
|
||||||
// TODO, figure out how the next 3 tests should work with dual stack : do we need a different abstraction then just "podIP"?
|
// TODO, figure out how the next 3 tests should work with dual stack : do we need a different abstraction then just "podIP"?
|
||||||
|
|
||||||
ginkgo.It("should allow egress access to server in CIDR block [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should allow egress access to server in CIDR block", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
// Getting podServer's status to get podServer's IP, to create the CIDR
|
// Getting podServer's status to get podServer's IP, to create the CIDR
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
@ -1015,7 +1016,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce except clause while egress access to server in CIDR block [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce except clause while egress access to server in CIDR block", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
// Getting podServer's status to get podServer's IP, to create the CIDR with except clause
|
// Getting podServer's status to get podServer's IP, to create the CIDR with except clause
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
@ -1049,7 +1050,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should ensure an IP overlapping both IPBlock.CIDR and IPBlock.Except is allowed [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should ensure an IP overlapping both IPBlock.CIDR and IPBlock.Except is allowed", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
// Getting podServer's status to get podServer's IP, to create the CIDR with except clause
|
// Getting podServer's status to get podServer's IP, to create the CIDR with except clause
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
@ -1098,7 +1099,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachabilityAllow})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachabilityAllow})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce policies to check ingress and egress policies can be controlled independently based on PodSelector [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce policies to check ingress and egress policies can be controlled independently based on PodSelector", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
/*
|
/*
|
||||||
Test steps:
|
Test steps:
|
||||||
1. Verify every pod in every namespace can talk to each other
|
1. Verify every pod in every namespace can talk to each other
|
||||||
@ -1135,7 +1136,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
// This test *does* apply to plugins that do not implement SCTP. It is a
|
// This test *does* apply to plugins that do not implement SCTP. It is a
|
||||||
// security hole if you fail this test, because you are allowing TCP
|
// security hole if you fail this test, because you are allowing TCP
|
||||||
// traffic that is supposed to be blocked.
|
// traffic that is supposed to be blocked.
|
||||||
ginkgo.It("should not mistakenly treat 'protocol: SCTP' as 'protocol: TCP', even if the plugin doesn't support SCTP [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should not mistakenly treat 'protocol: SCTP' as 'protocol: TCP', even if the plugin doesn't support SCTP", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{81}
|
ports := []int32{81}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -1161,7 +1162,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
// This test *does* apply to plugins that do not implement SCTP. It is a
|
// This test *does* apply to plugins that do not implement SCTP. It is a
|
||||||
// security hole if you fail this test, because you are allowing TCP
|
// security hole if you fail this test, because you are allowing TCP
|
||||||
// traffic that is supposed to be blocked.
|
// traffic that is supposed to be blocked.
|
||||||
ginkgo.It("should properly isolate pods that are selected by a policy allowing SCTP, even if the plugin doesn't support SCTP [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should properly isolate pods that are selected by a policy allowing SCTP, even if the plugin doesn't support SCTP", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
ginkgo.By("Creating a network policy for the server which allows traffic only via SCTP on port 80.")
|
ginkgo.By("Creating a network policy for the server which allows traffic only via SCTP on port 80.")
|
||||||
ingressRule := networkingv1.NetworkPolicyIngressRule{}
|
ingressRule := networkingv1.NetworkPolicyIngressRule{}
|
||||||
ingressRule.Ports = append(ingressRule.Ports, networkingv1.NetworkPolicyPort{Port: &intstr.IntOrString{IntVal: 80}, Protocol: &protocolSCTP})
|
ingressRule.Ports = append(ingressRule.Ports, networkingv1.NetworkPolicyPort{Port: &intstr.IntOrString{IntVal: 80}, Protocol: &protocolSCTP})
|
||||||
@ -1178,7 +1179,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should not allow access by TCP when a policy specifies only UDP [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should not allow access by TCP when a policy specifies only UDP", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
ingressRule := networkingv1.NetworkPolicyIngressRule{}
|
ingressRule := networkingv1.NetworkPolicyIngressRule{}
|
||||||
ingressRule.Ports = append(ingressRule.Ports, networkingv1.NetworkPolicyPort{Port: &intstr.IntOrString{IntVal: 81}, Protocol: &protocolUDP})
|
ingressRule.Ports = append(ingressRule.Ports, networkingv1.NetworkPolicyPort{Port: &intstr.IntOrString{IntVal: 81}, Protocol: &protocolUDP})
|
||||||
policy := GenNetworkPolicyWithNameAndPodMatchLabel("allow-only-udp-ingress-on-port-81", map[string]string{"pod": "a"}, SetSpecIngressRules(ingressRule))
|
policy := GenNetworkPolicyWithNameAndPodMatchLabel("allow-only-udp-ingress-on-port-81", map[string]string{"pod": "a"}, SetSpecIngressRules(ingressRule))
|
||||||
@ -1197,7 +1198,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Note that this default ns functionality is maintained by the APIMachinery group, but we test it here anyways because its an important feature.
|
// Note that this default ns functionality is maintained by the APIMachinery group, but we test it here anyways because its an important feature.
|
||||||
ginkgo.It("should enforce policy to allow traffic based on NamespaceSelector with MatchLabels using default ns label [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce policy to allow traffic based on NamespaceSelector with MatchLabels using default ns label", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -1220,7 +1221,7 @@ var _ = common.SIGDescribe("Netpol", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Note that this default ns functionality is maintained by the APIMachinery group, but we test it here anyways because its an important feature.
|
// Note that this default ns functionality is maintained by the APIMachinery group, but we test it here anyways because its an important feature.
|
||||||
ginkgo.It("should enforce policy based on NamespaceSelector with MatchExpressions using default ns label [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce policy based on NamespaceSelector with MatchExpressions using default ns label", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolTCP}
|
protocols := []v1.Protocol{protocolTCP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -1256,7 +1257,7 @@ var _ = common.SIGDescribe("Netpol [LinuxOnly]", func() {
|
|||||||
|
|
||||||
ginkgo.Context("NetworkPolicy between server and client using UDP", func() {
|
ginkgo.Context("NetworkPolicy between server and client using UDP", func() {
|
||||||
|
|
||||||
ginkgo.It("should support a 'default-deny-ingress' policy [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should support a 'default-deny-ingress' policy", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolUDP}
|
protocols := []v1.Protocol{protocolUDP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -1270,7 +1271,7 @@ var _ = common.SIGDescribe("Netpol [LinuxOnly]", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolUDP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolUDP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce policy based on Ports [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce policy based on Ports", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
ginkgo.By("Creating a network policy allowPort81Policy which only allows allow listed namespaces (y) to connect on exactly one port (81)")
|
ginkgo.By("Creating a network policy allowPort81Policy which only allows allow listed namespaces (y) to connect on exactly one port (81)")
|
||||||
protocols := []v1.Protocol{protocolUDP}
|
protocols := []v1.Protocol{protocolUDP}
|
||||||
ports := []int32{81}
|
ports := []int32{81}
|
||||||
@ -1295,7 +1296,7 @@ var _ = common.SIGDescribe("Netpol [LinuxOnly]", func() {
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolUDP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolUDP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce policy to allow traffic only from a pod in a different namespace based on PodSelector and NamespaceSelector [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce policy to allow traffic only from a pod in a different namespace based on PodSelector and NamespaceSelector", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolUDP}
|
protocols := []v1.Protocol{protocolUDP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -1324,7 +1325,7 @@ var _ = common.SIGDescribe("Netpol [LinuxOnly]", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
var _ = common.SIGDescribe("Netpol [Feature:SCTPConnectivity][LinuxOnly]", func() {
|
var _ = common.SIGDescribe("Netpol", feature.SCTPConnectivity, "[LinuxOnly]", func() {
|
||||||
f := framework.NewDefaultFramework("sctp-network-policy")
|
f := framework.NewDefaultFramework("sctp-network-policy")
|
||||||
f.SkipNamespaceCreation = true
|
f.SkipNamespaceCreation = true
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
||||||
@ -1336,7 +1337,7 @@ var _ = common.SIGDescribe("Netpol [Feature:SCTPConnectivity][LinuxOnly]", func(
|
|||||||
|
|
||||||
ginkgo.Context("NetworkPolicy between server and client using SCTP", func() {
|
ginkgo.Context("NetworkPolicy between server and client using SCTP", func() {
|
||||||
|
|
||||||
ginkgo.It("should support a 'default-deny-ingress' policy [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should support a 'default-deny-ingress' policy", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolSCTP}
|
protocols := []v1.Protocol{protocolSCTP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
@ -1350,7 +1351,7 @@ var _ = common.SIGDescribe("Netpol [Feature:SCTPConnectivity][LinuxOnly]", func(
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolSCTP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 80, Protocol: v1.ProtocolSCTP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce policy based on Ports [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce policy based on Ports", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
ginkgo.By("Creating a network allowPort81Policy which only allows allow listed namespaces (y) to connect on exactly one port (81)")
|
ginkgo.By("Creating a network allowPort81Policy which only allows allow listed namespaces (y) to connect on exactly one port (81)")
|
||||||
protocols := []v1.Protocol{protocolSCTP}
|
protocols := []v1.Protocol{protocolSCTP}
|
||||||
ports := []int32{81}
|
ports := []int32{81}
|
||||||
@ -1374,7 +1375,7 @@ var _ = common.SIGDescribe("Netpol [Feature:SCTPConnectivity][LinuxOnly]", func(
|
|||||||
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolSCTP, Reachability: reachability})
|
ValidateOrFail(k8s, &TestCase{ToPort: 81, Protocol: v1.ProtocolSCTP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce policy to allow traffic only from a pod in a different namespace based on PodSelector and NamespaceSelector [Feature:NetworkPolicy]", func(ctx context.Context) {
|
f.It("should enforce policy to allow traffic only from a pod in a different namespace based on PodSelector and NamespaceSelector", feature.NetworkPolicy, func(ctx context.Context) {
|
||||||
protocols := []v1.Protocol{protocolSCTP}
|
protocols := []v1.Protocol{protocolSCTP}
|
||||||
ports := []int32{80}
|
ports := []int32{80}
|
||||||
k8s = initializeResources(ctx, f, protocols, ports)
|
k8s = initializeResources(ctx, f, protocols, ports)
|
||||||
|
@ -41,7 +41,7 @@ import (
|
|||||||
"github.com/onsi/gomega"
|
"github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = common.SIGDescribe("Services GCE [Slow]", func() {
|
var _ = common.SIGDescribe("Services GCE", framework.WithSlow(), func() {
|
||||||
f := framework.NewDefaultFramework("services")
|
f := framework.NewDefaultFramework("services")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ var _ = common.SIGDescribe("Services GCE [Slow]", func() {
|
|||||||
//reset serviceLBNames
|
//reset serviceLBNames
|
||||||
serviceLBNames = []string{}
|
serviceLBNames = []string{}
|
||||||
})
|
})
|
||||||
ginkgo.It("should be able to create and tear down a standard-tier load balancer [Slow]", func(ctx context.Context) {
|
f.It("should be able to create and tear down a standard-tier load balancer", f.WithSlow(), func(ctx context.Context) {
|
||||||
lagTimeout := e2eservice.LoadBalancerLagTimeoutDefault
|
lagTimeout := e2eservice.LoadBalancerLagTimeoutDefault
|
||||||
createTimeout := e2eservice.GetServiceLoadBalancerCreationTimeout(ctx, cs)
|
createTimeout := e2eservice.GetServiceLoadBalancerCreationTimeout(ctx, cs)
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/util/sets"
|
"k8s.io/apimachinery/pkg/util/sets"
|
||||||
utilwait "k8s.io/apimachinery/pkg/util/wait"
|
utilwait "k8s.io/apimachinery/pkg/util/wait"
|
||||||
"k8s.io/kubernetes/pkg/cluster/ports"
|
"k8s.io/kubernetes/pkg/cluster/ports"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2enetwork "k8s.io/kubernetes/test/e2e/framework/network"
|
e2enetwork "k8s.io/kubernetes/test/e2e/framework/network"
|
||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
@ -84,13 +85,13 @@ var _ = common.SIGDescribe("Networking", func() {
|
|||||||
f := framework.NewDefaultFramework(svcname)
|
f := framework.NewDefaultFramework(svcname)
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
|
|
||||||
ginkgo.It("should provide Internet connection for containers [Feature:Networking-IPv4]", func(ctx context.Context) {
|
f.It("should provide Internet connection for containers", feature.NetworkingIPv4, func(ctx context.Context) {
|
||||||
ginkgo.By("Running container which tries to connect to 8.8.8.8")
|
ginkgo.By("Running container which tries to connect to 8.8.8.8")
|
||||||
framework.ExpectNoError(
|
framework.ExpectNoError(
|
||||||
checkConnectivityToHost(ctx, f, "", "connectivity-test", "8.8.8.8", 53, 30))
|
checkConnectivityToHost(ctx, f, "", "connectivity-test", "8.8.8.8", 53, 30))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should provide Internet connection for containers [Feature:Networking-IPv6][Experimental][LinuxOnly]", func(ctx context.Context) {
|
f.It("should provide Internet connection for containers", feature.NetworkingIPv6, "[Experimental][LinuxOnly]", func(ctx context.Context) {
|
||||||
// IPv6 is not supported on Windows.
|
// IPv6 is not supported on Windows.
|
||||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||||
ginkgo.By("Running container which tries to connect to 2001:4860:4860::8888")
|
ginkgo.By("Running container which tries to connect to 2001:4860:4860::8888")
|
||||||
@ -98,7 +99,7 @@ var _ = common.SIGDescribe("Networking", func() {
|
|||||||
checkConnectivityToHost(ctx, f, "", "connectivity-test", "2001:4860:4860::8888", 53, 30))
|
checkConnectivityToHost(ctx, f, "", "connectivity-test", "2001:4860:4860::8888", 53, 30))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should provider Internet connection for containers using DNS [Feature:Networking-DNS]", func(ctx context.Context) {
|
f.It("should provider Internet connection for containers using DNS", feature.NetworkingDNS, func(ctx context.Context) {
|
||||||
ginkgo.By("Running container which tries to connect to google.com")
|
ginkgo.By("Running container which tries to connect to google.com")
|
||||||
framework.ExpectNoError(
|
framework.ExpectNoError(
|
||||||
checkConnectivityToHost(ctx, f, "", "connectivity-test", "google.com", 80, 30))
|
checkConnectivityToHost(ctx, f, "", "connectivity-test", "google.com", 80, 30))
|
||||||
@ -176,7 +177,7 @@ var _ = common.SIGDescribe("Networking", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should function for pod-Service: sctp [Feature:SCTPConnectivity]", func(ctx context.Context) {
|
f.It("should function for pod-Service: sctp", feature.SCTPConnectivity, func(ctx context.Context) {
|
||||||
config := e2enetwork.NewNetworkingTestConfig(ctx, f, e2enetwork.EnableSCTP)
|
config := e2enetwork.NewNetworkingTestConfig(ctx, f, e2enetwork.EnableSCTP)
|
||||||
ginkgo.By(fmt.Sprintf("dialing(sctp) %v --> %v:%v (config.clusterIP)", config.TestContainerPod.Name, config.ClusterIP, e2enetwork.ClusterSCTPPort))
|
ginkgo.By(fmt.Sprintf("dialing(sctp) %v --> %v:%v (config.clusterIP)", config.TestContainerPod.Name, config.ClusterIP, e2enetwork.ClusterSCTPPort))
|
||||||
err := config.DialFromTestContainer(ctx, "sctp", config.ClusterIP, e2enetwork.ClusterSCTPPort, config.MaxTries, 0, config.EndpointHostnames())
|
err := config.DialFromTestContainer(ctx, "sctp", config.ClusterIP, e2enetwork.ClusterSCTPPort, config.MaxTries, 0, config.EndpointHostnames())
|
||||||
@ -218,7 +219,7 @@ var _ = common.SIGDescribe("Networking", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should function for node-Service: sctp [Feature:SCTPConnectivity]", func(ctx context.Context) {
|
f.It("should function for node-Service: sctp", feature.SCTPConnectivity, func(ctx context.Context) {
|
||||||
ginkgo.Skip("Skipping SCTP node to service test until DialFromNode supports SCTP #96482")
|
ginkgo.Skip("Skipping SCTP node to service test until DialFromNode supports SCTP #96482")
|
||||||
config := e2enetwork.NewNetworkingTestConfig(ctx, f, e2enetwork.EnableSCTP)
|
config := e2enetwork.NewNetworkingTestConfig(ctx, f, e2enetwork.EnableSCTP)
|
||||||
ginkgo.By(fmt.Sprintf("dialing(sctp) %v (node) --> %v:%v (config.clusterIP)", config.NodeIP, config.ClusterIP, e2enetwork.ClusterSCTPPort))
|
ginkgo.By(fmt.Sprintf("dialing(sctp) %v (node) --> %v:%v (config.clusterIP)", config.NodeIP, config.ClusterIP, e2enetwork.ClusterSCTPPort))
|
||||||
@ -262,7 +263,7 @@ var _ = common.SIGDescribe("Networking", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should function for endpoint-Service: sctp [Feature:SCTPConnectivity]", func(ctx context.Context) {
|
f.It("should function for endpoint-Service: sctp", feature.SCTPConnectivity, func(ctx context.Context) {
|
||||||
config := e2enetwork.NewNetworkingTestConfig(ctx, f, e2enetwork.EnableSCTP)
|
config := e2enetwork.NewNetworkingTestConfig(ctx, f, e2enetwork.EnableSCTP)
|
||||||
ginkgo.By(fmt.Sprintf("dialing(sctp) %v (endpoint) --> %v:%v (config.clusterIP)", config.EndpointPods[0].Name, config.ClusterIP, e2enetwork.ClusterSCTPPort))
|
ginkgo.By(fmt.Sprintf("dialing(sctp) %v (endpoint) --> %v:%v (config.clusterIP)", config.EndpointPods[0].Name, config.ClusterIP, e2enetwork.ClusterSCTPPort))
|
||||||
err := config.DialFromEndpointContainer(ctx, "sctp", config.ClusterIP, e2enetwork.ClusterSCTPPort, config.MaxTries, 0, config.EndpointHostnames())
|
err := config.DialFromEndpointContainer(ctx, "sctp", config.ClusterIP, e2enetwork.ClusterSCTPPort, config.MaxTries, 0, config.EndpointHostnames())
|
||||||
@ -359,7 +360,7 @@ var _ = common.SIGDescribe("Networking", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Slow because we confirm that the nodePort doesn't serve traffic, which requires a period of polling.
|
// Slow because we confirm that the nodePort doesn't serve traffic, which requires a period of polling.
|
||||||
ginkgo.It("should update nodePort: http [Slow]", func(ctx context.Context) {
|
f.It("should update nodePort: http", f.WithSlow(), func(ctx context.Context) {
|
||||||
config := e2enetwork.NewNetworkingTestConfig(ctx, f, e2enetwork.UseHostNetwork)
|
config := e2enetwork.NewNetworkingTestConfig(ctx, f, e2enetwork.UseHostNetwork)
|
||||||
ginkgo.By(fmt.Sprintf("dialing(http) %v (node) --> %v:%v (ctx, nodeIP) and getting ALL host endpoints", config.NodeIP, config.NodeIP, config.NodeHTTPPort))
|
ginkgo.By(fmt.Sprintf("dialing(http) %v (node) --> %v:%v (ctx, nodeIP) and getting ALL host endpoints", config.NodeIP, config.NodeIP, config.NodeHTTPPort))
|
||||||
err := config.DialFromNode(ctx, "http", config.NodeIP, config.NodeHTTPPort, config.MaxTries, 0, config.EndpointHostnames())
|
err := config.DialFromNode(ctx, "http", config.NodeIP, config.NodeHTTPPort, config.MaxTries, 0, config.EndpointHostnames())
|
||||||
@ -390,7 +391,7 @@ var _ = common.SIGDescribe("Networking", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Slow because we confirm that the nodePort doesn't serve traffic, which requires a period of polling.
|
// Slow because we confirm that the nodePort doesn't serve traffic, which requires a period of polling.
|
||||||
ginkgo.It("should update nodePort: udp [Slow]", func(ctx context.Context) {
|
f.It("should update nodePort: udp", f.WithSlow(), func(ctx context.Context) {
|
||||||
config := e2enetwork.NewNetworkingTestConfig(ctx, f, e2enetwork.UseHostNetwork)
|
config := e2enetwork.NewNetworkingTestConfig(ctx, f, e2enetwork.UseHostNetwork)
|
||||||
ginkgo.By(fmt.Sprintf("dialing(udp) %v (node) --> %v:%v (nodeIP) and getting ALL host endpoints", config.NodeIP, config.NodeIP, config.NodeUDPPort))
|
ginkgo.By(fmt.Sprintf("dialing(udp) %v (node) --> %v:%v (nodeIP) and getting ALL host endpoints", config.NodeIP, config.NodeIP, config.NodeUDPPort))
|
||||||
err := config.DialFromNode(ctx, "udp", config.NodeIP, config.NodeUDPPort, config.MaxTries, 0, config.EndpointHostnames())
|
err := config.DialFromNode(ctx, "udp", config.NodeIP, config.NodeUDPPort, config.MaxTries, 0, config.EndpointHostnames())
|
||||||
@ -547,7 +548,7 @@ var _ = common.SIGDescribe("Networking", func() {
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should recreate its iptables rules if they are deleted [Disruptive]", func(ctx context.Context) {
|
f.It("should recreate its iptables rules if they are deleted", f.WithDisruptive(), func(ctx context.Context) {
|
||||||
e2eskipper.SkipUnlessProviderIs(framework.ProvidersWithSSH...)
|
e2eskipper.SkipUnlessProviderIs(framework.ProvidersWithSSH...)
|
||||||
e2eskipper.SkipUnlessSSHKeyPresent()
|
e2eskipper.SkipUnlessSSHKeyPresent()
|
||||||
|
|
||||||
@ -634,7 +635,7 @@ var _ = common.SIGDescribe("Networking", func() {
|
|||||||
|
|
||||||
// This is [Serial] because it can't run at the same time as the
|
// This is [Serial] because it can't run at the same time as the
|
||||||
// [Feature:SCTPConnectivity] tests, since they may cause sctp.ko to be loaded.
|
// [Feature:SCTPConnectivity] tests, since they may cause sctp.ko to be loaded.
|
||||||
ginkgo.It("should allow creating a Pod with an SCTP HostPort [LinuxOnly] [Serial]", func(ctx context.Context) {
|
f.It("should allow creating a Pod with an SCTP HostPort [LinuxOnly]", f.WithSerial(), func(ctx context.Context) {
|
||||||
node, err := e2enode.GetRandomReadySchedulableNode(ctx, f.ClientSet)
|
node, err := e2enode.GetRandomReadySchedulableNode(ctx, f.ClientSet)
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
hostExec := utils.NewHostExec(f)
|
hostExec := utils.NewHostExec(f)
|
||||||
|
@ -29,6 +29,7 @@ import (
|
|||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2edaemonset "k8s.io/kubernetes/test/e2e/framework/daemonset"
|
e2edaemonset "k8s.io/kubernetes/test/e2e/framework/daemonset"
|
||||||
e2edeployment "k8s.io/kubernetes/test/e2e/framework/deployment"
|
e2edeployment "k8s.io/kubernetes/test/e2e/framework/deployment"
|
||||||
@ -137,7 +138,7 @@ func iperf2ClientDaemonSet(ctx context.Context, client clientset.Interface, name
|
|||||||
// would require n^2 tests, n^2 time, and n^2 network resources which quickly become prohibitively large
|
// would require n^2 tests, n^2 time, and n^2 network resources which quickly become prohibitively large
|
||||||
// as the cluster size increases.
|
// as the cluster size increases.
|
||||||
// Finally, after collecting all data, the results are analyzed and tabulated.
|
// Finally, after collecting all data, the results are analyzed and tabulated.
|
||||||
var _ = common.SIGDescribe("Networking IPerf2 [Feature:Networking-Performance]", func() {
|
var _ = common.SIGDescribe("Networking IPerf2", feature.NetworkingPerformance, func() {
|
||||||
// this test runs iperf2: one pod as a server, and a daemonset of clients
|
// this test runs iperf2: one pod as a server, and a daemonset of clients
|
||||||
f := framework.NewDefaultFramework("network-perf")
|
f := framework.NewDefaultFramework("network-perf")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
||||||
|
@ -29,6 +29,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
|
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
@ -63,7 +64,7 @@ var (
|
|||||||
|
|
||||||
// This test verifies that a Pod on each node in a cluster can talk to Pods on every other node without SNAT.
|
// This test verifies that a Pod on each node in a cluster can talk to Pods on every other node without SNAT.
|
||||||
// We use the [Feature:NoSNAT] tag so that most jobs will skip this test by default.
|
// We use the [Feature:NoSNAT] tag so that most jobs will skip this test by default.
|
||||||
var _ = common.SIGDescribe("NoSNAT [Feature:NoSNAT] [Slow]", func() {
|
var _ = common.SIGDescribe("NoSNAT", feature.NoSNAT, framework.WithSlow(), func() {
|
||||||
f := framework.NewDefaultFramework("no-snat-test")
|
f := framework.NewDefaultFramework("no-snat-test")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
ginkgo.It("Should be able to send traffic between Pods without SNAT", func(ctx context.Context) {
|
ginkgo.It("Should be able to send traffic between Pods without SNAT", func(ctx context.Context) {
|
||||||
|
@ -1195,7 +1195,7 @@ var _ = common.SIGDescribe("Services", func() {
|
|||||||
framework.ExpectNoError(verifyServeHostnameServiceUp(ctx, cs, ns, podNames, svc.Spec.ClusterIP, servicePort))
|
framework.ExpectNoError(verifyServeHostnameServiceUp(ctx, cs, ns, podNames, svc.Spec.ClusterIP, servicePort))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should work after restarting kube-proxy [Disruptive]", func(ctx context.Context) {
|
f.It("should work after restarting kube-proxy", f.WithDisruptive(), func(ctx context.Context) {
|
||||||
kubeProxyLabelSet := map[string]string{clusterAddonLabelKey: kubeProxyLabelName}
|
kubeProxyLabelSet := map[string]string{clusterAddonLabelKey: kubeProxyLabelName}
|
||||||
e2eskipper.SkipUnlessComponentRunsAsPodsAndClientCanDeleteThem(ctx, kubeProxyLabelName, cs, metav1.NamespaceSystem, kubeProxyLabelSet)
|
e2eskipper.SkipUnlessComponentRunsAsPodsAndClientCanDeleteThem(ctx, kubeProxyLabelName, cs, metav1.NamespaceSystem, kubeProxyLabelSet)
|
||||||
|
|
||||||
@ -1228,7 +1228,7 @@ var _ = common.SIGDescribe("Services", func() {
|
|||||||
framework.ExpectNoError(verifyServeHostnameServiceUp(ctx, cs, ns, podNames2, svc2IP, servicePort))
|
framework.ExpectNoError(verifyServeHostnameServiceUp(ctx, cs, ns, podNames2, svc2IP, servicePort))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should work after restarting apiserver [Disruptive]", func(ctx context.Context) {
|
f.It("should work after restarting apiserver", f.WithDisruptive(), func(ctx context.Context) {
|
||||||
|
|
||||||
if !framework.ProviderIs("gke") {
|
if !framework.ProviderIs("gke") {
|
||||||
e2eskipper.SkipUnlessComponentRunsAsPodsAndClientCanDeleteThem(ctx, kubeAPIServerLabelName, cs, metav1.NamespaceSystem, map[string]string{clusterComponentKey: kubeAPIServerLabelName})
|
e2eskipper.SkipUnlessComponentRunsAsPodsAndClientCanDeleteThem(ctx, kubeAPIServerLabelName, cs, metav1.NamespaceSystem, map[string]string{clusterComponentKey: kubeAPIServerLabelName})
|
||||||
@ -3827,7 +3827,7 @@ var _ = common.SIGDescribe("Services", func() {
|
|||||||
|
|
||||||
// These is [Serial] because it can't run at the same time as the
|
// These is [Serial] because it can't run at the same time as the
|
||||||
// [Feature:SCTPConnectivity] tests, since they may cause sctp.ko to be loaded.
|
// [Feature:SCTPConnectivity] tests, since they may cause sctp.ko to be loaded.
|
||||||
ginkgo.It("should allow creating a basic SCTP service with pod and endpoints [LinuxOnly] [Serial]", func(ctx context.Context) {
|
f.It("should allow creating a basic SCTP service with pod and endpoints [LinuxOnly]", f.WithSerial(), func(ctx context.Context) {
|
||||||
serviceName := "sctp-endpoint-test"
|
serviceName := "sctp-endpoint-test"
|
||||||
ns := f.Namespace.Name
|
ns := f.Namespace.Name
|
||||||
jig := e2eservice.NewTestJig(cs, ns, serviceName)
|
jig := e2eservice.NewTestJig(cs, ns, serviceName)
|
||||||
|
@ -26,6 +26,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/util/intstr"
|
"k8s.io/apimachinery/pkg/util/intstr"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
@ -35,7 +36,7 @@ import (
|
|||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = common.SIGDescribe("[Feature:ServiceCIDRs]", func() {
|
var _ = common.SIGDescribe(feature.ServiceCIDRs, func() {
|
||||||
|
|
||||||
fr := framework.NewDefaultFramework("servicecidrs")
|
fr := framework.NewDefaultFramework("servicecidrs")
|
||||||
fr.NamespacePodSecurityEnforceLevel = admissionapi.LevelPrivileged
|
fr.NamespacePodSecurityEnforceLevel = admissionapi.LevelPrivileged
|
||||||
|
@ -30,6 +30,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/util/intstr"
|
"k8s.io/apimachinery/pkg/util/intstr"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2edaemonset "k8s.io/kubernetes/test/e2e/framework/daemonset"
|
e2edaemonset "k8s.io/kubernetes/test/e2e/framework/daemonset"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
@ -40,7 +41,7 @@ import (
|
|||||||
admissionapi "k8s.io/pod-security-admission/api"
|
admissionapi "k8s.io/pod-security-admission/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = common.SIGDescribe("[Feature:Topology Hints]", func() {
|
var _ = common.SIGDescribe(feature.TopologyHints, func() {
|
||||||
f := framework.NewDefaultFramework("topology-hints")
|
f := framework.NewDefaultFramework("topology-hints")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ import (
|
|||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
podutil "k8s.io/kubernetes/pkg/api/v1/pod"
|
podutil "k8s.io/kubernetes/pkg/api/v1/pod"
|
||||||
commonutils "k8s.io/kubernetes/test/e2e/common"
|
commonutils "k8s.io/kubernetes/test/e2e/common"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2eauth "k8s.io/kubernetes/test/e2e/framework/auth"
|
e2eauth "k8s.io/kubernetes/test/e2e/framework/auth"
|
||||||
e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl"
|
e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl"
|
||||||
@ -45,7 +46,7 @@ const (
|
|||||||
serverStartTimeout = framework.PodStartTimeout + 3*time.Minute
|
serverStartTimeout = framework.PodStartTimeout + 3*time.Minute
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SIGDescribe("[Feature:Example]", func() {
|
var _ = SIGDescribe(feature.Example, func() {
|
||||||
f := framework.NewDefaultFramework("examples")
|
f := framework.NewDefaultFramework("examples")
|
||||||
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/util/uuid"
|
"k8s.io/apimachinery/pkg/util/uuid"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl"
|
e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl"
|
||||||
e2ekubelet "k8s.io/kubernetes/test/e2e/framework/kubelet"
|
e2ekubelet "k8s.io/kubernetes/test/e2e/framework/kubelet"
|
||||||
@ -456,7 +457,7 @@ var _ = SIGDescribe("kubelet", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Tests for NodeLogQuery feature
|
// Tests for NodeLogQuery feature
|
||||||
ginkgo.Describe("kubectl get --raw \"/api/v1/nodes/<insert-node-name-here>/proxy/logs/?query=/<insert-log-file-name-here> [Feature:NodeLogQuery] [LinuxOnly]", func() {
|
f.Describe("kubectl get --raw \"/api/v1/nodes/<insert-node-name-here>/proxy/logs/?query=/<insert-log-file-name-here>", feature.NodeLogQuery, "[LinuxOnly]", func() {
|
||||||
var (
|
var (
|
||||||
numNodes int
|
numNodes int
|
||||||
nodeNames sets.String
|
nodeNames sets.String
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user