Anda dapat menskalakan sebagian besar layanan yang berjalan di Kubernetes dari
command line atau dalam penggantian konfigurasi. Anda dapat menetapkan parameter
penskalaan untuk layanan runtime hybrid Apigee di
file overrides.yaml.
DaemonSet mengelola replika pod di semua node, sehingga ia diskalakan saat Anda menskalakan pod itu sendiri.
MART
Apigee Connect
Watcher
ApigeeOrganization (CRD)
Untuk menskalakan melalui konfigurasi, tingkatkan nilai properti konfigurasi replicaCountMin Deployment untuk stanza mart, watcher, dan/atau connectAgent.
Contoh:
Deployment ini menggunakan Horizontal Pod Autoscaler untuk penskalaan otomatis. Tetapkan properti targetCPUUtilizationPercentage objek Deployment ke nilai minimum untuk penskalaan ke atas; jika nilai ini terlampaui, Kubernetes akan menambahkan pod hingga nilai replicaCountMax.
Untuk menskalakan melalui konfigurasi, tingkatkan nilai properti replicaCountMin untuk stanza udca, synchronizer, dan/atau runtime dalam file penggantian. Contoh:
Catatan: Perubahan ini berlaku untuk SEMUA lingkungan dalam file penggantian.
Jika Anda ingin menyesuaikan penskalaan untuk setiap lingkungan, lihat Konfigurasi lanjutan di bawah.
Deployment ini menggunakan Horizontal Pod Autoscaler untuk penskalaan otomatis. Tetapkan properti targetCPUUtilizationPercentage objek Deployment ke nilai minimum untuk penskalaan ke atas; jika nilai ini terlampaui, Kubernetes akan menambahkan pod hingga nilai replicaCountMax.
Dalam beberapa skenario, Anda mungkin perlu menggunakan opsi penskalaan lanjutan. Contoh skenario mencakup:
Menetapkan opsi penskalaan yang berbeda untuk setiap lingkungan. Misalnya, dengan env1 memiliki
minReplica 5 dan env2 memiliki minReplica 2.
Menetapkan opsi penskalaan yang berbeda untuk setiap komponen dalam lingkungan. Misalnya,
dengan komponen udca memiliki maxReplica 5 dan
komponen synchronizer memiliki maxReplica 2.
Contoh berikut menunjukkan cara menggunakan perintah kubernetes patch untuk mengubah properti maxReplicas untuk komponen runtime:
Buat variabel lingkungan untuk digunakan dengan perintah:
export ENV=my-environment-name
export NAMESPACE=apigee #the namespace where apigee is deployed
export COMPONENT=runtime #can be udca or synchronizer
export MAX_REPLICAS=2
export MIN_REPLICAS=1
Terapkan patch. Perhatikan bahwa contoh ini mengasumsikan bahwa kubectl ada di PATH Anda:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-05 UTC."],[[["\u003cp\u003eThe current documentation version (1.3) is end-of-life, and users should upgrade to a newer version for continued support.\u003c/p\u003e\n"],["\u003cp\u003eScaling for Apigee hybrid runtime services can be managed through the \u003ccode\u003eoverrides.yaml\u003c/code\u003e file or via command-line.\u003c/p\u003e\n"],["\u003cp\u003eDifferent services within Apigee hybrid have unique scaling mechanisms, such as Horizontal Pod Autoscaling for Ingress/LoadBalancer and DaemonSets for Logger.\u003c/p\u003e\n"],["\u003cp\u003eFor advanced scenarios like setting different scaling options per environment or component, users can utilize the \u003ccode\u003ekubernetes patch\u003c/code\u003e command with specific environment variables.\u003c/p\u003e\n"],["\u003cp\u003eThe Cassandra service scaling is documented separately in a dedicated section that can be found using the link provided.\u003c/p\u003e\n"]]],[],null,["# Scale and autoscale runtime services\n\n| You are currently viewing version 1.3 of the Apigee hybrid documentation. **This version is end of life.** You should upgrade to a newer version. For more information, see [Supported versions](/apigee/docs/hybrid/supported-platforms#supported-versions).\n\nYou can scale most services running in Kubernetes from the\ncommand line or in a configuration override. You can set scaling\nparameters for Apigee hybrid runtime services in the\n[`overrides.yaml` file](/apigee/docs/hybrid/v1.3/customize-services).\n\nAdvanced configurations\n-----------------------\n\n\nIn some scenarios, you may need to use advanced scaling options. Example scenarios include:\n\n- Setting different scaling options for each environment. For example, where env1 has a `minReplica` of 5 and env2 has a `minReplica` of 2.\n- Setting different scaling options for each component within an environment. For example, where the `udca` component has a `maxReplica` of 5 and the `synchronizer` component has a `maxReplica` of 2.\n\n\nThe following example shows how to use the `kubernetes patch` command to change\nthe `maxReplicas` property for the `runtime` component:\n\n\n1. Create environment variables to use with the command: \n\n ```\n export ENV=my-environment-name\n export NAMESPACE=apigee #the namespace where apigee is deployed\n export COMPONENT=runtime #can be udca or synchronizer\n export MAX_REPLICAS=2\n export MIN_REPLICAS=1\n ```\n2. Apply the patch. Note that this example assumes that `kubectl` is in your `PATH`: \n\n ```\n kubectl patch apigeeenvironment -n $NAMESPACE \\\n $(kubectl get apigeeenvironments -n $NAMESPACE -o jsonpath='{.items[?(@.spec.name == \"'$ENV'\" )]..metadata.name}') \\\n --patch \"$(echo -e \"spec:\\n components:\\n $COMPONENT:\\n autoScaler:\\n maxReplicas: $MAX_REPLICAS\\n minReplicas: $MIN_REPLICAS\")\" \\\n --type merge\n ```\n3. Verify the change: \n\n ```\n kubectl get hpa -n $NAMESPACE\n ```"]]