-
Notifications
You must be signed in to change notification settings - Fork 255
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
Add support for creating AWS nodes for OCP 4.18 #507
Add support for creating AWS nodes for OCP 4.18 #507
Conversation
@@ -25,6 +26,7 @@ data: | |||
us-east-2-4.15: ami-0b577c67f5371f6d1 | |||
us-east-2-4.16: ami-0f736c64d5751d7d3 | |||
us-east-2-4.17: ami-0dc8f3a200b9a6b1f | |||
us-east-2-4.18: ami-01ad29897d6c9fd4c |
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.
These appear to be OCP 4.17?
https://us-east-2.console.aws.amazon.com/ec2/home?region=us-east-2#ImageDetails:imageId=ami-01ad29897d6c9fd4c
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.
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.
Okay, based on what I found from the AMIs already here (i.e. using the "531415883065" owner ID), this aws
CLI command will get you the 10 most recent AMIs in a particular region (not sure if there's a better way since I'm not sure on the owner-id or the aws
filtering parameter might have some better uses than dumping it over to jq
...):
ocp_version=4.18
aws_region=us-east-1
ami_json=$(aws ec2 describe-images --region ${aws_region} --filters "Name=owner-id,Values=531415883065" --output json)
echo ${ami_json} | jq -r '.Images | sort_by(.Description) | .[] | select(.Name | startswith("rhcos-'${ocp_version//./}'")) | .ImageId + "\t" + .Description' | tail -10
But building on that, here's a loop to get the AMI for multiple OCP versions in different US regions:
for region in east west; do
for idx in 1 2; do
ami_json=$(aws ec2 describe-images --region us-${region}-${idx} --filters "Name=owner-id,Values=531415883065" --output json)
for ocp_version in 4.16 4.17 4.18; do
echo ${ami_json} | jq -r '.Images | sort_by(.Description) | .[] | select(.Name | startswith("rhcos-'${ocp_version//./}'")) | "us-'${region}-${idx}'\t" + .ImageId + "\t" + .Description' | tail -1
done
done
done
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.
Okay, actually. Following breadcrumbs in this Bugzilla (old but might still be relevant?): https://bugzilla.redhat.com/show_bug.cgi?id=1775774
Looks like the AMIs are discoverable in each release branch in the openshift/installer
repo: https://github.com/openshift/installer/blob/release-4.18/data/data/coreos/rhcos.json
So something like this might be more reliable/straightforward (assuming it's kept up-to-date):
curl -s https://raw.githubusercontent.com/openshift/installer/refs/heads/release-4.18/data/data/coreos/rhcos.json | jq '.architectures.x86_64.images.aws.regions'
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.
Perfect! Thanks! I'll make an update and test it out to make sure these AMI IDs work for these worker nodes.
/hold
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.
The AMI ids seem to be working fine. Just tested one release, but I'll try to use this method going forward to keep the images updated.
/unhold
We have to provide AMI IDs. Not sure the best way to get them anymore so grabbed them off of aws site. Signed-off-by: Gus Parvin <[email protected]>
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.
I was about to say I was just going to approve it, but since we've come this far I figured I'd do my due diligence. LGTM!
ids='<paste key:value list here>'
for idx in $(seq 0 "$(echo "${ids}" | yq 'keys | length - 1')"); do
key=$(echo "$ids" | yq "keys | .[$idx]")
aws_region=${key%-*}
ocp_ver=${key##*-}
printf "OCP-%s\t%s\t" ${ocp_ver} ${aws_region}
aws ec2 describe-images --region $aws_region --image-ids "$(echo "$ids" | yq ".[\"${key}\"]")" | jq -r '.Images[].Description'
done
OCP-4.12 us-east-1 OpenShift 4 412.86.202402272018-0 x86_64
OCP-4.12 us-east-2 OpenShift 4 412.86.202402272018-0 x86_64
OCP-4.13 us-east-1 OpenShift 4 413.92.202402131523-0 x86_64
OCP-4.13 us-east-2 OpenShift 4 413.92.202402131523-0 x86_64
OCP-4.14 us-east-1 OpenShift 4 414.92.202407091253-0 x86_64
OCP-4.14 us-east-2 OpenShift 4 414.92.202407091253-0 x86_64
OCP-4.15 us-east-1 OpenShift 4 415.92.202407091355-0 x86_64
OCP-4.15 us-east-2 OpenShift 4 415.92.202407091355-0 x86_64
OCP-4.16 us-east-1 OpenShift 4 416.94.202406251923-0 x86_64
OCP-4.16 us-east-2 OpenShift 4 416.94.202406251923-0 x86_64
OCP-4.17 us-east-1 OpenShift 4.17 417.94.202410090854-0 x86_64
OCP-4.17 us-east-2 OpenShift 4.17 417.94.202410090854-0 x86_64
OCP-4.18 us-east-1 OpenShift 4.18 418.94.202410090804-0 x86_64
OCP-4.18 us-east-2 OpenShift 4.18 418.94.202410090804-0 x86_64
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dhaiducek, gparvin 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 |
7757ce5
into
open-cluster-management-io:main
For reference, the new list looks wayyyyy better than the old list 🎉 (more up-to-date, and there seem to have been some unintended mismatches in there):
|
We have to provide AMI IDs. Not sure the best way to get them anymore so grabbed them off of aws site.