Skip to content

Instantly share code, notes, and snippets.

@simonswine
Created April 21, 2016 16:04
Show Gist options
  • Select an option

  • Save simonswine/967c659de4a4ea8af7ecf58794f1d2e5 to your computer and use it in GitHub Desktop.

Select an option

Save simonswine/967c659de4a4ea8af7ecf58794f1d2e5 to your computer and use it in GitHub Desktop.
Hello world HPA for kubernetes
---
kind: Service
apiVersion: v1
metadata:
name: hello-world-hpa
labels:
app: hello-world
spec:
type: NodePort
ports:
- name: http
port: 80
nodePort: 32000
selector:
app: hello-world
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: hello-world-hpa
spec:
replicas: 2
template:
metadata:
labels:
app: hello-world
spec:
containers:
- name: hello-world
image: tutum/apache-php:latest
ports:
- containerPort: 80
resources:
requests:
memory: "16Mi"
cpu: "50m"
limits:
memory: "32Mi"
cpu: "100m"
---
apiVersion: extensions/v1beta1
kind: HorizontalPodAutoscaler
metadata:
name: hello-world-hpa
namespace: default
spec:
scaleRef:
kind: Deployment
name: hello-world-hpa
subresource: scale
minReplicas: 2
maxReplicas: 10
cpuUtilization:
targetPercentage: 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment