-
Notifications
You must be signed in to change notification settings - Fork 305
/
Copy pathpetstorepetservice-deployment-everything-enabled.yml
52 lines (52 loc) · 1.31 KB
/
petstorepetservice-deployment-everything-enabled.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
apiVersion: apps/v1
kind: Deployment
metadata:
name: aks-petstorepetservice
spec:
replicas: 1
selector:
matchLabels:
app: aks-petstorepetservice
template:
metadata:
labels:
app: aks-petstorepetservice
spec:
nodeSelector:
"kubernetes.io/os": linux
agentpool: nodepool1
containers:
- name: petstoreservice
image: azurepetstoremecr.azurecr.io/petstorepetservice:latest
resources:
requests:
cpu: 250m
memory: 1Gi
limits:
cpu: 500m
memory: 2Gi
ports:
- containerPort: 80
env:
- name: PETSTOREPETSERVICE_SERVER_PORT
value: "80"
- name: spring.config.name
value: application_with_everything_enabled
- name: APPLICATIONINSIGHTS_CONNECTION_STRING
valueFrom:
secretKeyRef:
name: aisecretkey
key: secret
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: aks-petstorepetservice-hpa
spec:
maxReplicas: 4 # define max replica count
minReplicas: 1 # define min replica count
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: aks-petstorepetservice
targetCPUUtilizationPercentage: 80 # target CPU utilization