Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testsys: Add support for node provisioning with Karpenter #3067

Merged
merged 1 commit into from
May 5, 2023

Conversation

ecpullen
Copy link
Contributor

@ecpullen ecpullen commented May 2, 2023

Issue number:

Closes #N/A

Description of changes:

Enables the use of the agent created in bottlerocket-os/bottlerocket-test-system#803

Note: You can provision nodes with karpenter by specifying karpenter-block-device-mappings in Test.toml.
To follow the generic mapping, use the following configuration:

[aws-k8s.configuration.karpenter]
test-type = "quick"
karpenter-device-mapping = [
    {name = "/dev/xvda", volumeType = "gp3", volumeSize = 4, deleteOnTermination = true},
    {name = "/dev/xvdb", volumeType = "gp3", volumeSize = 20, deleteOnTermination = true},
]

This configuration creates a new test type for all aws-k8s variants called karpenter (the string following .configuration in the table heading).

Before launching nodes with karpenter you will need to add the karpenter role to your cluster's aws-auth config map.

# Change to your clusters name
CLUSTER_NAME=my-cluster
ACCOUNT_ID=your-account-id
REGION=us-west-2
eksctl create iamidentity mapping \
  -r ${REGION} \
  --cluster ${CLUSTER_NAME} \
  --arn arn:aws:iam::${ACCOUNT_ID}:role/KarpenterInstanceNodeRole \
  --username system:node:{{EC2PrivateDNSName}} \
  --group system:bootstrappers \
  --group system:nodes

You can run the test by calling,

cargo make -e TESTSYS_TEST=karpenter test

Testing done:

Verified that cargo make test still works as expected when sonobuoy-image is and is not provided.

Tested using the above instructions and verified that the instances we created and the test ran successfully.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@ecpullen ecpullen force-pushed the karpenter branch 2 times, most recently from 8084609 to 965a61f Compare May 2, 2023 16:46
TESTING.md Outdated Show resolved Hide resolved
@ecpullen ecpullen force-pushed the karpenter branch 2 times, most recently from b7d88a9 to b2d3afb Compare May 4, 2023 20:51
@ecpullen
Copy link
Contributor Author

ecpullen commented May 4, 2023

^ Small typo in documentation

@bcressey bcressey merged commit b4dee7b into bottlerocket-os:develop May 5, 2023
37 checks passed
@ecpullen ecpullen deleted the karpenter branch May 8, 2023 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants