Skip to content

Commit bf62a91

Browse files
author
Orkhan Mahmudzada
committed
- Fixed CCM authentication by updating cloud-config secret in test/e2e/data/ccm/cloud-controller-manager.yaml to use cloud.conf with [Global] and [LoadBalancer] sections, addressing "expected section header" error.
- Modified test/e2e/suites/hcp/hcp_helpers.go to align with HCP test setup. - Updated Makefile to support HCP test execution. - Ensured control plane provider is named "kubeadm" to avoid "invalid config: control-plane-provider should be named kubeadm" error for Kamaji (v0.15.3).
1 parent cc4847f commit bf62a91

File tree

5 files changed

+287
-13
lines changed

5 files changed

+287
-13
lines changed

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ TEST_E2E_DIR := test/e2e
4343
# Files
4444
E2E_DATA_DIR ?= $(REPO_ROOT)/test/e2e/data
4545
E2E_CONF_PATH ?= $(E2E_DATA_DIR)/e2e_conf.yaml
46+
E2E_CONF_PATH_HCP ?= $(E2E_DATA_DIR)/e2e_conf_hcp.yaml
4647
KUBETEST_CONF_PATH ?= $(abspath $(E2E_DATA_DIR)/kubetest/conformance.yaml)
4748
KUBETEST_FAST_CONF_PATH ?= $(abspath $(E2E_DATA_DIR)/kubetest/conformance-fast.yaml)
4849
GO_INSTALL := ./scripts/go_install.sh
@@ -208,7 +209,7 @@ test-e2e: $(GINKGO) e2e-prerequisites ## Run e2e tests
208209
time $(GINKGO) -fail-fast -trace -timeout=3h -show-node-events -v -tags=e2e -nodes=$(E2E_GINKGO_PARALLEL) \
209210
--output-dir="$(ARTIFACTS)" --junit-report="junit.e2e_suite.1.xml" \
210211
-focus="$(E2E_GINKGO_FOCUS)" $(_SKIP_ARGS) $(E2E_GINKGO_ARGS) ./test/e2e/suites/e2e/... -- \
211-
-config-path="$(E2E_CONF_PATH)" -artifacts-folder="$(ARTIFACTS)" \
212+
-config-path="$(E2E_CONF_PATH_HCP)" -artifacts-folder="$(ARTIFACTS)" \
212213
-data-folder="$(E2E_DATA_DIR)" $(E2E_ARGS)
213214

214215
# Pre-compile tests
@@ -218,7 +219,7 @@ build-e2e-tests: $(GINKGO)
218219
$(GINKGO) build -tags=e2e ./test/e2e/suites/e2e/...
219220

220221
.PHONY: e2e-image
221-
e2e-image: CONTROLLER_IMG_TAG = "gcr.io/k8s-staging-capi-openstack/capi-openstack-controller:e2e"
222+
e2e-image: CONTROLLER_IMG_TAG = "ghcr.io/orkhanorganization/k8s-staging-capi-openstack/capi-openstack-controller:e2e"
222223
e2e-image: docker-build
223224

224225
# Pull all the images references in test/e2e/data/e2e_conf.yaml
@@ -246,7 +247,7 @@ test-hcp: $(GINKGO) e2e-prerequisites ## Run HCP (Hosted Control Plane) e2e test
246247
time $(GINKGO) -fail-fast -trace -timeout=3h -show-node-events -v -tags=e2e -nodes=$(E2E_GINKGO_PARALLEL) \
247248
--output-dir="$(ARTIFACTS)" --junit-report="junit.hcp_suite.1.xml" \
248249
-focus="$(E2E_GINKGO_FOCUS)" $(_SKIP_ARGS) $(E2E_GINKGO_ARGS) ./test/e2e/suites/hcp/... -- \
249-
-config-path="$(E2E_CONF_PATH)" -artifacts-folder="$(ARTIFACTS)" \
250+
-config-path="$(E2E_CONF_PATH_HCP)" -artifacts-folder="$(ARTIFACTS)" \
250251
-data-folder="$(E2E_DATA_DIR)" $(HCP_E2E_ARGS)
251252

252253

test/e2e/data/ccm/cloud-controller-manager.yaml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
# From: https://raw.githubusercontent.com/kubernetes/cloud-provider-openstack/master/manifests/controller-manager/openstack-cloud-controller-manager-ds.yaml
22
---
33
apiVersion: v1
4+
kind: Secret
5+
metadata:
6+
name: cloud-config
7+
namespace: kube-system
8+
stringData:
9+
clouds.conf: |
10+
[Global]
11+
auth-url=
12+
application-credential-id=
13+
application-credential-secret=
14+
region=
15+
[LoadBalancer]
16+
use-octavia=true
17+
floating-network-id=<your-floating-network-id>
18+
subnet-id=<your-subnet-id>
19+
---
20+
apiVersion: v1
421
kind: ServiceAccount
522
metadata:
623
name: cloud-controller-manager
@@ -26,7 +43,6 @@ spec:
2643
spec:
2744
nodeSelector:
2845
node-role.kubernetes.io/control-plane: ""
29-
# we need user root to read the cloud.conf from the host
3046
securityContext:
3147
runAsUser: 0
3248
tolerations:
@@ -40,17 +56,19 @@ spec:
4056
serviceAccountName: cloud-controller-manager
4157
containers:
4258
- name: openstack-cloud-controller-manager
43-
image: >-
44-
registry.k8s.io/provider-os/openstack-cloud-controller-manager:v1.32.0
59+
image: registry.k8s.io/provider-os/openstack-cloud-controller-manager:v1.32.0
4560
args:
4661
- /bin/openstack-cloud-controller-manager
4762
- --v=1
4863
- --cluster-name=$(CLUSTER_NAME)
49-
- --cloud-config=$(CLOUD_CONFIG)
64+
- --cloud-config=/etc/cloud/clouds.conf
5065
- --cloud-provider=openstack
5166
- --use-service-account-credentials=false
5267
- --bind-address=127.0.0.1
5368
volumeMounts:
69+
- mountPath: /etc/cloud
70+
name: cloud-config
71+
readOnly: true
5472
- mountPath: /etc/kubernetes
5573
name: k8s
5674
readOnly: true
@@ -65,11 +83,14 @@ spec:
6583
cpu: 200m
6684
env:
6785
- name: CLOUD_CONFIG
68-
value: /etc/kubernetes/cloud.conf
86+
value: /etc/cloud/clouds.conf
6987
- name: CLUSTER_NAME
7088
value: kubernetes
7189
hostNetwork: true
7290
volumes:
91+
- name: cloud-config
92+
secret:
93+
secretName: cloud-config
7394
- hostPath:
7495
path: /etc/kubernetes
7596
type: DirectoryOrCreate

test/e2e/data/e2e_conf.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,22 @@ providers:
9494
new: "--leader-elect=false\n - --sync-period=1m"
9595

9696

97+
98+
- name: kamaji
99+
type: ControlPlaneProvider
100+
versions:
101+
- name: v0.15.3
102+
value: "https://github.com/clastix/kamaji/releases/download/v0.15.3/kamaji-cluster-api-control-plane-components.yaml"
103+
type: url
104+
contract: v1beta1
105+
files:
106+
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
107+
replacements:
108+
- old: "imagePullPolicy: Always"
109+
new: "imagePullPolicy: IfNotPresent"
110+
111+
112+
97113
- name: openstack
98114
type: InfrastructureProvider
99115
versions:
@@ -203,7 +219,7 @@ variables:
203219
OPENSTACK_CLOUD_CACERT_B64: "Cg=="
204220
OPENSTACK_CLOUD_YAML_FILE: '../../../../clouds.yaml'
205221
OPENSTACK_CONTROL_PLANE_MACHINE_FLAVOR: "m1.medium"
206-
OPENSTACK_DNS_NAMESERVERS: "8.8.8.8"
222+
207223
OPENSTACK_FAILURE_DOMAIN: "testaz1"
208224
OPENSTACK_FAILURE_DOMAIN_ALT: "testaz2"
209225
OPENSTACK_IMAGE_NAME: "ubuntu-2404-kube-v1.33.1"
@@ -233,7 +249,7 @@ intervals:
233249
conformance/wait-worker-nodes: ["30m", "10s"]
234250
default/wait-controllers: ["3m", "10s"]
235251
default/wait-bastion: ["5m", "10s"]
236-
default/wait-cluster: ["20m", "10s"]
252+
default/wait-cluster: ["60m", "10s"]
237253
default/wait-control-plane: ["30m", "10s"]
238254
default/wait-worker-nodes: ["30m", "10s"]
239255
default/wait-delete-cluster: ["5m", "10s"]

test/e2e/data/e2e_conf_hcp.yaml

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
# E2E test scenario using local dev images and manifests built from the source tree for following providers:
2+
# - openstack
3+
4+
# To run tests, run the following from the root of this repository.
5+
# `OPENSTACK_CLOUD=capo-e2e OPENSTACK_CLOUD_YAML_FILE=/tmp/clouds.yaml make test-conformance`
6+
7+
managementClusterName: capo-e2e
8+
9+
images:
10+
# Use local dev images built source tree;
11+
- name: ghcr.io/orkhanorganization/k8s-staging-capi-openstack/capi-openstack-controller:e2e
12+
loadBehavior: mustLoad
13+
- name: quay.io/orc/openstack-resource-controller:v2.2.0
14+
loadBehavior: tryLoad
15+
16+
providers:
17+
- name: cluster-api
18+
type: CoreProvider
19+
versions:
20+
- name: "{go://sigs.k8s.io/[email protected]}"
21+
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/{go://sigs.k8s.io/[email protected]}/core-components.yaml"
22+
type: url
23+
contract: v1beta1
24+
files:
25+
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
26+
replacements:
27+
- old: "imagePullPolicy: Always"
28+
new: "imagePullPolicy: IfNotPresent"
29+
- old: "--leader-elect"
30+
new: "--leader-elect=false\n - --sync-period=1m"
31+
# For clusterctl upgrade test
32+
- name: "{go://sigs.k8s.io/[email protected]}"
33+
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/{go://sigs.k8s.io/[email protected]}/core-components.yaml"
34+
type: url
35+
contract: v1beta1
36+
files:
37+
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
38+
replacements:
39+
- old: "imagePullPolicy: Always"
40+
new: "imagePullPolicy: IfNotPresent"
41+
- old: "--leader-elect"
42+
new: "--leader-elect=false\n - --sync-period=1m"
43+
- name: kubeadm
44+
type: BootstrapProvider
45+
versions:
46+
- name: "{go://sigs.k8s.io/[email protected]}"
47+
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/{go://sigs.k8s.io/[email protected]}/bootstrap-components.yaml"
48+
type: url
49+
contract: v1beta1
50+
files:
51+
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
52+
replacements:
53+
- old: "imagePullPolicy: Always"
54+
new: "imagePullPolicy: IfNotPresent"
55+
- old: "--leader-elect"
56+
new: "--leader-elect=false\n - --sync-period=1m"
57+
# For clusterctl upgrade test
58+
- name: "{go://sigs.k8s.io/[email protected]}"
59+
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/{go://sigs.k8s.io/[email protected]}/bootstrap-components.yaml"
60+
type: url
61+
contract: v1beta1
62+
files:
63+
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
64+
replacements:
65+
- old: "imagePullPolicy: Always"
66+
new: "imagePullPolicy: IfNotPresent"
67+
- old: "--leader-elect"
68+
new: "--leader-elect=false\n - --sync-period=1m"
69+
70+
71+
72+
- name: kubeadm
73+
type: ControlPlaneProvider
74+
versions:
75+
- name: v0.15.3
76+
value: "https://raw.githubusercontent.com/clastix/cluster-api-control-plane-provider-kamaji/v0.15.3/config/control-plane-components.yaml"
77+
type: url
78+
contract: v1beta1
79+
files:
80+
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
81+
replacements:
82+
- old: "imagePullPolicy: Always"
83+
new: "imagePullPolicy: IfNotPresent"
84+
85+
86+
87+
- name: openstack
88+
type: InfrastructureProvider
89+
versions:
90+
# This is only for clusterctl upgrade tests
91+
- name: "{go://github.com/kubernetes-sigs/[email protected]}"
92+
value: "https://github.com/kubernetes-sigs/cluster-api-provider-openstack/releases/download/{go://github.com/kubernetes-sigs/[email protected]}/infrastructure-components.yaml"
93+
type: url
94+
contract: v1beta1
95+
files:
96+
- sourcePath: "../data/shared/v1beta1_provider/metadata.yaml"
97+
- sourcePath: "./infrastructure-openstack-no-artifact/cluster-template.yaml"
98+
replacements:
99+
- old: "imagePullPolicy: Always"
100+
new: "imagePullPolicy: IfNotPresent"
101+
- old: "--v=2"
102+
new: "--v=4"
103+
- old: "--leader-elect"
104+
new: "--leader-elect=false\n - --sync-period=1m"
105+
# This is only for clusterctl upgrade tests
106+
- name: "{go://github.com/kubernetes-sigs/[email protected]}"
107+
value: "https://github.com/kubernetes-sigs/cluster-api-provider-openstack/releases/download/{go://github.com/kubernetes-sigs/[email protected]}/infrastructure-components.yaml"
108+
type: url
109+
contract: v1beta1
110+
files:
111+
- sourcePath: "../data/shared/v1beta1_provider/metadata.yaml"
112+
- sourcePath: "./infrastructure-openstack-no-artifact/cluster-template.yaml"
113+
replacements:
114+
- old: "imagePullPolicy: Always"
115+
new: "imagePullPolicy: IfNotPresent"
116+
- old: "--v=2"
117+
new: "--v=4"
118+
- old: "--leader-elect"
119+
new: "--leader-elect=false\n - --sync-period=1m"
120+
- name: v0.12.99
121+
value: ../../../config/default
122+
# This is the upcoming version.
123+
# Specify no contract so that upgrade tests that start from a specific contract won't pick it up.
124+
# contract: v1beta1
125+
files:
126+
- sourcePath: "../data/shared/v1beta1_provider/metadata.yaml"
127+
- sourcePath: "./infrastructure-openstack-no-artifact/cluster-template.yaml"
128+
- sourcePath: "./infrastructure-openstack-no-artifact/cluster-template-without-lb.yaml"
129+
replacements:
130+
- old: gcr.io/k8s-staging-capi-openstack/capi-openstack-controller:dev
131+
new: ghcr.io/orkhanorganization/k8s-staging-capi-openstack/capi-openstack-controller:e2e
132+
- old: "imagePullPolicy: Always"
133+
new: "imagePullPolicy: IfNotPresent"
134+
- old: "--v=2"
135+
new: "--v=4"
136+
- old: "--leader-elect"
137+
new: "--leader-elect=false\n - --sync-period=1m"
138+
- name: openstack-resource-controller
139+
type: RuntimeExtensionProvider # ORC isn't a provider but we fake it so it can be handled by the clusterctl machinery.
140+
versions:
141+
- name: v2.2.0
142+
value: ../../../../cluster-api-provider-openstack/test/infrastructure/openstack-resource-controller/config/default
143+
contract: v1beta1
144+
files:
145+
- sourcePath: "../data/shared/openstack-resource-controller/metadata.yaml"
146+
replacements:
147+
- old: "imagePullPolicy: Always"
148+
new: "imagePullPolicy: IfNotPresent"
149+
# This is only for clusterctl upgrade tests, latest stable release of major version v1.0
150+
- name: v1.0.2
151+
value: ../../../../cluster-api-provider-openstack/test/infrastructure/openstack-resource-controller/config/upgrade-from
152+
contract: v1beta1
153+
files:
154+
- sourcePath: "../data/shared/openstack-resource-controller/metadata.yaml"
155+
replacements:
156+
- old: "imagePullPolicy: Always"
157+
new: "imagePullPolicy: IfNotPresent"
158+
159+
160+
# default variables for the e2e test; those values could be overridden via env variables, thus
161+
# allowing the same e2e config file to be re-used in different prow jobs e.g. each one with a K8s version permutation
162+
variables:
163+
# used to ensure we deploy to the correct management cluster
164+
KUBE_CONTEXT: "kind-capo-e2e"
165+
KUBERNETES_VERSION: "v1.33.1"
166+
KUBERNETES_VERSION_UPGRADE_FROM: "v1.32.5"
167+
KUBERNETES_VERSION_UPGRADE_TO: "v1.33.1"
168+
# NOTE: To see default images run kubeadm config images list (optionally with --kubernetes-version=vX.Y.Z)
169+
ETCD_VERSION_UPGRADE_TO: "3.5.21-0"
170+
COREDNS_VERSION_UPGRADE_TO: "v1.12.0"
171+
CONTROL_PLANE_MACHINE_TEMPLATE_UPGRADE_TO: "upgrade-to-control-plane"
172+
WORKERS_MACHINE_TEMPLATE_UPGRADE_TO: "upgrade-to-md-0"
173+
CNI: "../../data/cni/calico.yaml"
174+
CCM: "../../data/ccm/cloud-controller-manager.yaml"
175+
EXP_CLUSTER_RESOURCE_SET: "true"
176+
# HCP/Kamaji configuration
177+
KAMAJI_VERSION: "edge-25.7.1"
178+
KAMAJI_NAMESPACE: "kamaji-system"
179+
CLUSTER_DATASTORE: "default"
180+
HCP_SERVICE_TYPE: "LoadBalancer"
181+
HCP_CPU_LIMIT: "1000m"
182+
HCP_MEMORY_LIMIT: "1Gi"
183+
HCP_CPU_REQUEST: "100m"
184+
HCP_MEMORY_REQUEST: "300Mi"
185+
OPENSTACK_BASTION_IMAGE_NAME: "cirros-0.6.1-x86_64-disk"
186+
OPENSTACK_BASTION_IMAGE_URL: https://storage.googleapis.com/artifacts.k8s-staging-capi-openstack.appspot.com/test/cirros/2022-12-05/cirros-0.6.1-x86_64-disk.img
187+
OPENSTACK_BASTION_IMAGE_HASH: 0c839612eb3f2469420f2ccae990827f
188+
OPENSTACK_BASTION_IMAGE_HASH_ALGORITHM: "md5"
189+
OPENSTACK_BASTION_MACHINE_FLAVOR: "m1.tiny"
190+
OPENSTACK_BASTION_MACHINE_FLAVOR_ALT: "m1.tiny.alt"
191+
OPENSTACK_CLOUD: "capo-e2e"
192+
OPENSTACK_CLOUD_ADMIN: "capo-e2e-admin"
193+
OPENSTACK_CLOUD_CACERT_B64: "Cg=="
194+
OPENSTACK_CLOUD_YAML_FILE: '../../../../clouds.yaml'
195+
OPENSTACK_CONTROL_PLANE_MACHINE_FLAVOR: "m1.medium"
196+
OPENSTACK_FAILURE_DOMAIN: "testaz1"
197+
OPENSTACK_FAILURE_DOMAIN_ALT: "testaz2"
198+
OPENSTACK_IMAGE_NAME: "ubuntu-2404-kube-v1.33.1"
199+
OPENSTACK_IMAGE_URL: https://storage.googleapis.com/artifacts.k8s-staging-capi-openstack.appspot.com/test/ubuntu/ubuntu-2404-kube-v1.33.1
200+
OPENSTACK_IMAGE_NAME_UPGRADE_FROM: "ubuntu-2404-kube-v1.32.5"
201+
OPENSTACK_IMAGE_URL_UPGRADE_FROM: https://storage.googleapis.com/artifacts.k8s-staging-capi-openstack.appspot.com/test/ubuntu/ubuntu-2404-kube-v1.32.5
202+
OPENSTACK_NODE_MACHINE_FLAVOR: "m1.small"
203+
OPENSTACK_SSH_KEY_NAME: "cluster-api-provider-openstack-sigs-k8s-io"
204+
# The default external network created by devstack
205+
OPENSTACK_EXTERNAL_NETWORK_NAME: "public"
206+
OPENSTACK_VOLUME_TYPE_ALT: "test-volume-type"
207+
CONFORMANCE_WORKER_MACHINE_COUNT: "5"
208+
CONFORMANCE_CONTROL_PLANE_MACHINE_COUNT: "1"
209+
E2E_IMAGE_URL: "http://10.0.3.15/capo-e2e-image.tar"
210+
# The default user for SSH connections from bastion to machines
211+
SSH_USER_MACHINE: "ubuntu"
212+
EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION: "true"
213+
# The Flatcar image produced by the image-builder
214+
OPENSTACK_FLATCAR_IMAGE_NAME: "flatcar-stable-4152.2.3-kube-v1.33.1"
215+
OPENSTACK_FLATCAR_IMAGE_URL: "https://storage.googleapis.com/artifacts.k8s-staging-capi-openstack.appspot.com/test/flatcar/flatcar-stable-4152.2.3-kube-v1.33.1"
216+
# A plain Flatcar from the Flatcar releases server
217+
FLATCAR_IMAGE_NAME: "flatcar_production_openstack_image"
218+
FLATCAR_IMAGE_URL: https://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_openstack_image.img
219+
220+
intervals:
221+
conformance/wait-control-plane: ["30m", "10s"]
222+
conformance/wait-worker-nodes: ["30m", "10s"]
223+
default/wait-controllers: ["3m", "10s"]
224+
default/wait-bastion: ["5m", "10s"]
225+
default/wait-cluster: ["60m", "10s"]
226+
default/wait-control-plane: ["30m", "10s"]
227+
default/wait-worker-nodes: ["30m", "10s"]
228+
default/wait-delete-cluster: ["5m", "10s"]
229+
default/wait-delete-machine: ["30m", "10s"]
230+
default/wait-alt-az: ["20m", "30s"]
231+
default/wait-machine-upgrade: ["30m", "10s"]
232+
default/wait-nodes-ready: ["15m", "10s"]
233+
default/wait-machine-remediation: ["10m", "10s"]
234+
default/wait-image-create: ["15m", "10s"]
235+
default/wait-image-delete: ["2m", "10s"]
236+
default/wait-daemonset: ["10m", "30s"]

test/e2e/suites/hcp/hcp_helpers.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ func installKamajiUsingClusterctl(ctx context.Context, hcpCtx *HCPTestContext, e
106106
clusterctl.InitManagementClusterAndWatchControllerLogs(ctx, clusterctl.InitManagementClusterAndWatchControllerLogsInput{
107107
ClusterProxy: hcpCtx.ManagementCluster,
108108
ClusterctlConfigPath: e2eCtx.Environment.ClusterctlConfigPath,
109-
InfrastructureProviders: []string{},
110-
BootstrapProviders: []string{},
111-
ControlPlaneProviders: []string{"kamaji:v0.15.3"},
109+
InfrastructureProviders: []string{"openstack"},
110+
BootstrapProviders: []string{"kubeadm"},
111+
ControlPlaneProviders: []string{"kubeadm"},
112112
CoreProvider: "",
113113
LogFolder: filepath.Join(e2eCtx.Settings.ArtifactFolder, "clusters", hcpCtx.ManagementCluster.GetName()),
114114
}, e2eCtx.E2EConfig.GetIntervals("hcp", "wait-controllers")...)

0 commit comments

Comments
 (0)