-
Notifications
You must be signed in to change notification settings - Fork 67
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
test(e2e): validate that pulling from an acr registry attached to aks via --attach-acr with karpenter nodes works #369
Closed
Bryce-Soghigian
wants to merge
3
commits into
Azure:main
from
Bryce-Soghigian:bsoghigian/e2e-acr-pull-clean
Closed
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
Portions Copyright (c) Microsoft Corporation. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
package acr | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"testing" | ||
"time" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
v1 "k8s.io/api/core/v1" | ||
|
||
"github.com/Azure/karpenter-provider-azure/pkg/apis/v1alpha2" | ||
"github.com/Azure/karpenter-provider-azure/test/pkg/environment/azure" | ||
"k8s.io/apimachinery/pkg/api/resource" | ||
"k8s.io/apimachinery/pkg/labels" | ||
corev1beta1 "sigs.k8s.io/karpenter/pkg/apis/v1beta1" | ||
"sigs.k8s.io/karpenter/pkg/test" | ||
) | ||
|
||
var env *azure.Environment | ||
var nodeClass *v1alpha2.AKSNodeClass | ||
var nodePool *corev1beta1.NodePool | ||
var pauseImage string | ||
|
||
func TestAcr(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
BeforeSuite(func() { | ||
env = azure.NewEnvironment(t) | ||
acrName := os.Getenv("AZURE_ACR_NAME") | ||
Expect(acrName).NotTo(BeEmpty(), "AZURE_ACR_NAME must be set for the acr test suite") | ||
pauseImage = fmt.Sprintf("%s.azurecr.io/pause:3.6", acrName) | ||
}) | ||
RunSpecs(t, "Acr") | ||
} | ||
|
||
var _ = BeforeEach(func() { | ||
env.BeforeEach() | ||
nodeClass = env.DefaultAKSNodeClass() | ||
nodePool = env.DefaultNodePool(nodeClass) | ||
}) | ||
var _ = AfterEach(func() { env.Cleanup() }) | ||
var _ = AfterEach(func() { env.AfterEach() }) | ||
|
||
var _ = Describe("Acr", func() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I created an ACR suite rather than just adding to the existing integration suite because artifact streaming will require a suite for ACR behavior here as well. |
||
Describe("Image Pull", func() { | ||
Bryce-Soghigian marked this conversation as resolved.
Show resolved
Hide resolved
|
||
It("should allow karpenter user pool nodes to pull images from the clusters attached acr", func() { | ||
deployment := test.Deployment(test.DeploymentOptions{ | ||
Replicas: 10, | ||
PodOptions: test.PodOptions{ | ||
ResourceRequirements: v1.ResourceRequirements{ | ||
Requests: v1.ResourceList{ | ||
v1.ResourceCPU: resource.MustParse("1.1"), | ||
}, | ||
}, | ||
Image: pauseImage, | ||
}, | ||
}) | ||
|
||
env.ExpectCreated(nodePool, nodeClass, deployment) | ||
env.EventuallyExpectHealthyPodCountWithTimeout(time.Minute*15, labels.SelectorFromSet(deployment.Spec.Selector.MatchLabels), int(*deployment.Spec.Replicas)) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
AcrIntegration
might be a better name? Not a strong opinion though.But another thing to consider is that making it
ACR
might be more consistent withGPU
one we have to the left.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah seems like a bit much