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 bottlerocket bootstrapping for node groups #1695

Closed
wants to merge 12 commits into from

Conversation

ulm0
Copy link

@ulm0 ulm0 commented Nov 17, 2021

PR o'clock

Description

Fixes #1694

Allow bootstrap bottlerocket nodes.

...
  node_groups_defaults = {
    ami_type      = "BOTTLEROCKET_x86_64" # https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html#AmazonEKS-Type-Nodegroup-amiType
    disk_size     = 50
    disk_type     = "gp3"
    capacity_type = "SPOT"
  }
  node_groups = {
    system = {
      create_launch_template   = true
      desired_capacity         = 1
      max_capacity             = 10
      min_capacity             = 1
      instance_types           = ["c5n.2xlarge"]
      enable_admin_container   = false
      enable_control_container = true
      additional_userdata      = <<EOF
[settings.kubernetes.node-labels]
"node.kubernetes.io/environment" = "Production"
EOF
      update_config = {
        max_unavailable_percentage = 50 # or set `max_unavailable`
      }
    }
  }
...

Checklist

@hi-artem
Copy link

hi-artem commented Nov 18, 2021

Doesn't bottlerocket ami ships with 2 ebs volumes? I think you will need to add another block_device_mappings in the launch template. Something like that:

 block_device_mappings {
    device_name = "/dev/xvdb"

    ebs {
      volume_size           = lookup(each.value, "disk_size", null)
      volume_type           = lookup(each.value, "disk_type", null)
      iops                  = lookup(each.value, "disk_iops", null)
      throughput            = lookup(each.value, "disk_throughput", null)
      encrypted             = lookup(each.value, "disk_encrypted", null)
      kms_key_id            = lookup(each.value, "disk_kms_key_id", null)
      delete_on_termination = true
    }
  }

Updated Indeed there are two volumes required for bottlerocket ami. More info - bottlerocket-os/bottlerocket#1203

Copy link

@hi-artem hi-artem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to address issue with 2 volumes. See my comment above.

@hi-artem
Copy link

To simplify logic here, we can only care about /dev/xvdb sizing./dev/xvda contains operating system itself: the active & passive partitions, the bootloader, the dm-verity data, and the data store for the Bottlerocket API. We really shouldn't set its sizing explicitly. It should always be the same as in Bottlerocket AMI.

@ulm0
Copy link
Author

ulm0 commented Nov 19, 2021

Nice finding @hi-artem will address this topic asap.

@ulm0 ulm0 changed the title Support bottlerocket bootstrapping for node groups WIP: Support bottlerocket bootstrapping for node groups Nov 19, 2021
@ulm0
Copy link
Author

ulm0 commented Nov 22, 2021

Hi @hi-artem just added

device_name = length(split("BOTTLEROCKET", each.value["ami_type"])) > 1 ? "/dev/xvdb" : "/dev/xvda"

This sould do the work

@ulm0 ulm0 changed the title WIP: Support bottlerocket bootstrapping for node groups Support bottlerocket bootstrapping for node groups Nov 22, 2021
@ulm0
Copy link
Author

ulm0 commented Nov 22, 2021

Hi @johndietz just did some changes, the PR should be now good to go

@stevehipwell
Copy link
Contributor

@ulm0 could you take a look at #1645 and offer feedback; I think it's a more generic solution but some things might be missing?

@dusansusic
Copy link

@antonbabenko
Copy link
Member

This issue has been resolved in version 18.0.0 🎉

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support bottlerocket in node groups
7 participants