Created
October 7, 2025 21:31
-
-
Save verhovensky/1696fd9c052498d20dea4d5eff846f03 to your computer and use it in GitHub Desktop.
simple-deployment-3-autoscaling.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: my-web-deployment-autoscaling | |
| labels: | |
| app: my-k8s-application | |
| env: prod | |
| owner: StepanVerhovensky | |
| spec: | |
| replicas: 2 | |
| selector: | |
| matchLabels: | |
| project: mossad | |
| template: | |
| metadata: | |
| labels: | |
| project: mossad | |
| spec: | |
| containers: | |
| - name: mossad-web | |
| image: verhovenskybh/phpexample1:version2 | |
| ports: | |
| - containerPort: 80 | |
| --- | |
| apiVersion: autoscaling/v2 | |
| kind: HorizontalPodAutoscaler | |
| metadata: | |
| name: my-autoscaler | |
| spec: | |
| scaleTargetRef: | |
| apiVersion: apps/v2 | |
| kind: Deployment | |
| name: my-web-deployment-autoscaling | |
| minReplicas: 2 | |
| maxReplicas: 6 | |
| metrics: | |
| - type: Resource | |
| resource: | |
| name: cpu | |
| target: | |
| type: Utilization | |
| averageUtilization: 70 | |
| - type: Resource | |
| resource: | |
| name: memory | |
| target: | |
| type: Utilization | |
| averageUtilization: 80 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment