Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,35 @@ expiration_date=$(date -d '8 hours' --iso=minutes --utc)
function join_by { local IFS="$1"; shift; echo "$*"; }

REGION="${LEASED_RESOURCE}"

# m6a (AMD) are more cost effective than other x86 instance types
# for general purpose work. Use by default, when supported in the
# region.
IS_M6A_REGION="no"
if aws ec2 describe-instance-type-offerings --region "${REGION}" | grep m6a ; then
IS_M6A_REGION="yes"
fi

# Do not change auto-types unless it is coordinated with the cloud
# financial operations team. Savings plans may be in place to
# decrease the cost of certain instance families.
if [[ "${COMPUTE_NODE_TYPE}" == "" ]]; then
if [[ "${IS_M6A_REGION}" == "yes" ]]; then
COMPUTE_NODE_TYPE="m6a.xlarge"
else
COMPUTE_NODE_TYPE="m6i.xlarge"
fi
fi

# BootstrapInstanceType gets its value from pkg/types/aws/defaults/platform.go
architecture=${OCP_ARCH:-"amd64"}
arch_instance_type=m6i

if [[ "${IS_M6A_REGION}" == "yes" ]]; then
arch_instance_type=m6a
else
arch_instance_type=m6i
fi

if [[ "${CLUSTER_TYPE}" == "aws-arm64" ]]; then
architecture="arm64"
fi
Expand All @@ -29,7 +55,8 @@ workers=3
if [[ "${SIZE_VARIANT}" == "compact" ]]; then
workers=0
fi
master_type=null

master_type=${arch_instance_type}.xlarge
if [[ "${SIZE_VARIANT}" == "xlarge" ]]; then
master_type=${arch_instance_type}.8xlarge
elif [[ "${SIZE_VARIANT}" == "large" ]]; then
Expand Down
6 changes: 3 additions & 3 deletions ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-ref.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ ref:
in some regions or accounts due to quota issues.

- name: COMPUTE_NODE_TYPE
default: "m6i.xlarge"
default: ""
documentation: |-
The instance type to use for compute nodes (e.g. AWS https://aws.amazon.com/ec2/instance-types/). We use a 4 core worker to match the median configuration of the fleet.
Do not change family type without consulting with FinOPs about active AWS savings plans.
The instance type to use for compute nodes (e.g. AWS https://aws.amazon.com/ec2/instance-types/). When "" (default),
the step uses the lowest cost 4 CPU / 16G supported worker instance type for the region.
- name: OCP_ARCH
default: "amd64"
documentation: |-
Expand Down