add HPA to Kubernetes deployment
This commit is contained in:
		@@ -6,7 +6,6 @@ metadata:
 | 
				
			|||||||
  annotations:
 | 
					  annotations:
 | 
				
			||||||
    reloader.stakater.com/auto: "true"
 | 
					    reloader.stakater.com/auto: "true"
 | 
				
			||||||
spec:
 | 
					spec:
 | 
				
			||||||
  replicas: 5
 | 
					 | 
				
			||||||
  selector:
 | 
					  selector:
 | 
				
			||||||
    matchLabels:
 | 
					    matchLabels:
 | 
				
			||||||
      app: kubernaut
 | 
					      app: kubernaut
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										19
									
								
								kustomize/app/hpa.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								kustomize/app/hpa.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
				
			|||||||
 | 
					---
 | 
				
			||||||
 | 
					apiVersion: autoscaling/v2
 | 
				
			||||||
 | 
					kind: HorizontalPodAutoscaler
 | 
				
			||||||
 | 
					metadata:
 | 
				
			||||||
 | 
					  name: kubernaut
 | 
				
			||||||
 | 
					spec:
 | 
				
			||||||
 | 
					  scaleTargetRef:
 | 
				
			||||||
 | 
					    apiVersion: apps/v1
 | 
				
			||||||
 | 
					    kind: Deployment
 | 
				
			||||||
 | 
					    name: kubernaut
 | 
				
			||||||
 | 
					  minReplicas: 1
 | 
				
			||||||
 | 
					  maxReplicas: 10
 | 
				
			||||||
 | 
					  metrics:
 | 
				
			||||||
 | 
					  - type: Resource
 | 
				
			||||||
 | 
					    resource:
 | 
				
			||||||
 | 
					      name: cpu
 | 
				
			||||||
 | 
					      target:
 | 
				
			||||||
 | 
					        type: Utilization
 | 
				
			||||||
 | 
					        averageUtilization: 50
 | 
				
			||||||
@@ -6,4 +6,5 @@ resources:
 | 
				
			|||||||
  - secret.yaml
 | 
					  - secret.yaml
 | 
				
			||||||
  - configmap.yaml
 | 
					  - configmap.yaml
 | 
				
			||||||
  - deployment.yaml
 | 
					  - deployment.yaml
 | 
				
			||||||
 | 
					  - hpa.yaml
 | 
				
			||||||
  - services.yaml
 | 
					  - services.yaml
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user