diff --git a/configurations/arm/eks.yaml b/configurations/arm/eks.yaml new file mode 100644 index 0000000000..0c6459013d --- /dev/null +++ b/configurations/arm/eks.yaml @@ -0,0 +1,5 @@ +k8s_instance_type_auxiliary: 't4g.large' +k8s_instance_type_monitor: 't4g.large' +instance_type_loader: 'c6gn.xlarge' +instance_type_db: 'im4gn.4xlarge' +k8s_scylla_disk_gi: 6900 diff --git a/configurations/operator/functional-eks-arm.yaml b/configurations/operator/functional-eks-arm.yaml new file mode 100644 index 0000000000..9f1bcb839a --- /dev/null +++ b/configurations/operator/functional-eks-arm.yaml @@ -0,0 +1,6 @@ +user_prefix: 'functional-arm' +k8s_instance_type_auxiliary: 't4g.large' +k8s_instance_type_monitor: 't4g.large' +instance_type_loader: 'c6gn.xlarge' +instance_type_db: 'im4gn.xlarge' +k8s_scylla_disk_gi: 1600 diff --git a/functional_tests/scylla_operator/test_functional.py b/functional_tests/scylla_operator/test_functional.py index cd0af7a488..ebbefc4935 100644 --- a/functional_tests/scylla_operator/test_functional.py +++ b/functional_tests/scylla_operator/test_functional.py @@ -39,6 +39,7 @@ SCYLLA_OPERATOR_NAMESPACE ) from sdcm.mgmt import TaskStatus +from sdcm.utils.aws_utils import get_arch_from_instance_type from sdcm.utils.common import ParallelObject from sdcm.utils.k8s import ( convert_cpu_units_to_k8s_value, @@ -754,6 +755,16 @@ def test_deploy_helm_with_default_values(db_cluster: ScyllaPodCluster): Deploy Scylla using helm chart with only default values. Storage capacity expected to be 10Gi """ + # TODO: remove this skip when https://github.com/scylladb/scylla-operator/pull/1603 gets merged + if "eks" in db_cluster.params.get("cluster_backend"): + for k8s_cluster in db_cluster.k8s_clusters: + instance_type_db = k8s_cluster.params.get("instance_type_db") + region_name = k8s_cluster.region_name + if get_arch_from_instance_type(instance_type=instance_type_db, region_name=region_name) == "arm64": + pytest.skip( + "Scylla-manager default version must be 3.2.5 or greater." + " See https://github.com/scylladb/scylla-operator/pull/1603") + target_chart_name, namespace = ("t-default-values",) * 2 expected_capacity = '10Gi' need_to_collect_logs, k8s_cluster = True, db_cluster.k8s_cluster diff --git a/jenkins-pipelines/operator/eks/longevity-scylla-operator-3h-eks-arm.jenkinsfile b/jenkins-pipelines/operator/eks/longevity-scylla-operator-3h-eks-arm.jenkinsfile new file mode 100644 index 0000000000..b3638cd34c --- /dev/null +++ b/jenkins-pipelines/operator/eks/longevity-scylla-operator-3h-eks-arm.jenkinsfile @@ -0,0 +1,17 @@ +#!groovy + +def lib = library identifier: 'sct@snapshot', retriever: legacySCM(scm) + +longevityPipeline( + backend: 'k8s-eks', + region: 'eu-west-2', + availability_zone: 'c', + test_name: 'longevity_test.LongevityTest.test_custom_time', + test_config: '''["test-cases/scylla-operator/longevity-scylla-operator-3h.yaml", "configurations/arm/eks.yaml"]''', + email_recipients: 'qa@scylladb.com,scylla-operator@scylladb.com', + post_behavior_db_nodes: 'destroy', + post_behavior_loader_nodes: 'destroy', + post_behavior_monitor_nodes: 'destroy', + post_behavior_k8s_cluster: 'destroy', + k8s_log_api_calls: false, +) diff --git a/jenkins-pipelines/operator/functional/functional-eks-arm.jenkinsfile b/jenkins-pipelines/operator/functional/functional-eks-arm.jenkinsfile new file mode 100644 index 0000000000..150913aa74 --- /dev/null +++ b/jenkins-pipelines/operator/functional/functional-eks-arm.jenkinsfile @@ -0,0 +1,18 @@ +#!groovy + +def lib = library identifier: 'sct@snapshot', retriever: legacySCM(scm) + +longevityPipeline( + backend: 'k8s-eks', + region: 'eu-west-2', + availability_zone: 'c', + functional_test: true, + test_name: 'functional_tests/scylla_operator', + test_config: '''["test-cases/scylla-operator/functional.yaml", "configurations/operator/functional-eks-arm.yaml"]''', + email_recipients: 'qa@scylladb.com,scylla-operator@scylladb.com', + post_behavior_db_nodes: 'destroy', + post_behavior_loader_nodes: 'destroy', + post_behavior_monitor_nodes: 'destroy', + post_behavior_k8s_cluster: 'destroy', + k8s_log_api_calls: false, +) diff --git a/sdcm/cluster_k8s/eks.py b/sdcm/cluster_k8s/eks.py index 5fbdd1aa30..4c12512ec4 100644 --- a/sdcm/cluster_k8s/eks.py +++ b/sdcm/cluster_k8s/eks.py @@ -41,6 +41,7 @@ ) from sdcm.remote import LOCALRUNNER from sdcm.utils.aws_utils import ( + get_arch_from_instance_type, get_ec2_network_configuration, tags_as_ec2_tags, EksClusterCleanupMixin, @@ -55,6 +56,8 @@ EC2_INSTANCE_UPDATE_LOCK = Lock() +ARCH_TO_IMAGE_TYPE_MAPPING = {'arm64': 'AL2_ARM_64', 'x86_64': 'AL2_x86_64'} + def init_k8s_eks_cluster(region_name: str, availability_zone: str, params: dict, credentials: List[cluster.UserRemoteCredentials], @@ -171,12 +174,16 @@ def __init__( ssh_key_pair_name: str = None, provision_type: Literal['ON_DEMAND', 'SPOT'] = 'ON_DEMAND', launch_template: str = None, - image_type: Literal['AL2_x86_64', 'AL2_x86_64_GPU', 'AL2_ARM_64'] = 'AL2_x86_64', + image_type: Literal['AL2_x86_64', 'AL2_x86_64_GPU', 'AL2_ARM_64'] = None, disk_type: Literal["standard", "io1", "io2", "gp2", "sc1", "st1"] = None, k8s_version: str = None, is_deployed: bool = False, user_data: str = None, ): + if not image_type: + current_arch = get_arch_from_instance_type( + instance_type=instance_type, region_name=k8s_cluster.region_name) + image_type = ARCH_TO_IMAGE_TYPE_MAPPING.get(current_arch, "AL2_x86_64") super().__init__( k8s_cluster=k8s_cluster, name=name,