From 573749d0b884bc6529acd754ec6fa45052ff5d5a Mon Sep 17 00:00:00 2001 From: Kamesh Akella Date: Wed, 30 Oct 2024 16:02:39 -0400 Subject: [PATCH] Update to ARM worker node types Signed-off-by: Kamesh Akella --- .github/workflows/README.md | 2 +- .github/workflows/rosa-cluster-create.yml | 4 +-- .../report/rosa-benchmark-key-results.adoc | 2 +- .../pages/prerequisite/prerequisite-rosa.adoc | 4 +-- provision/aws/rosa_create_cluster.sh | 2 +- .../keycloak-nightly-imagestream.yaml | 2 +- .../minikube/keycloak/templates/keycloak.yaml | 32 +++++++++++++++++++ .../opentofu/modules/rosa/hcp/variables.tf | 2 +- 8 files changed, 41 insertions(+), 9 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 713089ad9..9eed96f0f 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -14,7 +14,7 @@ 2. Click on Run workflow button 3. Fill in the form and click on Run workflow button 1. Name of the cluster - the name of the cluster that will be later used for other workflows. Default value is `gh-${{ github.repository_owner }}`, this results in `gh-`. - 2. Instance type for compute nodes - see [AWS EC2 instance types](https://aws.amazon.com/ec2/instance-types/). Default value is `m5.2xlarge`. + 2. Instance type for compute nodes - see [AWS EC2 instance types](https://aws.amazon.com/ec2/instance-types/). Default value is `m6g.2xlarge`. 3. Deploy to multiple availability zones in the region - if checked, the cluster will be deployed to multiple availability zones in the region. Default value is `false`. 4. Number of worker nodes to provision - number of compute nodes in the cluster. Default value is `2`. 4. Wait for the workflow to finish. diff --git a/.github/workflows/rosa-cluster-create.yml b/.github/workflows/rosa-cluster-create.yml index 41ffb09d8..f14c88e38 100644 --- a/.github/workflows/rosa-cluster-create.yml +++ b/.github/workflows/rosa-cluster-create.yml @@ -11,7 +11,7 @@ on: type: string computeMachineType: description: 'Instance type for the compute nodes' - default: 'm5.2xlarge' + default: 'm6g.2xlarge' type: string availabilityZones: description: 'Availability zones to deploy to' @@ -35,7 +35,7 @@ on: default: 10.0.0.0/24 computeMachineType: description: 'Instance type for the compute nodes' - default: 'm5.2xlarge' + default: 'm6g.2xlarge' type: string availabilityZones: description: 'Availability zones to deploy to' diff --git a/doc/benchmark/modules/ROOT/pages/report/rosa-benchmark-key-results.adoc b/doc/benchmark/modules/ROOT/pages/report/rosa-benchmark-key-results.adoc index 48eef7213..4bb8b4309 100644 --- a/doc/benchmark/modules/ROOT/pages/report/rosa-benchmark-key-results.adoc +++ b/doc/benchmark/modules/ROOT/pages/report/rosa-benchmark-key-results.adoc @@ -14,7 +14,7 @@ Collecting the CPU usage for refreshing a token is currently performed manually This setup is run https://github.com/keycloak/keycloak-benchmark/blob/main/.github/workflows/rosa-cluster-auto-provision-on-schedule.yml[daily on a GitHub action schedule]: * OpenShift 4.15.x deployed on AWS via ROSA with two AWS availability zones in AWS one region. -* Machinepool with `m5.2xlarge` instances. +* Machinepool with `m6g.2xlarge` instances. * Keycloak 25 release candidate build deployed with Operator and 3 pods in each site as an active/passive setup, and Infinispan connecting the two sites. * Default user password hashing with Argon2 and 5 hash iterations and minimum memory size 7 MiB https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#argon2id[as recommended by OWASP]. * Database seeded with 100,000 users and 100,000 clients. diff --git a/doc/kubernetes/modules/ROOT/pages/prerequisite/prerequisite-rosa.adoc b/doc/kubernetes/modules/ROOT/pages/prerequisite/prerequisite-rosa.adoc index 66054ef06..0373da33b 100644 --- a/doc/kubernetes/modules/ROOT/pages/prerequisite/prerequisite-rosa.adoc +++ b/doc/kubernetes/modules/ROOT/pages/prerequisite/prerequisite-rosa.adoc @@ -36,7 +36,7 @@ After the installation process is finished, it creates a new admin user. CLUSTER_NAME=rosa-kcb VERSION=4.13.8 REGION=eu-central-1 -COMPUTE_MACHINE_TYPE=m5.2xlarge +COMPUTE_MACHINE_TYPE=m6g.2xlarge MULTI_AZ=false REPLICAS=3 ---- @@ -85,7 +85,7 @@ The above installation script creates an admin user automatically but in case th == Scaling the cluster's nodes on demand The standard setup of nodes might be too small for running a load test, at the same time using a different instance type and rebuilding the cluster takes a lot of time (about 45 minutes). -To scale the cluster on demand, the standard setup has a machine pool named `scaling` with instances of type `m5.2xlarge` which is auto-scaled based on the current demand from 4 to 15 instances. +To scale the cluster on demand, the standard setup has a machine pool named `scaling` with instances of type `m6g.2xlarge` which is auto-scaled based on the current demand from 4 to 15 instances. However, auto-scaling of worker nodes is quite time-consuming as nodes are scaled one by one. To use different instance types, use `rosa create machinepool` to create additional machine pools diff --git a/provision/aws/rosa_create_cluster.sh b/provision/aws/rosa_create_cluster.sh index 2b0e9ba72..213cd7121 100755 --- a/provision/aws/rosa_create_cluster.sh +++ b/provision/aws/rosa_create_cluster.sh @@ -63,7 +63,7 @@ fi SCALING_MACHINE_POOL=$(rosa list machinepools -c "${CLUSTER_NAME}" -o json | jq -r '.[] | select(.id == "scaling") | .id') if [[ "${SCALING_MACHINE_POOL}" != "scaling" ]]; then - rosa create machinepool -c "${CLUSTER_NAME}" --instance-type "${COMPUTE_MACHINE_TYPE:-m5.2xlarge}" --max-replicas 15 --min-replicas 1 --name scaling --enable-autoscaling --autorepair + rosa create machinepool -c "${CLUSTER_NAME}" --instance-type "${COMPUTE_MACHINE_TYPE:-m6g.2xlarge}" --max-replicas 15 --min-replicas 1 --name scaling --enable-autoscaling --autorepair fi cd ${SCRIPT_DIR} diff --git a/provision/keycloak-tasks/keycloak-image-helm/templates/keycloak-nightly-imagestream.yaml b/provision/keycloak-tasks/keycloak-image-helm/templates/keycloak-nightly-imagestream.yaml index 92158d9e8..a7b2355b8 100644 --- a/provision/keycloak-tasks/keycloak-image-helm/templates/keycloak-nightly-imagestream.yaml +++ b/provision/keycloak-tasks/keycloak-image-helm/templates/keycloak-nightly-imagestream.yaml @@ -14,7 +14,7 @@ spec: name: quay.io/keycloak/keycloak:nightly generation: 2 importPolicy: - importMode: Legacy + importMode: PreserveOriginal referencePolicy: type: Source {{ end }} diff --git a/provision/minikube/keycloak/templates/keycloak.yaml b/provision/minikube/keycloak/templates/keycloak.yaml index e590d53ea..a91d0578f 100644 --- a/provision/minikube/keycloak/templates/keycloak.yaml +++ b/provision/minikube/keycloak/templates/keycloak.yaml @@ -23,6 +23,38 @@ spec: limits: {{ if .Values.cpuLimits }}cpu: "{{ .Values.cpuLimits }}"{{end}} {{ if .Values.memoryLimitsMB }}memory: "{{ .Values.memoryLimitsMB }}M"{{end}} + scheduling: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/arch + operator: In + values: + - arm64 + podAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 10 + podAffinityTerm: + labelSelector: + matchLabels: + app: keycloak + app.kubernetes.io/component: server + app.kubernetes.io/instance: keycloak + app.kubernetes.io/managed-by: keycloak-operator + topologyKey: topology.kubernetes.io/zone + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 50 + podAffinityTerm: + labelSelector: + matchLabels: + app: keycloak + app.kubernetes.io/component: server + app.kubernetes.io/instance: keycloak + app.kubernetes.io/managed-by: keycloak-operator + topologyKey: kubernetes.io/hostname db: {{ if or (eq .Values.database "aurora-postgres") (eq .Values.database "postgres") (eq .Values.database "postgres+infinispan") }} vendor: postgres diff --git a/provision/opentofu/modules/rosa/hcp/variables.tf b/provision/opentofu/modules/rosa/hcp/variables.tf index 6454a2e43..e58985e92 100644 --- a/provision/opentofu/modules/rosa/hcp/variables.tf +++ b/provision/opentofu/modules/rosa/hcp/variables.tf @@ -61,7 +61,7 @@ variable "openshift_version" { variable "instance_type" { type = string - default = "m5.2xlarge" + default = "m6g.2xlarge" nullable = false }