-
Notifications
You must be signed in to change notification settings - Fork 1.4k
✨ Add e2e test template to check whether the upgrade plan works correctly #12955
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
Open
sivchari
wants to merge
1
commit into
kubernetes-sigs:main
Choose a base branch
from
sivchari:add-e2etest-upgrades-plan
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+238
−0
Open
Changes from all commits
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
48 changes: 48 additions & 0 deletions
48
...in/cluster-template-upgrades-runtimesdk-generateplan/cluster-runtimesdk-generateplan.yaml
This file contains hidden or 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,48 @@ | ||
| apiVersion: cluster.x-k8s.io/v1beta2 | ||
| kind: Cluster | ||
| metadata: | ||
| name: '${CLUSTER_NAME}' | ||
| namespace: default | ||
| labels: | ||
| cni: "${CLUSTER_NAME}-crs-0" | ||
| spec: | ||
| clusterNetwork: | ||
| services: | ||
| cidrBlocks: ['${DOCKER_SERVICE_CIDRS}'] | ||
| pods: | ||
| cidrBlocks: ['${DOCKER_POD_CIDRS}'] | ||
| serviceDomain: '${DOCKER_SERVICE_DOMAIN}' | ||
| topology: | ||
| classRef: | ||
| name: "quick-start-runtimesdk-generateplan" | ||
| namespace: '${CLUSTER_CLASS_NAMESPACE:-${NAMESPACE}}' | ||
| version: "${KUBERNETES_VERSION}" | ||
| controlPlane: | ||
| deletion: | ||
| nodeDeletionTimeoutSeconds: 30 | ||
| replicas: ${CONTROL_PLANE_MACHINE_COUNT} | ||
| workers: | ||
| machineDeployments: | ||
| - class: "default-worker" | ||
| name: "md-0" | ||
| deletion: | ||
| nodeDeletionTimeoutSeconds: 30 | ||
| nodeVolumeDetachTimeoutSeconds: 300 | ||
| minReadySeconds: 5 | ||
| replicas: ${WORKER_MACHINE_COUNT} | ||
| failureDomain: fd4 | ||
| machinePools: | ||
| - class: "default-worker" | ||
| name: "mp-0" | ||
| deletion: | ||
| nodeDeletionTimeoutSeconds: 30 | ||
| nodeVolumeDetachTimeoutSeconds: 300 | ||
| minReadySeconds: 5 | ||
| replicas: ${WORKER_MACHINE_COUNT} | ||
| failureDomains: | ||
| - fd4 | ||
| variables: | ||
| - name: kubeadmControlPlaneMaxSurge | ||
| value: "1" | ||
| - name: imageRepository | ||
| value: "kindest" |
3 changes: 3 additions & 0 deletions
3
...tructure-docker/main/cluster-template-upgrades-runtimesdk-generateplan/kustomization.yaml
This file contains hidden or 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,3 @@ | ||
| resources: | ||
| - ../bases/crs.yaml | ||
| - cluster-runtimesdk-generateplan.yaml |
147 changes: 147 additions & 0 deletions
147
...e2e/data/infrastructure-docker/main/clusterclass-quick-start-runtimesdk-generateplan.yaml
This file contains hidden or 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,147 @@ | ||
| apiVersion: cluster.x-k8s.io/v1beta2 | ||
| kind: ClusterClass | ||
| metadata: | ||
| name: quick-start-runtimesdk-generateplan | ||
| spec: | ||
| controlPlane: | ||
| templateRef: | ||
| apiVersion: controlplane.cluster.x-k8s.io/v1beta2 | ||
| kind: KubeadmControlPlaneTemplate | ||
| name: quick-start-control-plane | ||
| machineInfrastructure: | ||
| templateRef: | ||
| apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 | ||
| kind: DockerMachineTemplate | ||
| name: quick-start-control-plane | ||
| naming: | ||
| template: "{{ .cluster.name }}-cp-{{ .random }}" | ||
| infrastructure: | ||
| templateRef: | ||
| apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 | ||
| kind: DockerClusterTemplate | ||
| name: quick-start-cluster | ||
| naming: | ||
| template: "{{ .cluster.name }}-infra-{{ .random }}" | ||
| workers: | ||
| machineDeployments: | ||
| - class: default-worker | ||
| naming: | ||
| template: "{{ .cluster.name }}-md-{{ .machineDeployment.topologyName }}-{{ .random }}" | ||
| bootstrap: | ||
| templateRef: | ||
| apiVersion: bootstrap.cluster.x-k8s.io/v1beta2 | ||
| kind: KubeadmConfigTemplate | ||
| name: quick-start-default-worker-bootstraptemplate | ||
| infrastructure: | ||
| templateRef: | ||
| apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 | ||
| kind: DockerMachineTemplate | ||
| name: quick-start-default-worker-machinetemplate | ||
| machinePools: | ||
| - class: default-worker | ||
| naming: | ||
| template: "{{ .cluster.name }}-mp-{{ .machinePool.topologyName }}-{{ .random }}" | ||
| bootstrap: | ||
| templateRef: | ||
| apiVersion: bootstrap.cluster.x-k8s.io/v1beta2 | ||
| kind: KubeadmConfigTemplate | ||
| name: quick-start-default-worker-bootstraptemplate | ||
| infrastructure: | ||
| templateRef: | ||
| apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 | ||
| kind: DockerMachinePoolTemplate | ||
| name: quick-start-default-worker-machinepooltemplate | ||
| patches: | ||
| - name: test-patch | ||
| external: | ||
| generatePatchesExtension: generate-patches.${EXTENSION_CONFIG_NAME:-k8s-upgrade-with-runtimesdk} | ||
| validateTopologyExtension: validate-topology.${EXTENSION_CONFIG_NAME:-k8s-upgrade-with-runtimesdk} | ||
| discoverVariablesExtension: discover-variables.${EXTENSION_CONFIG_NAME:-k8s-upgrade-with-runtimesdk} | ||
| upgrade: | ||
| external: | ||
| generateUpgradePlanExtension: generate-upgrade-plan.${EXTENSION_CONFIG_NAME:-k8s-upgrade-with-runtimesdk} | ||
| --- | ||
| apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 | ||
| kind: DockerClusterTemplate | ||
| metadata: | ||
| name: quick-start-cluster | ||
| spec: | ||
| template: | ||
| spec: | ||
| failureDomains: | ||
| - name: fd1 | ||
| controlPlane: true | ||
| - name: fd2 | ||
| controlPlane: true | ||
| - name: fd3 | ||
| controlPlane: true | ||
| - name: fd4 | ||
| controlPlane: false | ||
| - name: fd5 | ||
| controlPlane: false | ||
| - name: fd6 | ||
| controlPlane: false | ||
| - name: fd7 | ||
| controlPlane: false | ||
| - name: fd8 | ||
| controlPlane: false | ||
| --- | ||
| kind: KubeadmControlPlaneTemplate | ||
| apiVersion: controlplane.cluster.x-k8s.io/v1beta2 | ||
| metadata: | ||
| name: quick-start-control-plane | ||
| spec: | ||
| template: | ||
| spec: | ||
| machineTemplate: | ||
| spec: | ||
| deletion: | ||
| nodeDrainTimeoutSeconds: 1 | ||
| kubeadmConfigSpec: | ||
| clusterConfiguration: | ||
| apiServer: | ||
| # host.docker.internal is required by kubetest when running on MacOS because of the way ports are proxied. | ||
| certSANs: [localhost, 127.0.0.1, 0.0.0.0, host.docker.internal] | ||
| encryptionAlgorithm: "RSA-4096" | ||
| --- | ||
| apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 | ||
| kind: DockerMachineTemplate | ||
| metadata: | ||
| name: quick-start-control-plane | ||
| spec: | ||
| template: | ||
| spec: | ||
| extraMounts: | ||
| - containerPath: "/var/run/docker.sock" | ||
| hostPath: "/var/run/docker.sock" | ||
| preLoadImages: ${DOCKER_PRELOAD_IMAGES:-[]} | ||
| --- | ||
| apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 | ||
| kind: DockerMachineTemplate | ||
| metadata: | ||
| name: quick-start-default-worker-machinetemplate | ||
| spec: | ||
| template: | ||
| spec: | ||
| extraMounts: | ||
| - containerPath: "/var/run/docker.sock" | ||
| hostPath: "/var/run/docker.sock" | ||
| preLoadImages: ${DOCKER_PRELOAD_IMAGES:-[]} | ||
| --- | ||
| apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 | ||
| kind: DockerMachinePoolTemplate | ||
| metadata: | ||
| name: quick-start-default-worker-machinepooltemplate | ||
| spec: | ||
| template: | ||
| spec: | ||
| template: | ||
| extraMounts: | ||
| - containerPath: "/var/run/docker.sock" | ||
| hostPath: "/var/run/docker.sock" | ||
| preLoadImages: ${DOCKER_PRELOAD_IMAGES:-[]} | ||
| --- | ||
| apiVersion: bootstrap.cluster.x-k8s.io/v1beta2 | ||
| kind: KubeadmConfigTemplate | ||
| metadata: | ||
| name: quick-start-default-worker-bootstraptemplate | ||
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.
@sivchari if I got this right, this is the only difference between the test introduced by this PR and the existing runtime SDK test.
If this is correct, considering that this test takes long, I would be ok if we move this change to clusterclass-quick-start-runtimesdk and have only one test (I'm also considering that we have good test coverage for the different ways of computing upgrade plan, and that the runtime extension internally uses the same func we use when only kubernetes versions are set).
wdyt?
@sbueringer opinions?
Uh oh!
There was an error while loading. Please reload this page.
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.
Sounds good. Let's just add this to the clusterclass-quick-start-runtimesdk ClusterClass and revert the rest of the changes on this PR
@sivchari Sorry we didn't think about this when writing up the tasks