Skip to content

Commit

Permalink
Use namespace variable in e2e templates
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandr Demicev <alexandr.demicev@suse.com>
  • Loading branch information
alexander-demicev committed Feb 26, 2025
1 parent 5526153 commit c786c12
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 3 deletions.
1 change: 1 addition & 0 deletions test/e2e/config/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ intervals:
default/wait-turtles-uninstall: ["10m", "30s"]

variables:
NAMESPACE: "default"
MANAGEMENT_CLUSTER_ENVIRONMENT: "isolated-kind" # supported options are eks, isolated-kind, kind
RANCHER_ALPHA_VERSION: "v2.10.0-alpha1"
CLUSTERCTL_BINARY_PATH: ""
Expand Down
5 changes: 5 additions & 0 deletions test/e2e/data/cluster-templates/aws-eks-mmp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: "${CLUSTER_NAME}"
namespace: "${NAMESPACE}"
spec:
clusterNetwork:
pods:
Expand All @@ -20,6 +21,7 @@ kind: AWSManagedCluster
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
metadata:
name: "${CLUSTER_NAME}"
namespace: "${NAMESPACE}"
annotations:
"helm.sh/resource-policy": keep
spec: {}
Expand All @@ -28,6 +30,7 @@ kind: AWSManagedControlPlane
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
metadata:
name: "${CLUSTER_NAME}-control-plane"
namespace: "${NAMESPACE}"
annotations:
"helm.sh/resource-policy": keep
spec:
Expand All @@ -38,6 +41,7 @@ apiVersion: cluster.x-k8s.io/v1beta1
kind: MachinePool
metadata:
name: "${CLUSTER_NAME}-pool-0"
namespace: "${NAMESPACE}"
annotations:
"helm.sh/resource-policy": keep
spec:
Expand All @@ -57,6 +61,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: AWSManagedMachinePool
metadata:
name: "${CLUSTER_NAME}-pool-0"
namespace: "${NAMESPACE}"
annotations:
"helm.sh/resource-policy": keep
spec: {}
6 changes: 3 additions & 3 deletions test/e2e/data/cluster-templates/azure-aks-topology.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: RKE2ConfigTemplate
metadata:
name: ${CLUSTER_NAME}-pool1
namespace: default
namespace: "${NAMESPACE}"
spec:
template:
spec: {}
Expand All @@ -117,7 +117,7 @@ metadata:
labels:
clusterctl.cluster.x-k8s.io/move-hierarchy: "true"
name: cluster-identity
namespace: default
namespace: "${NAMESPACE}"
spec:
allowedNamespaces: {}
clientID: ${AZURE_CLIENT_ID}
Expand All @@ -131,7 +131,7 @@ apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: ${CLUSTER_NAME}
namespace: default
namespace: "${NAMESPACE}"
spec:
clusterNetwork:
pods:
Expand Down
7 changes: 7 additions & 0 deletions test/e2e/data/cluster-templates/docker-kubeadm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: DockerCluster
metadata:
name: ${CLUSTER_NAME}
namespace: "${NAMESPACE}"
annotations:
"helm.sh/resource-policy": keep
spec:
Expand Down Expand Up @@ -29,6 +30,7 @@ metadata:
labels:
cni: ${CLUSTER_NAME}-crs-0
name: ${CLUSTER_NAME}
namespace: "${NAMESPACE}"
spec:
clusterNetwork:
pods:
Expand All @@ -51,6 +53,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: DockerMachineTemplate
metadata:
name: ${CLUSTER_NAME}-control-plane
namespace: "${NAMESPACE}"
spec:
template:
spec:
Expand All @@ -62,6 +65,7 @@ apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
metadata:
name: ${CLUSTER_NAME}-control-plane
namespace: "${NAMESPACE}"
annotations:
"helm.sh/resource-policy": keep
spec:
Expand Down Expand Up @@ -98,6 +102,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: DockerMachineTemplate
metadata:
name: ${CLUSTER_NAME}-md-0
namespace: "${NAMESPACE}"
spec:
template:
spec:
Expand All @@ -109,6 +114,7 @@ apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
metadata:
name: ${CLUSTER_NAME}-md-0
namespace: "${NAMESPACE}"
annotations:
"helm.sh/resource-policy": keep
spec:
Expand All @@ -124,6 +130,7 @@ apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineDeployment
metadata:
name: ${CLUSTER_NAME}-md-0
namespace: "${NAMESPACE}"
annotations:
"helm.sh/resource-policy": keep
spec:
Expand Down
8 changes: 8 additions & 0 deletions test/e2e/data/cluster-templates/docker-rke2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: DockerCluster
metadata:
name: ${CLUSTER_NAME}
namespace: ${NAMESPACE}
annotations:
"helm.sh/resource-policy": keep
spec:
Expand All @@ -13,6 +14,7 @@ apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: ${CLUSTER_NAME}
namespace: ${NAMESPACE}
annotations:
cluster-api.cattle.io/upstream-system-agent: "true"
labels:
Expand All @@ -39,6 +41,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: DockerMachineTemplate
metadata:
name: ${CLUSTER_NAME}-control-plane
namespace: ${NAMESPACE}
spec:
template:
spec:
Expand All @@ -49,6 +52,7 @@ apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: RKE2ControlPlane
metadata:
name: ${CLUSTER_NAME}-control-plane
namespace: ${NAMESPACE}
spec:
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
version: ${RKE2_VERSION}
Expand Down Expand Up @@ -89,6 +93,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: DockerMachineTemplate
metadata:
name: ${CLUSTER_NAME}-md-0
namespace: ${NAMESPACE}
spec:
template:
spec:
Expand All @@ -99,12 +104,14 @@ apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: RKE2ConfigTemplate
metadata:
name: ${CLUSTER_NAME}-md-0
namespace: ${NAMESPACE}
spec: {}
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineDeployment
metadata:
name: ${CLUSTER_NAME}-md-0
namespace: ${NAMESPACE}
spec:
clusterName: ${CLUSTER_NAME}
replicas: ${WORKER_MACHINE_COUNT}
Expand Down Expand Up @@ -189,5 +196,6 @@ data:
kind: ConfigMap
metadata:
name: ${CLUSTER_NAME}-lb-config
namespace: ${NAMESPACE}
annotations:
"helm.sh/resource-policy": keep
5 changes: 5 additions & 0 deletions test/e2e/data/cluster-templates/gcp-gke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: "${CLUSTER_NAME}"
namespace: "${NAMESPACE}"
spec:
clusterNetwork:
pods:
Expand All @@ -20,6 +21,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: GCPManagedCluster
metadata:
name: "${CLUSTER_NAME}"
namespace: "${NAMESPACE}"
spec:
project: "${GCP_PROJECT}"
region: "europe-west2"
Expand All @@ -30,6 +32,7 @@ kind: GCPManagedControlPlane
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
metadata:
name: "${CLUSTER_NAME}-control-plane"
namespace: "${NAMESPACE}"
spec:
project: "${GCP_PROJECT}"
location: "europe-west2"
Expand All @@ -38,6 +41,7 @@ apiVersion: cluster.x-k8s.io/v1beta1
kind: MachinePool
metadata:
name: "${CLUSTER_NAME}-mp-0"
namespace: "${NAMESPACE}"
spec:
clusterName: "${CLUSTER_NAME}"
replicas: 1
Expand All @@ -55,6 +59,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: GCPManagedMachinePool
metadata:
name: "${CLUSTER_NAME}-mp-0"
namespace: "${NAMESPACE}"
spec:
nodeLocations:
- "europe-west2-a"

0 comments on commit c786c12

Please sign in to comment.