In the following exam, you’re gonna implement a logical autoscaler software that pulls…
- User
In the following exam, you’re gonna implement a logical autoscaler software that pulls scaling configurations and scales relevant K8S deployments replicas.
The autoscaler can be written in any language (preferred Python) The autoscaler will pull the scaling configurations with REST API: url: http://wscdevopsexam.eastus.azurecontainer.io path: /autoscale method: GET The scaling configuration is a list of deployments and the target replicas for each deployment. Based on the configurations, the autoscaler will scale the deployment’s replicas All the deployments are in “wsc” namespace Bonus: Create a Dockerfile to pack your software Bonus: Create a README.md file
- Assistant
Here's a simple implementation of the autoscaling script in Python using the Kubernetes library. This script fetches the scaling configurations via the specified API URL and updates the replicas for the deployments within the "wsc" namespace accordingly.
autoscaler.py:
python
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.