queueName: app<\/strong> <\/li>\n<\/ul>\n\n\n\nThis is the most crucial key. It enables HPA to monitor the specified queue in RabbitMQ. By using this queue name, HPA can manage to scale up and down as needed. <\/p>\n","protected":false},"excerpt":{"rendered":"
We’ve been encountering resource shortages in one of our environments, which has led to delays in processing. This issue arises from sudden spikes in load on our RabbitMQ queues, necessitating an increase in workers to handle the queue consumption. Our project is centered around Microservices-based architecture and leverages various services, including Celery, RabbitMQ, Redis, MinIO, MongoDB, and Postgres. As the number of task elements queued in RabbitMQ grows, a single worker can\u2019t handle the increased load, which also impacts the resource consumption of individual workers. To address these issues, we use Horizontal Pod Autoscaling (HPA) and Vertical Pod Autoscaling (VPA). Previously, this process required significant manual intervention. Developers had to continuously monitor resource usage and manually scale up workers whenever the load increased. This approach was time-consuming and inefficient, diverting valuable developer time and attention from other critical tasks. To address these challenges, we turned to Kubernetes’ autoscaling capabilities. By implementing both Vertical Pod Autoscaling (VPA) and Horizontal Pod Autoscaling (HPA), we aimed to create a more resilient and responsive system. VPA adjusts the resource limits of our pods based on actual usage, ensuring that each pod has the necessary CPU and memory to perform efficiently. Meanwhile, HPA dynamically scales the number of pod replicas based on metrics such as CPU utilization or custom metrics like RabbitMQ queue length. This dual approach allowed us to handle varying loads more effectively, reduce manual intervention, and improve overall system performance. Implementing Vertical Pod Autoscaling (VPA) Vertical Pod Autoscaling (VPA) involves monitoring the resource usage of a pod, specifically CPU and memory. To implement VPA, we utilize Kubernetes’ native toolset, which includes the installation of Custom Resource Definitions (CRDs) and several deployments. These components work together to monitor resource usage and automatically adjust the resource limits of your pods, ensuring they have the appropriate amount of CPU and memory based on actual demand. This helps maintain optimal performance and resource efficiency within your Kubernetes environment. Installation of CRDs: https:\/\/github.com\/kubernetes\/autoscaler\/tree\/master\/vertical-pod-autoscaler The above link will help you install the perquisites of Vertical Pod Autoscaling. Once you have installed the CRDs, you will now need three major deployments necessary for enabling vertical pod monitoring and autoscaling. The three deployments are: Recommender – it monitors the current and past resource consumption and, based on it, provides recommended values for the containers’ cpu and memory requests. Updater – it checks which of the managed pods have correct resources set and, if not, kills them so that they can be recreated by their controllers with the updated requests. Admission Plugin – it sets the correct resource requests on new pods (either just created or recreated by their controller due to Updater’s activity). For installing these deployments, you can install the project that is mentioned in the above link, or you can use these YAML files. VPA Admission Controller Yaml: apiVersion: apps\/v1 kind: Deployment metadata: name: vpa-admission-controller namespace: kube-system labels: app: vpa-admission-controller spec: replicas: 1 selector: matchLabels: app: vpa-admission-controller strategy: type: RollingUpdate rollingUpdate: maxSurge: 25% maxUnavailable: 25% template: metadata: labels: app: vpa-admission-controller spec: containers: – name: admission-controller image: registry.k8s.io\/autoscaling\/vpa-admission-controller:1.1.2 imagePullPolicy: Always ports: – containerPort: 8000 protocol: TCP – containerPort: 8944 name: prometheus protocol: TCP resources: limits: cpu: 200m memory: 500Mi requests: cpu: 50m memory: 200Mi env: – name: NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace volumeMounts: – mountPath: \/etc\/tls-certs name: tls-certs readOnly: true securityContext: runAsNonRoot: true runAsUser: 65534 serviceAccountName: vpa-admission-controller terminationGracePeriodSeconds: 30 dnsPolicy: ClusterFirst restartPolicy: Always volumes: – name: tls-certs secret: secretName: vpa-tls-certs VPA Recommender apiVersion: apps\/v1 kind: Deployment metadata: name: vpa-recommender namespace: kube-system labels: app: vpa-recommender spec: replicas: 1 selector: matchLabels: app: vpa-recommender strategy: type: RollingUpdate rollingUpdate: maxSurge: 25% maxUnavailable: 25% template: metadata: labels: app: vpa-recommender spec: containers: – name: recommender image: registry.k8s.io\/autoscaling\/vpa-recommender:1.1.2 imagePullPolicy: Always ports: – containerPort: 8942 name: prometheus protocol: TCP resources: limits: cpu: 200m memory: 1000Mi requests: cpu: 50m memory: 500Mi terminationMessagePath: \/dev\/termination-log terminationMessagePolicy: File securityContext: runAsNonRoot: true runAsUser: 65534 serviceAccountName: vpa-recommender terminationGracePeriodSeconds: 30 dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler VPA Updater apiVersion: apps\/v1 kind: Deployment metadata: name: vpa-updater namespace: kube-system labels: app: vpa-updater spec: replicas: 1 selector: matchLabels: app: vpa-updater strategy: type: RollingUpdate rollingUpdate: maxSurge: 25% maxUnavailable: 25% template: metadata: labels: app: vpa-updater spec: containers: – name: updater image: registry.k8s.io\/autoscaling\/vpa-updater:1.1.2 imagePullPolicy: Always ports: – containerPort: 8943 name: prometheus protocol: TCP resources: limits: cpu: 200m memory: 1000Mi requests: cpu: 50m memory: 500Mi env: – name: NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace terminationMessagePath: \/dev\/termination-log terminationMessagePolicy: File securityContext: runAsNonRoot: true runAsUser: 65534 serviceAccountName: vpa-updater terminationGracePeriodSeconds: 30 dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler Once you\u2019ll add these deployments, you will need a secret called vpa-tls-cert.yaml file that is being used in the secrets of one of the deployment. Vpa-tls-cert.yaml apiVersion: v1 data: caCert.pem: >- LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURNRENDQWhpZ0F3SUJBZ0lVWmQvQzNURmNrbXM5eXpRMEowK2E3VVRkK0ZFd0RRWUpLb1pJaHZjTkFRRUwKQlFBd0dURVhNQlVHQTFVRUF3d09kbkJoWDNkbFltaHZiMnRmWTJFd0lCY05NalF3TlRJME1USXdPVFEwV2hnUApNakk1T0RBek1Ea3hNakE1TkRSYU1Ca3hGekFWQmdOVkJBTU1Eblp3WVY5M1pXSm9iMjlyWDJOaE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQXBaQjRVaHdRTXBIY25NYURvbkdLVjlnOGJrSGUKSkNVSzc0T2drTVNiL01HNUZ1T1RLRDhMaituUnZ1S3F4Sm1yaXJkTzBoRGxyR1FzSXMrM2RNaUZYS2YrYldBbwplcXNIY1o4L2hSZ1Q3SU1yNzUvbG0weTV5RGIvcHhaMS92WkNhUldoUUNEVk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MGoKYmcyeVZUUVFPSnNVV25RZjBZbUpKaHRMMm43TnZPd213aUw0alVTN3hpWWhEenpDMGpnN2dvOXdJeEloZkdyRgpVUEdWT2RtL3pxY3VTeG5vMXgxZFZRWkxpL1dDYThmd3l5dENCQmhsdnNmL1c5a09jd0NPNTNpL2NuR0JqWGRDCk1OeGtaV3ZhUkpFeW1BTXB2a3VER1FLQmdRQ2NmSWZ3MnIvOWViY3JVL2dCWXVwT0FrV0paOVA0Z2xacytDbEIKSWVabE9LZ3dwVTV1cDd1MFUrZ0FEUUpsTmsxQXBBbGp5L1JGNlg5U2dza3pTRExQSWdnL3d3S2xJaVlLM1NHRApDWVRUd216KzR4WnRUc2dpQk91UU9tQ0lReExKS0ZOc3lDZUkyZmJwcWoyZmppcFZ2RFNaakpIcmcvUUJDdEtvCnhHc0k1UUtCZ0J3UXB4T1RpNlc4OFZGZGYyRDBZTzJGYUNqV3E4Kzk1SzdUK3Q1YU9CTlhsMzJwd3JzNVI3aGMKUnFEVklZTG9MNWZHVEgyZDcvdmNXS1dwMjFCTDNvZjZldlNXNEFQNnJ0NlRUTFdBYkFjbmRTMlNlOWkrMTVlUgpTQlZibEU3VFA5ajg5UEdDc1F5STNZeWJrMWN6NERrTjJ0MHplU25WVG5aeHR3ZWdWNVVxCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg== kind: Secret metadata: creationTimestamp: ‘2024-05-24T12:09:44Z’ managedFields: – apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:caCert.pem: {} f:caKey.pem: {} f:serverCert.pem: {} f:serverKey.pem: {} f:type: {} manager: kubectl-create operation: Update time: ‘2024-05-24T12:09:44Z’ name: vpa-tls-certs namespace: kube-system resourceVersion: ‘60147243’ uid: 51ac2807-1af8-4822-b828-0f9876f5c6a6 Now, the installation part is complete here. The thing you will need now is VPA YAML for your deployment. Example-vpa.yaml apiVersion: autoscaling.k8s.io\/v1 kind: VerticalPodAutoscaler metadata: name: pod-name-vpa namespace: default spec: resourcePolicy: containerPolicies: – containerName: ‘*’ controlledResources: – cpu – memory minAllowed: cpu: 50m memory: 100Mi maxAllowed: cpu: 2000m memory: 4096Mi targetRef: apiVersion: “apps\/v1” kind: Deployment name: pod-name updatePolicy: updateMode: “Off” In the above example, we have set the minimum allowed and maximum allowed resource usage to the pod. The VPA will now monitor the pod with this given minimum allowed resources, now there is this key call updatePolicy that consists of different update modes. Modes: The preferred way to monitor usage would be in the \u201coff\u201d mode, which keeps track of the resource usage and doesn\u2019t automatically change the resources. In the above Image, the recommendations are updated by the VPA. As you can see in the example vpa yaml file, we set the minimum allowed resources, and the recommendations are updated based on that, the memory is in Bytes value. As soon as you\u2019re convinced with the<\/p>\n","protected":false},"author":4,"featured_media":15710,"comment_status":"closed","ping_status":"open","sticky":false,"template":"template-default.php","format":"standard","meta":{"_acf_changed":false,"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"on","ocean_gallery_id":[],"footnotes":""},"categories":[5,890],"tags":[1707,1708],"class_list":["post-15705","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","category-research","tag-horizontal-pod-autoscaling","tag-microservices-based-architecture","entry","has-media"],"acf":{"upload_file":""},"yoast_head":"\n
Developer's Insight: Navigating Vertical and Horizontal Pod Autoscaling | 47Billion<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n \n \n\t \n\t \n\t \n