Skip to content

Commit

Permalink
Prepare main for development of release v1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Apr 29, 2024
1 parent a77fa39 commit 134eea1
Show file tree
Hide file tree
Showing 23 changed files with 1,493 additions and 961 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ generate-doctoc:
TRACE=$(TRACE) ./hack/generate-doctoc.sh

.PHONY: generate-e2e-templates
generate-e2e-templates: $(KUSTOMIZE) $(addprefix generate-e2e-templates-, v1.8 v1.9 main) ## Generate test templates for all branches
generate-e2e-templates: $(KUSTOMIZE) $(addprefix generate-e2e-templates-, v1.9 v1.10 main) ## Generate test templates for all branches

.PHONY: generate-e2e-templates-main
generate-e2e-templates-main: $(KUSTOMIZE) ## Generate test templates for the main branch
Expand Down Expand Up @@ -386,16 +386,16 @@ generate-e2e-templates-main: $(KUSTOMIZE) ## Generate test templates for the mai
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_SUPERVISOR_TEMPLATE_DIR)/main/conformance" > "$(E2E_SUPERVISOR_TEMPLATE_DIR)/main/cluster-template-conformance-supervisor.yaml"
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_SUPERVISOR_TEMPLATE_DIR)/main/install-on-bootstrap" > "$(E2E_SUPERVISOR_TEMPLATE_DIR)/main/cluster-template-install-on-bootstrap-supervisor.yaml"

.PHONY: generate-e2e-templates-v1.10
generate-e2e-templates-v1.10: $(KUSTOMIZE)
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.10/clusterclass" > "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.10/clusterclass-quick-start.yaml"
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.10/workload" > "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.10/cluster-template-workload.yaml"

.PHONY: generate-e2e-templates-v1.9
generate-e2e-templates-v1.9: $(KUSTOMIZE)
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.9/clusterclass" > "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.9/clusterclass-quick-start.yaml"
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.9/workload" > "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.9/cluster-template-workload.yaml"

.PHONY: generate-e2e-templates-v1.8
generate-e2e-templates-v1.8: $(KUSTOMIZE)
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.8/clusterclass" > "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.8/clusterclass-quick-start.yaml"
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.8/workload" > "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.8/cluster-template-workload.yaml"

.PHONY: generate-test-infra-prowjobs
generate-test-infra-prowjobs: $(PROWJOB_GEN) ## Generates the prowjob configurations in test-infra
@if [ -z "${TEST_INFRA_DIR}" ]; then echo "TEST_INFRA_DIR is not set"; exit 1; fi
Expand Down
3 changes: 3 additions & 0 deletions metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ releaseSeries:
- major: 1
minor: 10
contract: v1beta1
- major: 1
minor: 11
contract: v1beta1
20 changes: 10 additions & 10 deletions test/e2e/clusterctl_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ var (
capvReleaseMarkerPrefix = "go://sigs.k8s.io/cluster-api-provider-vsphere@v%s"
)

var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.9=>current, CAPI 1.6=>1.7) [ClusterClass]", func() {
const specName = "clusterctl-upgrade-1.9-current" // prefix (clusterctl-upgrade) copied from CAPI
var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10=>current, CAPI 1.6=>1.7) [ClusterClass]", func() {
const specName = "clusterctl-upgrade-1.10-current" // prefix (clusterctl-upgrade) copied from CAPI
Setup(specName, func(testSpecificSettingsGetter func() testSettings) {
capi_e2e.ClusterctlUpgradeSpec(ctx, func() capi_e2e.ClusterctlUpgradeSpecInput {
// Get CAPI v1.6 latest stable release
capiVersion16 := "1.6"
capiStableRelease16, err := getStableReleaseOfMinor(ctx, capiReleaseMarkerPrefix, capiVersion16)
Expect(err).ToNot(HaveOccurred(), "Failed to get stable version for minor release : %s", capiVersion16)
// Get CAPV v1.9 latest stable release
capvVersion19 := "1.9"
capvVersion19 := "1.10"
capvStableRelease19, err := getStableReleaseOfMinor(ctx, capvReleaseMarkerPrefix, capvVersion19)
Expect(err).ToNot(HaveOccurred(), "Failed to get stable version for minor release : %s", capvVersion19)
return capi_e2e.ClusterctlUpgradeSpecInput{
Expand All @@ -65,24 +65,24 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.9=
// InitWithKubernetesVersion should be the highest kubernetes version supported by the init Cluster API version.
// This is to guarantee that both, the old and new CAPI version, support the defined version.
// Ensure all Kubernetes versions used here are covered in patch-vsphere-template.yaml
InitWithKubernetesVersion: "v1.29.0",
WorkloadKubernetesVersion: "v1.29.0",
InitWithKubernetesVersion: "v1.30.0",
WorkloadKubernetesVersion: "v1.30.0",
WorkloadFlavor: testSpecificSettingsGetter().FlavorForMode("workload"),
}
})
}, WithIP("WORKLOAD_CONTROL_PLANE_ENDPOINT_IP"))
})

var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.8=>current, CAPI 1.5=>1.7) [ClusterClass]", func() {
const specName = "clusterctl-upgrade-1.8-current" // prefix (clusterctl-upgrade) copied from CAPI
var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.9=>current, CAPI 1.5=>1.7) [ClusterClass]", func() {
const specName = "clusterctl-upgrade-1.9-current" // prefix (clusterctl-upgrade) copied from CAPI
Setup(specName, func(testSpecificSettingsGetter func() testSettings) {
capi_e2e.ClusterctlUpgradeSpec(ctx, func() capi_e2e.ClusterctlUpgradeSpecInput {
// Get CAPI v1.5 latest stable release
capiVersion15 := "1.5"
capiStableRelease15, err := getStableReleaseOfMinor(ctx, capiReleaseMarkerPrefix, capiVersion15)
Expect(err).ToNot(HaveOccurred(), "Failed to get stable version for minor release : %s", capiVersion15)
// Get CAPV v1.8 latest stable release
capvVersion18 := "1.8"
capvVersion18 := "1.9"
capvStableRelease18, err := getStableReleaseOfMinor(ctx, capvReleaseMarkerPrefix, capvVersion18)
Expect(err).ToNot(HaveOccurred(), "Failed to get stable version for minor release : %s", capvVersion18)
return capi_e2e.ClusterctlUpgradeSpecInput{
Expand All @@ -103,8 +103,8 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.8=
// InitWithKubernetesVersion should be the highest kubernetes version supported by the init Cluster API version.
// This is to guarantee that both, the old and new CAPI version, support the defined version.
// Ensure all Kubernetes versions used here are covered in patch-vsphere-template.yaml
InitWithKubernetesVersion: "v1.28.0",
WorkloadKubernetesVersion: "v1.28.0",
InitWithKubernetesVersion: "v1.29.0",
WorkloadKubernetesVersion: "v1.29.0",
WorkloadFlavor: testSpecificSettingsGetter().FlavorForMode("workload"),
}
})
Expand Down
26 changes: 13 additions & 13 deletions test/e2e/config/vsphere.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ providers:
- name: vsphere
type: InfrastructureProvider
versions:
- name: v1.10.99 # next release
- name: v1.11.99 # next release
# Use manifest from source files
value: ../../../../cluster-api-provider-vsphere/config/default
contract: v1beta1
Expand Down Expand Up @@ -180,31 +180,31 @@ providers:
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-supervisor/main/cluster-template-install-on-bootstrap-supervisor.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-supervisor/main/cluster-template-conformance-supervisor.yaml"
- sourcePath: "../data/shared/capv/main/metadata.yaml"
- name: "{go://sigs.k8s.io/cluster-api-provider-vsphere@v1.9}" # supported release in the v1beta1 series
- name: "{go://sigs.k8s.io/cluster-api-provider-vsphere@v1.10}" # supported release in the v1beta1 series
# Use manifest from source files
value: "https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/download/{go://sigs.k8s.io/cluster-api-provider-vsphere@v1.9}/infrastructure-components.yaml"
value: "https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/download/{go://sigs.k8s.io/cluster-api-provider-vsphere@v1.10}/infrastructure-components.yaml"
type: "url"
contract: v1beta1
files:
# Add a cluster template
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-govmomi/v1.9/cluster-template-workload.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-govmomi/v1.9/clusterclass-quick-start.yaml"
- sourcePath: "../data/shared/capv/v1.9/metadata.yaml"
- name: "{go://sigs.k8s.io/cluster-api-provider-vsphere@v1.8}" # supported release in the v1beta1 series
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-govmomi/v1.10/cluster-template-workload.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-govmomi/v1.10/clusterclass-quick-start.yaml"
- sourcePath: "../data/shared/capv/v1.10/metadata.yaml"
- name: "{go://sigs.k8s.io/cluster-api-provider-vsphere@v1.9}" # supported release in the v1beta1 series
# Use manifest from source files
value: "https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/download/{go://sigs.k8s.io/cluster-api-provider-vsphere@v1.8}/infrastructure-components.yaml"
value: "https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/download/{go://sigs.k8s.io/cluster-api-provider-vsphere@v1.9}/infrastructure-components.yaml"
type: "url"
contract: v1beta1
files:
# Add a cluster template
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-govmomi/v1.8/cluster-template-workload.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-govmomi/v1.8/clusterclass-quick-start.yaml"
- sourcePath: "../data/shared/capv/v1.8/metadata.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-govmomi/v1.9/cluster-template-workload.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-govmomi/v1.9/clusterclass-quick-start.yaml"
- sourcePath: "../data/shared/capv/v1.9/metadata.yaml"

- name: vcsim
type: RuntimeExtensionProvider # vcsim isn't a provider, but we fake it is so it can be handled by the clusterctl machinery.
versions:
- name: v1.10.99
- name: v1.11.99
# Use manifest from source files
value: ../../../../cluster-api-provider-vsphere/test/infrastructure/vcsim/config/default
contract: v1beta1
Expand All @@ -229,7 +229,7 @@ providers:
- name: net-operator
type: RuntimeExtensionProvider # net-operator isn't a provider, but we fake it is so it can be handled by the clusterctl machinery.
versions:
- name: v1.10.99
- name: v1.11.99
# Use manifest from source files
value: ../../../../cluster-api-provider-vsphere/test/infrastructure/net-operator/config/default
contract: v1beta1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ spec:
- op: add
path: /spec/template/spec/kubeadmConfigSpec/files
value: []
- op: add
path: /spec/template/spec/kubeadmConfigSpec/postKubeadmCommands
value: []
selector:
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlaneTemplate
Expand All @@ -46,14 +49,17 @@ spec:
- op: add
path: /spec/template/spec/files
value: []
- op: add
path: /spec/template/spec/postKubeadmCommands
value: []
selector:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
matchResources:
machineDeploymentClass:
names:
- ${CLUSTER_CLASS_NAME}-worker
name: createFilesArray
name: createEmptyArrays
- definitions:
- jsonPatches:
- op: add
Expand Down Expand Up @@ -94,7 +100,7 @@ spec:
valueFrom:
template: |
host: '{{ .controlPlaneIpAddr }}'
port: 6443
port: {{ .controlPlanePort }}
- op: add
path: /spec/template/spec/identityRef
valueFrom:
Expand All @@ -121,49 +127,121 @@ spec:
path: /spec/template/spec/kubeadmConfigSpec/files/-
valueFrom:
template: |-
owner: root:root
path: "/etc/kubernetes/manifests/kube-vip.yaml"
owner: "root:root"
path: "/etc/kubernetes/manifests/kube-vip.yaml"
content: {{ printf "%q" (regexReplaceAll "(name: address\n +value:).*" .kubeVipPodManifest (printf "$1 %s" .controlPlaneIpAddr)) }}
permissions: "0644"
- op: add
path: /spec/template/spec/kubeadmConfigSpec/files/-
valueFrom:
template: |
content: 127.0.0.1 localhost kubernetes
owner: root:root
path: /etc/kube-vip.hosts
permissions: "0644"
- op: add
path: /spec/template/spec/kubeadmConfigSpec/files/-
valueFrom:
template: |
content: |
#!/bin/bash
# Copyright 2020 The Kubernetes Authors.
#
# 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.
set -e
# Configure the workaround required for kubeadm init with kube-vip:
# xref: https://github.com/kube-vip/kube-vip/issues/684
# Nothing to do for kubernetes < v1.29
KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)"
if [[ "$KUBEADM_MINOR" -lt "29" ]]; then
exit 0
fi
IS_KUBEADM_INIT="false"
# cloud-init kubeadm init
if [[ -f /run/kubeadm/kubeadm.yaml ]]; then
IS_KUBEADM_INIT="true"
fi
# ignition kubeadm init
if [[ -f /etc/kubeadm.sh ]] && grep -q -e "kubeadm init" /etc/kubeadm.sh; then
IS_KUBEADM_INIT="true"
fi
if [[ "$IS_KUBEADM_INIT" == "true" ]]; then
sed -i 's#path: /etc/kubernetes/admin.conf#path: /etc/kubernetes/super-admin.conf#' \
/etc/kubernetes/manifests/kube-vip.yaml
fi
owner: root:root
path: /etc/pre-kubeadm-commands/50-kube-vip-prepare.sh
permissions: "0700"
selector:
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlaneTemplate
matchResources:
controlPlane: true
name: kubeVipPodManifest
variables:
- name: sshKey
- metadata: {}
name: sshKey
required: false
schema:
openAPIV3Schema:
description: Public key to SSH onto the cluster nodes.
type: string
- name: infraServer
- metadata: {}
name: controlPlaneIpAddr
required: true
schema:
openAPIV3Schema:
properties:
thumbprint:
type: string
url:
type: string
type: object
- name: controlPlaneIpAddr
description: Floating VIP for the control plane.
type: string
- metadata: {}
name: controlPlanePort
required: true
schema:
openAPIV3Schema:
description: Floating VIP for the control plane.
type: string
- name: credsSecretName
description: Port for the control plane endpoint.
type: integer
- metadata: {}
name: kubeVipPodManifest
required: true
schema:
openAPIV3Schema:
description: Secret containing the credentials for the infra cluster.
description: kube-vip manifest for the control plane.
type: string
- name: kubeVipPodManifest
- metadata: {}
name: infraServer
required: true
schema:
openAPIV3Schema:
description: kube-vip manifest for the control plane.
properties:
thumbprint:
type: string
url:
type: string
type: object
- metadata: {}
name: credsSecretName
required: true
schema:
openAPIV3Schema:
description: Secret containing the credentials for the infra cluster.
type: string
workers:
machineDeployments:
Expand Down Expand Up @@ -203,7 +281,7 @@ spec:
networkName: '${VSPHERE_NETWORK}'
numCPUs: 2
os: Linux
powerOffMode: hard
powerOffMode: trySoft
resourcePool: '${VSPHERE_RESOURCE_POOL}'
server: '${VSPHERE_SERVER}'
storagePolicyName: '${VSPHERE_STORAGE_POLICY}'
Expand All @@ -230,7 +308,7 @@ spec:
networkName: '${VSPHERE_NETWORK}'
numCPUs: 2
os: Linux
powerOffMode: hard
powerOffMode: trySoft
resourcePool: '${VSPHERE_RESOURCE_POOL}'
server: '${VSPHERE_SERVER}'
storagePolicyName: '${VSPHERE_STORAGE_POLICY}'
Expand Down Expand Up @@ -271,6 +349,9 @@ spec:
>/etc/hosts
- echo "127.0.0.1 {{ ds.meta_data.hostname }} {{ local_hostname }} localhost
localhost.localdomain localhost4 localhost4.localdomain4" >>/etc/hosts
- mkdir -p /etc/pre-kubeadm-commands
- for script in $(find /etc/pre-kubeadm-commands/ -name '*.sh' -type f | sort);
do echo "Running script $script"; "$script"; done
users:
- name: capv
sshAuthorizedKeys:
Expand All @@ -297,3 +378,6 @@ spec:
>/etc/hosts
- echo "127.0.0.1 {{ ds.meta_data.hostname }} {{ local_hostname }} localhost
localhost.localdomain localhost4 localhost4.localdomain4" >>/etc/hosts
- mkdir -p /etc/pre-kubeadm-commands
- for script in $(find /etc/pre-kubeadm-commands/ -name '*.sh' -type f | sort);
do echo "Running script $script"; "$script"; done
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ patches:
- target:
kind: ClusterClass
path: ./patch-prekubeadmscript.yaml
- target:
kind: ClusterClass
path: ./patch-namingstrategy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- op: add
path: /spec/controlPlane/namingStrategy
value:
template: '{{ .cluster.name }}-cp-{{ .random }}'
- op: add
path: /spec/workers/machineDeployments/0/namingStrategy
value:
template: '{{ .cluster.name }}-md-{{ .machineDeployment.topologyName }}-{{ .random }}'
Loading

0 comments on commit 134eea1

Please sign in to comment.