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

support Amazon Linux 2 worker nodes #626

Closed
JacobGabrielson opened this issue Aug 19, 2021 · 2 comments
Closed

support Amazon Linux 2 worker nodes #626

JacobGabrielson opened this issue Aug 19, 2021 · 2 comments
Assignees
Labels
feature New feature or request
Milestone

Comments

@JacobGabrielson
Copy link
Contributor

Tell us about your request

Presently karpenter supports, for AWS nodes, custom Launch Templates and Bottlerocket. This is a request to also support Amazon Linux 2.

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?

Some customers may wish to use AL2 because of familiarity or support for specific hardware.

Are you currently working around this issue?

Customers can use custom launch templates, but that does involve extra work and it seems better to just support
it directly as an option.

Additional context

n/a

Attachments

Most likely, the support should turn on the containerd-only flag:

https://github.com/awsdocs/amazon-eks-user-guide/blob/master/doc_source/eks-optimized-ami.md#containerd-bootstrap

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@JacobGabrielson JacobGabrielson added the feature New feature or request label Aug 19, 2021
@JacobGabrielson JacobGabrielson self-assigned this Aug 19, 2021
@JacobGabrielson
Copy link
Contributor Author

Useful info:

# Custom Bottlerocket
CLUSTER_NAME=$CLUSTER_NAME
KUBERNETES_VERSION=1.20
ARCHITECTURE=x86_64

USER_DATA=$(cat <<EOF | base64
[settings.kubernetes]
cluster-name = "${CLUSTER_NAME}"
api-server = $(aws eks describe-cluster --name $CLUSTER_NAME --query "cluster.endpoint")
cluster-certificate = $(aws eks describe-cluster --name $CLUSTER_NAME --query "cluster.certificateAuthority.data")
EOF
)

LAUNCH_TEMPLATE="$(cat <<-EOF
    {
      "ImageId": $(aws ssm get-parameter --name /aws/service/bottlerocket/aws-k8s-$KUBERNETES_VERSION/$ARCHITECTURE/latest/image_id --query "Parameter.Value"),
      "SecurityGroupIds": [$(aws eks describe-cluster --name $CLUSTER_NAME --query "cluster.resourcesVpcConfig.clusterSecurityGroupId")],
      "IamInstanceProfile": { "Name": "KarpenterNodeInstanceProfile-${CLUSTER_NAME}" },
      "TagSpecifications": [{"ResourceType": "instance", "Tags": [{ "Key": "kubernetes.io/cluster/$CLUSTER_NAME ", "Value": "owned" }]}],
      "UserData": "${USER_DATA}"
    }
EOF
)"

aws ec2 create-launch-template \
    --launch-template-name KarpenterCustomBottlerocket \
    --launch-template-data "${LAUNCH_TEMPLATE}"


# Custom EKS Optimized AMI
CLUSTER_NAME=$CLUSTER_NAME
B64_CLUSTER_CA=$(aws eks describe-cluster --name $CLUSTER_NAME --query "cluster.certificateAuthority.data")
API_SERVER_URL=$(aws eks describe-cluster --name $CLUSTER_NAME --query "cluster.endpoint")
USER_DATA=$(cat <<EOF | base64
#!/bin/bash
set -ex
/etc/eks/bootstrap.sh $CLUSTER_NAME --b64-cluster-ca $B64_CLUSTER_CA --apiserver-endpoint $API_SERVER_URL --dns-cluster-ip 10.100.0.10
EOF
)

KUBERNETES_VERSION=1.20
ARCHITECTURE=x86_64
LAUNCH_TEMPLATE="$(cat <<-EOF
    {
      "ImageId": $(aws ssm get-parameter --name /aws/service/eks/optimized-ami/${KUBERNETES_VERSION}/amazon-linux-2/recommended/image_id --region us-west-2 --query "Parameter.Value"),
      "SecurityGroupIds": [$(aws eks describe-cluster --name $CLUSTER_NAME --query "cluster.resourcesVpcConfig.clusterSecurityGroupId")],
      "IamInstanceProfile": { "Name": "KarpenterNodeInstanceProfile-${CLUSTER_NAME}" },
      "TagSpecifications": [{"ResourceType": "instance", "Tags": [{ "Key": "kubernetes.io/cluster/$CLUSTER_NAME ", "Value": "owned" }]}],
      "UserData": "${USER_DATA}"
    }
EOF
)"

aws ec2 create-launch-template \
    --launch-template-name KarpenterCustomEKSOptimizedAMI \
    --launch-template-data "${LAUNCH_TEMPLATE}"

@bwagner5 bwagner5 added this to the v0.4.0 milestone Aug 23, 2021
@JacobGabrielson
Copy link
Contributor Author

Fixed by #668

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants