Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the check for Node bootstrap issue #303

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions test/e2e/cache/create_enable_for_private_registry_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,6 @@ func addPrivateRegistrySecret(shoot *gardencorev1beta1.Shoot) {

// deployUpstreamRegistry deploy test upstream registry and return the <host:port> to it
func deployUpstreamRegistry(ctx context.Context, f *framework.ShootCreationFramework, password string) (upstreamHostPort string) {
ctx, cancel := context.WithTimeout(ctx, 5*time.Minute)
defer cancel()

// Create htpasswd Secret
encryptedPassword, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)
ExpectWithOffset(1, err).NotTo(HaveOccurred())
Expand Down
28 changes: 22 additions & 6 deletions test/e2e/cache/create_enabled_delete_shoot_system_components.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ import (
"context"
"time"

"github.com/gardener/gardener/test/framework"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/ptr"

"github.com/gardener/gardener-extension-registry-cache/pkg/apis/registry/v1alpha3"
"github.com/gardener/gardener-extension-registry-cache/test/common"
Expand All @@ -32,17 +35,30 @@ var _ = Describe("Registry Cache Extension Tests", Label("cache"), func() {

It("should create Shoot with registry-cache extension enabled with caches for Shoot system components, delete Shoot", func() {
By("Create Shoot")
// Use 10min as timeout to verify that we don't have a Node bootstrap issue.
// https://github.com/gardener/gardener-extension-registry-cache/pull/68 fixes the Node bootstrap issue
// and this tests verifies that the scenario does not regress.
//
// Mitigate https://github.com/gardener/gardener-extension-registry-cache/issues/290 by increasing context timeout to 15min to prevent flakes.
// TODO(dimitar-kostadinov): Fix https://github.com/gardener/gardener-extension-registry-cache/issues/290 in a permanent way.
ctx, cancel := context.WithTimeout(parentCtx, 15*time.Minute)
defer cancel()
Expect(f.CreateShootAndWaitForCreation(ctx, false)).To(Succeed())
f.Verify()

By("Make sure there is no I/O timeout during containerd image pulls")
ctx, cancel = context.WithTimeout(parentCtx, 3*time.Minute)
defer cancel()

nodeList, err := framework.GetAllNodesInWorkerPool(ctx, f.ShootFramework.ShootClient, ptr.To("local"))
Expect(err).NotTo(HaveOccurred())
Expect(len(nodeList.Items)).To(BeNumerically(">=", 1), "Expected to find at least one Node in the cluster")

rootPodExecutor := framework.NewRootPodExecutor(f.Logger, f.ShootFramework.ShootClient, &nodeList.Items[0].Name, metav1.NamespaceSystem)
defer func(ctx context.Context, rootPodExecutor framework.RootPodExecutor) {
_ = rootPodExecutor.Clean(ctx)
}(ctx, rootPodExecutor)
// Make sure we don't have a Node bootstrap issue, i.e. there is no I/O timeout during image pull in the containerd logs.
// https://github.com/gardener/gardener-extension-registry-cache/pull/68 fixes the Node bootstrap issue
// and this tests verifies that the scenario does not regress.
output, err := rootPodExecutor.Execute(ctx, `journalctl -u containerd | grep -E "msg=\"trying next host\" error=\"failed to do request: Head .+ i/o timeout\"" || test $? = 1`)
Expect(err).NotTo(HaveOccurred())
Expect(string(output)).To(BeEmpty())

By("[europe-docker.pkg.dev] Verify registry-cache works")
common.VerifyRegistryCache(parentCtx, f.Logger, f.ShootFramework.ShootClient, common.ArtifactRegistryNginx1176Image)

Expand Down