-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Machine e2e test with bring your own VPC
- Loading branch information
Richard Kovacs
committed
Feb 8, 2024
1 parent
7cbdc4c
commit 0df6687
Showing
22 changed files
with
217 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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,15 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: capi-controller-manager | ||
namespace: capi-system | ||
status: | ||
availableReplicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cluster-api-provider-linode-controller-manager | ||
namespace: cluster-api-provider-linode-system | ||
status: | ||
availableReplicas: 1 |
This file contains 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,8 @@ | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 | ||
kind: LinodeVPC | ||
metadata: | ||
annotations: | ||
cluster.x-k8s.io/paused: "true" | ||
name: linodevpc-sample | ||
status: | ||
ready: true |
46 changes: 46 additions & 0 deletions
46
e2e/linodemachine-controller/byovpc/01-create-cluster.tpl.yml
This file contains 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,46 @@ | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 | ||
kind: LinodeCluster | ||
metadata: | ||
annotations: | ||
cluster.x-k8s.io/paused: "true" | ||
name: linodecluster-sample | ||
spec: | ||
region: us-sea | ||
vpcRef: | ||
kind: LinodeVPC | ||
name: linodevpc-sample | ||
namespace: ${NAMESPACE} | ||
uid: ${VPC_UID} | ||
--- | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: Cluster | ||
metadata: | ||
annotations: | ||
cluster.x-k8s.io/paused: "true" | ||
name: cluster-sample | ||
spec: | ||
paused: true | ||
infrastructureRef: | ||
name: linodecluster-sample | ||
--- | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: Machine | ||
metadata: | ||
annotations: | ||
cluster.x-k8s.io/paused: "true" | ||
name: machine-sample | ||
spec: | ||
clusterName: cluster-sample | ||
bootstrap: | ||
configRef: | ||
apiVersion: v1 | ||
kind: "ConfigMap" | ||
name: "boostrap-sample" | ||
dataSecretName: bootstrap-data-sample | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: bootstrap-data-sample | ||
data: | ||
value: dG91Y2ggL29rCg== |
11 changes: 11 additions & 0 deletions
11
e2e/linodemachine-controller/byovpc/01-create-cluster.yaml
This file contains 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,11 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- command: make createVPC | ||
- script: |- | ||
VPC_ID=$(make fetchVPCID) \ | ||
TS="$(TPL="$PWD/01-create-vpc.tpl.yml" make renderTestCase)" make runTestSuit | ||
- command: make enableVPC | ||
- script: |- | ||
VPC_UID="$(OBJ=linodevpcs/linodevpc-sample make getKubeUid)" \ | ||
TS="$(TPL="$PWD/01-create-cluster.tpl.yml" make renderTestCase)" make runTestSuit |
This file contains 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,10 @@ | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 | ||
kind: LinodeVPC | ||
metadata: | ||
annotations: | ||
cluster.x-k8s.io/paused: "true" | ||
name: linodevpc-sample | ||
spec: | ||
label: capli-e2e-byovpc-sample | ||
region: us-sea | ||
vpcID: ${VPC_ID} |
10 changes: 10 additions & 0 deletions
10
e2e/linodemachine-controller/byovpc/01-vpc-create-options.json
This file contains 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,10 @@ | ||
{ | ||
"label": "capli-e2e-byovpc-sample", | ||
"region": "us-sea", | ||
"subnets": [ | ||
{ | ||
"ipv4": "10.0.0.0/24", | ||
"label": "capli-e2e-byovpc-sample" | ||
} | ||
] | ||
} |
This file contains 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,10 @@ | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 | ||
kind: LinodeMachine | ||
metadata: | ||
name: linodemachine-sample | ||
spec: | ||
region: us-sea | ||
type: g5-nanode-1 | ||
status: | ||
ready: true | ||
instanceState: running |
12 changes: 12 additions & 0 deletions
12
e2e/linodemachine-controller/byovpc/02-create-linodemachine.tpl.yml
This file contains 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,12 @@ | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 | ||
kind: LinodeMachine | ||
metadata: | ||
ownerReferences: | ||
- apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: Machine | ||
name: machine-sample | ||
uid: ${MACHINE_UID} | ||
name: linodemachine-sample | ||
spec: | ||
region: us-sea | ||
type: g5-nanode-1 |
6 changes: 6 additions & 0 deletions
6
e2e/linodemachine-controller/byovpc/02-create-linodemachine.yaml
This file contains 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,6 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: |- | ||
MACHINE_UID="$(OBJ=machines/machine-sample make getKubeUid)" \ | ||
TS="$(TPL="$PWD/02-create-linodemachine.tpl.yml" make renderTestCase)" make runTestSuit |
6 changes: 6 additions & 0 deletions
6
e2e/linodemachine-controller/byovpc/03-delete-linodemachine.yaml
This file contains 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,6 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
delete: | ||
- apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 | ||
kind: LinodeMachine | ||
name: linodemachine-sample |
This file contains 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,4 @@ | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 | ||
kind: LinodeMachine | ||
metadata: | ||
name: linodemachine-sample |
5 changes: 5 additions & 0 deletions
5
e2e/linodemachine-controller/byovpc/04-verify-linode-instance.yaml
This file contains 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,5 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: |- | ||
URI="linode/instances" FILTER="{\"tags\":\"$(OBJ=linodemachines/linodemachine-sample make getKubeUid)\"}" make callLinodeApiGet | grep 'results": 0' |
This file contains 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,11 @@ | ||
include ../../Makefile | ||
|
||
createVPC: | ||
@URI=vpcs FILTER='{"label":"capli-e2e-byovpc-sample"}' make --no-print-directory callLinodeApiGet | grep -v 'results": 0' ||\ | ||
URI=vpcs BODY='@01-vpc-create-options.json' make --no-print-directory callLinodeApiPost | ||
|
||
enableVPC: | ||
PATCH='{"status":{"ready":true}}' OBJ="linodevpcs/linodevpc-sample" make --no-print-directory patchKubeObjStatus | ||
|
||
fetchVPCID: | ||
@URI=vpcs FILTER='{"label":"capli-e2e-byovpc-sample"}' make --no-print-directory callLinodeApiGet | jq -r .data[0].id |
This file was deleted.
Oops, something went wrong.
This file contains 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 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