Skip to content

Commit

Permalink
add PodIdentity auth e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: Erhan Cagirici <[email protected]>
  • Loading branch information
erhancagirici committed Nov 1, 2024
1 parent 0d88de3 commit c533abf
Show file tree
Hide file tree
Showing 6 changed files with 602 additions and 14 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -259,18 +259,20 @@ uptest: $(UPTEST_LOCAL) $(KUBECTL) $(KUTTL)
# to be set. This is used for provisioning the target E2E test environment,
# including the EKS cluster and necessary environments.
providerconfig-e2e:
$(MAKE) SUBPACKAGES="ec2 rds config" build.all publish
$(MAKE) SUBPACKAGES="ec2 rds kafka config" build.all publish
AWS_FAMILY_PACKAGE_IMAGE="$(XPKG_REG_ORGS)/provider-family-aws:$(VERSION)" \
AWS_EC2_PACKAGE_IMAGE="$(XPKG_REG_ORGS)/provider-aws-ec2:$(VERSION)" \
AWS_RDS_PACKAGE_IMAGE="$(XPKG_REG_ORGS)/provider-aws-rds:$(VERSION)" \
TARGET_CROSSPLANE_VERSION="1.15.2" \
AWS_KAFKA_PACKAGE_IMAGE="$(XPKG_REG_ORGS)/provider-aws-kafka:$(VERSION)" \
TARGET_CROSSPLANE_VERSION="1.17.2" \
$(MAKE) -C e2e/providerconfig-aws-e2e-test e2e

providerconfig-e2e-nopublish:
AWS_FAMILY_PACKAGE_IMAGE="$(XPKG_REG_ORGS)/provider-family-aws:$(VERSION)" \
AWS_EC2_PACKAGE_IMAGE="$(XPKG_REG_ORGS)/provider-aws-ec2:$(VERSION)" \
AWS_RDS_PACKAGE_IMAGE="$(XPKG_REG_ORGS)/provider-aws-rds:$(VERSION)" \
TARGET_CROSSPLANE_VERSION="1.15.2" \
AWS_KAFKA_PACKAGE_IMAGE="$(XPKG_REG_ORGS)/provider-aws-kafka:$(VERSION)" \
TARGET_CROSSPLANE_VERSION="1.17.2" \
$(MAKE) -C e2e/providerconfig-aws-e2e-test e2e

uptest-local:
Expand Down
4 changes: 3 additions & 1 deletion e2e/providerconfig-aws-e2e-test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PLATFORMS ?= linux_amd64
KIND_VERSION = v0.22.0
UP_VERSION = v0.28.0
UP_CHANNEL = stable
UPTEST_VERSION = v0.11.1
UPTEST_VERSION = v0.13.0
YQ_VERSION = v4.40.5

-include ../../build/makelib/k8s_tools.mk
Expand All @@ -30,6 +30,7 @@ XPKGS = $(PROJECT_NAME)
-include ../../build/makelib/xpkg.mk

CROSSPLANE_NAMESPACE = upbound-system
CROSSPLANE_VERSION = 1.17.2
CROSSPLANE_ARGS = "--enable-usages,--debug"
-include ../../build/makelib/local.xpkg.mk
-include ../../build/makelib/controlplane.mk
Expand Down Expand Up @@ -83,6 +84,7 @@ uptest-e2e: $(UPTEST) $(KUBECTL) $(KUTTL) $(YQ)
@$(YQ) '(.spec.parameters.targetClusterParameters.provider.familyPackage = env(AWS_FAMILY_PACKAGE_IMAGE)) | \
(.spec.parameters.targetClusterParameters.provider.ec2Package = env(AWS_EC2_PACKAGE_IMAGE)) | \
(.spec.parameters.targetClusterParameters.provider.rdsPackage = env(AWS_RDS_PACKAGE_IMAGE)) | \
(.spec.parameters.targetClusterParameters.provider.kafkaPackage = env(AWS_KAFKA_PACKAGE_IMAGE)) | \
(.spec.parameters.targetClusterParameters.crossplaneVersion = env(TARGET_CROSSPLANE_VERSION)) ' \
package/examples/e2etestcluster-claim.yaml > '_output/e2etestcluster-claim.yaml'
if [ -n "${AWS_EKS_IAM_DEFAULT_ADMIN_ROLE}" ]; \
Expand Down
21 changes: 12 additions & 9 deletions e2e/providerconfig-aws-e2e-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
parameters:
id: aws-pc-e2e-test
region: us-west-2 # EKS cluster region
version: "1.28" # EKS cluster k8s version
version: "1.29" # EKS cluster k8s version
iam:
# replace with your custom roleArn that will administer the EKS cluster:
roleArn: "arn:aws:iam::123456789012:role/mydefaulteksadminrole"
Expand Down Expand Up @@ -82,10 +82,11 @@ spec:
namespace: upbound-system
targetClusterParameters: # the parameters for the target EKS control plane cluster
provider: # provider package urls to be used in testing
familyPackage: "xpkg.upbound.io/upbound/provider-family-aws:v1.3.0"
ec2Package: "xpkg.upbound.io/upbound/provider-aws-ec2:v1.3.0"
rdsPackage: "xpkg.upbound.io/upbound/provider-aws-rds:v1.3.0"
crossplaneVersion: 1.15.2 # the crossplane version to be installed in the testing control plane
familyPackage: "xpkg.upbound.io/upbound/provider-family-aws:v1.16.0"
ec2Package: "xpkg.upbound.io/upbound/provider-aws-ec2:v1.16.0"
rdsPackage: "xpkg.upbound.io/upbound/provider-aws-rds:v1.16.0"
kafkaPackage: "xpkg.upbound.io/upbound/provider-aws-kafka:v1.16.0"
crossplaneVersion: 1.17.2 # the crossplane version to be installed in the testing control plane
writeConnectionSecretToRef:
name: aws-pc-e2e-test-kubeconfig
status:
Expand Down Expand Up @@ -127,6 +128,7 @@ The make target expects the following environment variables to be set:
- `AWS_FAMILY_PACKAGE_IMAGE`: The package URL for `provider-family-aws`
- `AWS_EC2_PACKAGE_IMAGE`: The package URL for `provider-aws-ec2`
- `AWS_RDS_PACKAGE_IMAGE`: The package URL for `provider-aws-rds`
- `AWS_KAFKA_PACKAGE_IMAGE`: The package URL for `provider-aws-kafka`
- `AWS_EKS_IAM_DEFAULT_ADMIN_ROLE`: the ARN of an existing IAM role. This will be assigned as the E2E test EKS cluster default admin
- `TARGET_CROSSPLANE_VERSION`: The target crossplane version to be deployed into the testing cluster
- `UPTEST_CLOUD_CREDENTIALS`: The AWS credentials for the AWS account that the e2e tests will run on. Should be in the format of AWS CLI INI config.
Expand All @@ -141,11 +143,12 @@ aws_secret_access_key = your-aws-secret-access-key
```

```shell
export AWS_FAMILY_PACKAGE_IMAGE="xpkg.upbound.io/upbound/provider-family-aws:1.4.0"
export AWS_EC2_PACKAGE_IMAGE="xpkg.upbound.io/upbound/provider-aws-ec2:1.4.0"
export AWS_RDS_PACKAGE_IMAGE="xpkg.upbound.io/upbound/provider-aws-rds:1.4.0"
export AWS_FAMILY_PACKAGE_IMAGE="xpkg.upbound.io/upbound/provider-family-aws:1.16.0"
export AWS_EC2_PACKAGE_IMAGE="xpkg.upbound.io/upbound/provider-aws-ec2:1.16.0"
export AWS_RDS_PACKAGE_IMAGE="xpkg.upbound.io/upbound/provider-aws-rds:1.16.0"
export AWS_KAFKA_PACKAGE_IMAGE="xpkg.upbound.io/upbound/provider-aws-kafka:1.16.0"
export AWS_EKS_IAM_DEFAULT_ADMIN_ROLE="arn:aws:iam::123456789012:role/mydefaulteksadminrole"
export TARGET_CROSSPLANE_VERSION="1.15.2"
export TARGET_CROSSPLANE_VERSION="1.17.2"
export UPTEST_CLOUD_CREDENTIALS="$(cat my-aws-creds.txt)"
# from repo root
make -C e2e/providerconfig-aws-e2e-test e2e
Expand Down
Loading

0 comments on commit c533abf

Please sign in to comment.