-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
WIP: test/e2e/storage: replace mock driver with hostpath driver #101672
Conversation
@avalluri: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@avalluri: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @avalluri. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -93,3 +103,12 @@ spec: | |||
path: /var/lib/kubelet/plugins_registry | |||
type: Directory | |||
name: registration-dir | |||
- hostPath: | |||
# 'path' is where PV data is persisted on host. | |||
path: /var/lib/csi-hostpath-data/ |
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.
These tests are going to run in parallel, potentially on the same hosts. Therefore we can't use /var/lib/csi-hostpath-data
on the host.
I don't think any of the mock tests rely on persisting the driver state across pod restarts. Therefore let's not use any hostpath volume. Instead pass -statedir=/tmp/csi-hostpath-data
as parameter.
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.
I changed to use --statedir
for saving the state.
3d396bb
to
4c0a76c
Compare
/ok-to-test |
- "--drivername=mock.storage.k8s.io" | ||
- "--nodeid=$(KUBE_NODE_NAME)" | ||
- "--endpoint=/csi/csi.sock" | ||
- "--statedir=/csi-data-dir" |
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.
My proposal was to use /tmp/csi-hostpath-data
, not /csi-data-dir
. It makes the intent clearer (don't persist) and might also be a bit more efficient (tmpfs vs overlayfs with actual disk IO).
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.
Changed statedir to /tmp/csi-hostpath-data, as suggested.
# having below chagnes; | ||
# - https://github.com/kubernetes-csi/csi-driver-host-path/pull/269 | ||
# - https://github.com/kubernetes-csi/csi-driver-host-path/pull/260 # | ||
image: k8s.gcr.io/sig-storage/hostpathplugin:canary |
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.
The "canary" images don't get promoted to k8s.gcr.io/sig-storage
. You have to use docker pull gcr.io/k8s-staging-sig-storage/hostpathplugin:canary
.
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.
This patch enables pulling that image:
diff --git a/test/utils/image/manifest.go b/test/utils/image/manifest.go
index a8f60a8de85..068ef120031 100644
--- a/test/utils/image/manifest.go
+++ b/test/utils/image/manifest.go
@@ -30,18 +30,19 @@ import (
// RegistryList holds public and private image registries
type RegistryList struct {
- GcAuthenticatedRegistry string `yaml:"gcAuthenticatedRegistry"`
- E2eRegistry string `yaml:"e2eRegistry"`
- PromoterE2eRegistry string `yaml:"promoterE2eRegistry"`
- BuildImageRegistry string `yaml:"buildImageRegistry"`
- InvalidRegistry string `yaml:"invalidRegistry"`
- GcEtcdRegistry string `yaml:"gcEtcdRegistry"`
- GcRegistry string `yaml:"gcRegistry"`
- SigStorageRegistry string `yaml:"sigStorageRegistry"`
- GcrReleaseRegistry string `yaml:"gcrReleaseRegistry"`
- PrivateRegistry string `yaml:"privateRegistry"`
- SampleRegistry string `yaml:"sampleRegistry"`
- MicrosoftRegistry string `yaml:"microsoftRegistry"`
+ GcAuthenticatedRegistry string `yaml:"gcAuthenticatedRegistry"`
+ E2eRegistry string `yaml:"e2eRegistry"`
+ PromoterE2eRegistry string `yaml:"promoterE2eRegistry"`
+ BuildImageRegistry string `yaml:"buildImageRegistry"`
+ InvalidRegistry string `yaml:"invalidRegistry"`
+ GcEtcdRegistry string `yaml:"gcEtcdRegistry"`
+ GcRegistry string `yaml:"gcRegistry"`
+ SigStorageRegistry string `yaml:"sigStorageRegistry"`
+ SigStorageCanaryRegistry string `yaml:"sigStorageCanaryRegistry"`
+ GcrReleaseRegistry string `yaml:"gcrReleaseRegistry"`
+ PrivateRegistry string `yaml:"privateRegistry"`
+ SampleRegistry string `yaml:"sampleRegistry"`
+ MicrosoftRegistry string `yaml:"microsoftRegistry"`
}
// Config holds an images registry, name, and version
@@ -68,18 +69,19 @@ func (i *Config) SetVersion(version string) {
func initReg() RegistryList {
registry := RegistryList{
- GcAuthenticatedRegistry: "gcr.io/authenticated-image-pulling",
- E2eRegistry: "gcr.io/kubernetes-e2e-test-images",
- PromoterE2eRegistry: "k8s.gcr.io/e2e-test-images",
- BuildImageRegistry: "k8s.gcr.io/build-image",
- InvalidRegistry: "invalid.com/invalid",
- GcEtcdRegistry: "k8s.gcr.io",
- GcRegistry: "k8s.gcr.io",
- SigStorageRegistry: "k8s.gcr.io/sig-storage",
- PrivateRegistry: "gcr.io/k8s-authenticated-test",
- SampleRegistry: "gcr.io/google-samples",
- GcrReleaseRegistry: "gcr.io/gke-release",
- MicrosoftRegistry: "mcr.microsoft.com",
+ GcAuthenticatedRegistry: "gcr.io/authenticated-image-pulling",
+ E2eRegistry: "gcr.io/kubernetes-e2e-test-images",
+ PromoterE2eRegistry: "k8s.gcr.io/e2e-test-images",
+ BuildImageRegistry: "k8s.gcr.io/build-image",
+ InvalidRegistry: "invalid.com/invalid",
+ GcEtcdRegistry: "k8s.gcr.io",
+ GcRegistry: "k8s.gcr.io",
+ SigStorageRegistry: "k8s.gcr.io/sig-storage",
+ SigStorageCanaryRegistry: "gcr.io/k8s-staging-sig-storage",
+ PrivateRegistry: "gcr.io/k8s-authenticated-test",
+ SampleRegistry: "gcr.io/google-samples",
+ GcrReleaseRegistry: "gcr.io/gke-release",
+ MicrosoftRegistry: "mcr.microsoft.com",
}
repoList := os.Getenv("KUBE_TEST_REPO_LIST")
if repoList == "" {
@@ -105,18 +107,19 @@ var (
PrivateRegistry = registry.PrivateRegistry
// Preconfigured image configs
- dockerLibraryRegistry = "docker.io/library"
- e2eRegistry = registry.E2eRegistry
- promoterE2eRegistry = registry.PromoterE2eRegistry
- buildImageRegistry = registry.BuildImageRegistry
- gcAuthenticatedRegistry = registry.GcAuthenticatedRegistry
- gcEtcdRegistry = registry.GcEtcdRegistry
- gcRegistry = registry.GcRegistry
- sigStorageRegistry = registry.SigStorageRegistry
- gcrReleaseRegistry = registry.GcrReleaseRegistry
- invalidRegistry = registry.InvalidRegistry
- sampleRegistry = registry.SampleRegistry
- microsoftRegistry = registry.MicrosoftRegistry
+ dockerLibraryRegistry = "docker.io/library"
+ e2eRegistry = registry.E2eRegistry
+ promoterE2eRegistry = registry.PromoterE2eRegistry
+ buildImageRegistry = registry.BuildImageRegistry
+ gcAuthenticatedRegistry = registry.GcAuthenticatedRegistry
+ gcEtcdRegistry = registry.GcEtcdRegistry
+ gcRegistry = registry.GcRegistry
+ sigStorageRegistry = registry.SigStorageRegistry
+ sigStorageCanaryRegistry = registry.SigStorageCanaryRegistry
+ gcrReleaseRegistry = registry.GcrReleaseRegistry
+ invalidRegistry = registry.InvalidRegistry
+ sampleRegistry = registry.SampleRegistry
+ microsoftRegistry = registry.MicrosoftRegistry
imageConfigs, originalImageConfigs = initImageConfigs()
)
@@ -393,6 +396,8 @@ func ReplaceRegistryInImageURL(imageURL string) (string, error) {
registryAndUser = gcRegistry
case "k8s.gcr.io/sig-storage":
registryAndUser = sigStorageRegistry
+ case "gcr.io/k8s-staging-sig-storage":
+ registryAndUser = sigStorageCanaryRegistry
case "gcr.io/k8s-authenticated-test":
registryAndUser = PrivateRegistry
case "gcr.io/google-samples":
I wonder whether we should add that permanently and not just while experimenting with a canary image. I remember having to add and remove this already a few times.
@msau42 any thoughts on this?
@avalluri : put it into a separate commit for now, please.
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.
Done.
4c0a76c
to
45c53e1
Compare
This is a first step towards removing the mock CSI driver completely from e2e testing in favor of hostpath plugin. With the recent hostpath plugin changes(PR kubernetes#260, kubernetes#269), it supports all the features supported by the mock csi driver. Using hostpath-plugin for testing also covers CSI persistent feature usecases.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: avalluri The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This allows to test using sigstorage canary images.
@avalluri: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This is a first step towards removing the mock CSI driver completely from
e2e testing in favor of hostpath plugin. With the recent hostpath plugin
changes(PR #260, #269), it supports all the features supported by the mock
csi driver.
Using hostpath-plugin for testing also covers CSI persistent feature
usecases.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
The PR is in WIP as it requires a hostpath-plugin release with the needed changes. Currently, it is using hostpath 'canary' images.
Does this PR introduce a user-facing change?
No
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: