-
Notifications
You must be signed in to change notification settings - Fork 411
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
chore: changes for building CAPA amis #1583
Conversation
Skipping CI for Draft Pull Request. |
@richardcase per your comment:
I think we can resolve this by not attempting to get data during the network stage. To accomplish this, we can apply the following change, which will override the local datasource to do nothing and return false when
|
@holmanb does |
Not necessarily. There are a few different ways to accomplish the same thing.
It really doesn't matter which you inherit from for this local datasource. Either way you still need to override |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
@dlipovetsky - we should follow up on this so that we can stop downgrading and pinning cloud-init |
After chatting with @faiq i will pick this up again. |
I gave this code a try here main...faiq:image-builder:custom-ami-ds and then built an AMI with it root@<redacted>:/var/snap/amazon-ssm-agent/9881# bash
root@<redacted>:/var/snap/amazon-ssm-agent/9881# cat /var/log/cloud-init-output.log
[2025-01-23 20:04:00] Cloud-init v. 24.4-0ubuntu1~22.04.1 running 'init-local' at Thu, 23 Jan 2025 20:04:00 +0000. Up 10.33 seconds.
[2025-01-23 20:04:03] Cloud-init v. 24.4-0ubuntu1~22.04.1 running 'init' at Thu, 23 Jan 2025 20:04:03 +0000. Up 13.05 seconds.
[2025-01-23 20:04:03] ci-info: ++++++++++++++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++++++++++++++
[2025-01-23 20:04:03] ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+
[2025-01-23 20:04:03] ci-info: | Device | Up | Address | Mask | Scope | Hw-Address |
[2025-01-23 20:04:03] ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+
[2025-01-23 20:04:03] ci-info: | ens5 | True | <redacted> | 255.255.192.0 | global | 06:50:f1:f8:c1:6f |
[2025-01-23 20:04:03] ci-info: | ens5 | True | <redacted> | . | link | 06:50:f1:f8:c1:6f |
[2025-01-23 20:04:03] ci-info: | lo | True | 127.0.0.1 | 255.0.0.0 | host | . |
[2025-01-23 20:04:03] ci-info: | lo | True | ::1/128 | . | host | . |
[2025-01-23 20:04:03] ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+
[2025-01-23 20:04:03] ci-info: +++++++++++++++++++++++++++++Route IPv4 info++++++++++++++++++++++++++++++
[2025-01-23 20:04:03] ci-info: +-------+-------------+------------+-----------------+-----------+-------+
[2025-01-23 20:04:03] ci-info: | Route | Destination | Gateway | Genmask | Interface | Flags |
[2025-01-23 20:04:03] ci-info: +-------+-------------+------------+-----------------+-----------+-------+
[2025-01-23 20:04:03] ci-info: | 0 | 0.0.0.0 | 10.0.128.1 | 0.0.0.0 | ens5 | UG |
[2025-01-23 20:04:03] ci-info: | 1 | 10.0.0.2 | 10.0.128.1 | 255.255.255.255 | ens5 | UGH |
[2025-01-23 20:04:03] ci-info: | 2 | 10.0.128.0 | 0.0.0.0 | 255.255.192.0 | ens5 | U |
[2025-01-23 20:04:03] ci-info: | 3 | 10.0.128.1 | 0.0.0.0 | 255.255.255.255 | ens5 | UH |
[2025-01-23 20:04:03] ci-info: +-------+-------------+------------+-----------------+-----------+-------+
[2025-01-23 20:04:03] ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++
[2025-01-23 20:04:03] ci-info: +-------+-------------+---------+-----------+-------+
[2025-01-23 20:04:03] ci-info: | Route | Destination | Gateway | Interface | Flags |
[2025-01-23 20:04:03] ci-info: +-------+-------------+---------+-----------+-------+
[2025-01-23 20:04:03] ci-info: | 1 | fe80::/64 | :: | ens5 | U |
[2025-01-23 20:04:03] ci-info: | 3 | anycast | :: | ens5 | U |
[2025-01-23 20:04:03] ci-info: | 4 | local | :: | ens5 | U |
[2025-01-23 20:04:03] ci-info: | 5 | multicast | :: | ens5 | U |
[2025-01-23 20:04:03] ci-info: +-------+-------------+---------+-----------+-------+
[2025-01-23 20:04:03] 2025-01-23 20:04:03,310 - user_data.py[WARNING]: [Errno 2] No such file or directory: '/etc/secret-userdata.txt' for url: file:///etc/secret-userdata.txt
[2025-01-23 20:04:03] 2025-01-23 20:04:03,312 - DataSourceEc2Kubernetes.py[WARNING]: Kubernetes is trying to restart cloud-init. This is no longer necessary and is temporarily circumvented by cloud-init. This will be a hard error in the future.
[2025-01-23 20:04:03] +++ [2025-01-23T20:04:03+00:00] aws.cluster.x-k8s.io encrypted cloud-init script /var/lib/cloud/instances/i-05e283ee175330d10/boothooks/part-001 started
[2025-01-23 20:04:03] +++ [2025-01-23T20:04:03+00:00] secret prefix: aws.cluster.x-k8s.io/9d38f6d6-6872-439d-8c95-b206a9e700fe
[2025-01-23 20:04:03] +++ [2025-01-23T20:04:03+00:00] secret count: 2
[2025-01-23 20:04:03] +++ [2025-01-23T20:04:03+00:00] getting userdata from AWS Secrets Manager
[2025-01-23 20:04:03] +++ [2025-01-23T20:04:03+00:00] getting secret value from AWS Secrets Manager
[2025-01-23 20:04:15] +++ [2025-01-23T20:04:15+00:00] AWS CLI reported successful execution for SecretsManager::GetSecretValue
[2025-01-23 20:04:15] +++ [2025-01-23T20:04:15+00:00] appending data to temporary file /etc/secret-userdata.txt.gz
[2025-01-23 20:04:15] +++ [2025-01-23T20:04:15+00:00] getting userdata from AWS Secrets Manager
[2025-01-23 20:04:15] +++ [2025-01-23T20:04:15+00:00] getting secret value from AWS Secrets Manager
[2025-01-23 20:04:16] +++ [2025-01-23T20:04:16+00:00] AWS CLI reported successful execution for SecretsManager::GetSecretValue
[2025-01-23 20:04:16] +++ [2025-01-23T20:04:16+00:00] appending data to temporary file /etc/secret-userdata.txt.gz
[2025-01-23 20:04:16] +++ [2025-01-23T20:04:16+00:00] deleting secret from AWS Secrets Manager
[2025-01-23 20:04:17] +++ [2025-01-23T20:04:17+00:00] AWS CLI reported successful execution for SecretsManager::DeleteSecret
[2025-01-23 20:04:17] +++ [2025-01-23T20:04:17+00:00] deleting secret from AWS Secrets Manager
[2025-01-23 20:04:18] +++ [2025-01-23T20:04:18+00:00] AWS CLI reported successful execution for SecretsManager::DeleteSecret
[2025-01-23 20:04:18] +++ [2025-01-23T20:04:18+00:00] decompressing userdata to /etc/secret-userdata.txt
[2025-01-23 20:04:18] +++ [2025-01-23T20:04:18+00:00] restarting cloud-init
[2025-01-23 20:04:18] +++ [2025-01-23T20:04:18+00:00] aws.cluster.x-k8s.io encrypted cloud-init script /var/lib/cloud/instances/i-05e283ee175330d10/boothooks/part-001 finished
[2025-01-23 20:04:19] +++ [2025-01-23T20:04:19+00:00] aws.cluster.x-k8s.io encrypted cloud-init script /var/lib/cloud/instances/i-05e283ee175330d10/boothooks/part-001 started
[2025-01-23 20:04:19] +++ [2025-01-23T20:04:19+00:00] secret prefix: aws.cluster.x-k8s.io/9d38f6d6-6872-439d-8c95-b206a9e700fe
[2025-01-23 20:04:19] +++ [2025-01-23T20:04:19+00:00] secret count: 2
[2025-01-23 20:04:19] +++ [2025-01-23T20:04:19+00:00] encrypted userdata already written to disk
[2025-01-23 20:04:19] +++ [2025-01-23T20:04:19+00:00] aws.cluster.x-k8s.io encrypted cloud-init script /var/lib/cloud/instances/i-05e283ee175330d10/boothooks/part-001 finished
[2025-01-23 20:04:20] Generating public/private rsa key pair.
[2025-01-23 20:04:20] Your identification has been saved in /etc/ssh/ssh_host_rsa_key
[2025-01-23 20:04:20] Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub
[2025-01-23 20:04:20] The key fingerprint is:
[2025-01-23 20:04:20] SHA256:04WxATNEf2A739Ht8f+GEhVlNF2pK7SeBjv/BByOagk root@ip-10-0-168-254
[2025-01-23 20:04:20] The key's randomart image is:
[2025-01-23 20:04:20] +---[RSA 3072]----+
[2025-01-23 20:04:20] | o*.= +O|
[2025-01-23 20:04:20] | = B .++|
[2025-01-23 20:04:20] | *.o ooo|
[2025-01-23 20:04:20] | .+*.o.oo|
[2025-01-23 20:04:20] | E S.o+o.o o|
[2025-01-23 20:04:20] | . oo oo. .|
[2025-01-23 20:04:20] | + + oo ..|
[2025-01-23 20:04:20] | . o +o . o|
[2025-01-23 20:04:20] | +..o ..|
[2025-01-23 20:04:20] +----[SHA256]-----+
[2025-01-23 20:04:20] Generating public/private ecdsa key pair.
[2025-01-23 20:04:20] Your identification has been saved in /etc/ssh/ssh_host_ecdsa_key
[2025-01-23 20:04:20] Your public key has been saved in /etc/ssh/ssh_host_ecdsa_key.pub
[2025-01-23 20:04:20] The key fingerprint is:
[2025-01-23 20:04:20] SHA256:WQNF5Z01wFRBlBBeTMCa7N2IQKrdszPfBfeGGpYZ1mc root@ip-10-0-168-254
[2025-01-23 20:04:20] The key's randomart image is:
[2025-01-23 20:04:20] +---[ECDSA 256]---+
[2025-01-23 20:04:20] | .oo.=*@O+|
[2025-01-23 20:04:20] | o ..+.=.|
[2025-01-23 20:04:20] | o + +.o |
[2025-01-23 20:04:20] | . + = . |
[2025-01-23 20:04:20] | o S o =.+.E|
[2025-01-23 20:04:20] | . . o + *o=.|
[2025-01-23 20:04:20] | o = ..o|
[2025-01-23 20:04:20] | + ..o.. |
[2025-01-23 20:04:20] | +... |
[2025-01-23 20:04:20] +----[SHA256]-----+
[2025-01-23 20:04:20] Generating public/private ed25519 key pair.
[2025-01-23 20:04:20] Your identification has been saved in /etc/ssh/ssh_host_ed25519_key
[2025-01-23 20:04:20] Your public key has been saved in /etc/ssh/ssh_host_ed25519_key.pub
[2025-01-23 20:04:20] The key fingerprint is:
[2025-01-23 20:04:20] SHA256:PCMrFLxJqM34AbLCNl2YIAkjnAsvTBT1ckaOWFFx5wM root@ip-10-0-168-254
[2025-01-23 20:04:20] The key's randomart image is:
[2025-01-23 20:04:20] +--[ED25519 256]--+
[2025-01-23 20:04:20] |O=++o+.E . |
[2025-01-23 20:04:20] |==+oB . + |
[2025-01-23 20:04:20] |*oo=+* o |
[2025-01-23 20:04:20] |+Xo.=+ . . |
[2025-01-23 20:04:20] |==+.+ . S |
[2025-01-23 20:04:20] |o..o o o |
[2025-01-23 20:04:20] | . . . |
[2025-01-23 20:04:20] | . |
[2025-01-23 20:04:20] | |
[2025-01-23 20:04:20] +----[SHA256]-----+
[2025-01-23 20:04:23] Cloud-init v. 24.4-0ubuntu1~22.04.1 running 'modules:config' at Thu, 23 Jan 2025 20:04:23 +0000. Up 33.75 seconds.
[2025-01-23 20:04:25] Cloud-init v. 24.4-0ubuntu1~22.04.1 running 'modules:final' at Thu, 23 Jan 2025 20:04:25 +0000. Up 35.54 seconds.
[2025-01-23 20:04:25] Cloud-init v. 24.4-0ubuntu1~22.04.1 finished at Thu, 23 Jan 2025 20:04:25 +0000. Datasource DataSourceEc2Kubernetes. Up 35.70 seconds these changes worked great for me. i think we can add the following.
EDIT: although the file |
I believe this PR is ready to come out of draft I've tested with both ubuntu 22.04 and 24.04 images |
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/assign @mboersma
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@richardcase could you squash the commits?
i can squash the commits @mboersma |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mboersma The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
cloud-init restart Signed-off-by: Richard Case <[email protected]> Co-authored-by: Faiq Raza <[email protected]>
Thanks to everyone for working together to solve this 🙇 |
/lgtm |
Can confirm this works on the latest Ubuntu 24.04 daily images running cloud-init 24.4-0ubuntu1~24.04.2 |
Change description
Related issues
Additional context