-
Notifications
You must be signed in to change notification settings - Fork 305
/
Copy pathpetstoreorderservice-deployment-everything-enabled.yml
65 lines (65 loc) · 1.89 KB
/
petstoreorderservice-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
53
54
55
56
57
58
59
60
61
62
63
64
65
apiVersion: apps/v1
kind: Deployment
metadata:
name: aks-petstoreorderservice
spec:
replicas: 1
selector:
matchLabels:
app: aks-petstoreorderservice
template:
metadata:
labels:
app: aks-petstoreorderservice
spec:
nodeSelector:
"kubernetes.io/os": linux
agentpool: nodepool1
containers:
- name: petstoreorderservice
image: azurepetstoremecr.azurecr.io/petstoreorderservice:latest
resources:
requests:
cpu: 250m
memory: 1Gi
limits:
cpu: 500m
memory: 2Gi
ports:
- containerPort: 80
env:
- name: PETSTOREORDERSERVICE_SERVER_PORT
value: "80"
- name: spring.config.name
value: application_with_everything_enabled
- name: APPLICATIONINSIGHTS_CONNECTION_STRING
valueFrom:
secretKeyRef:
name: aisecretkey
key: secret
- name: PETSTOREPRODUCTSERVICE_URL
value: "http://aks-petstoreproductservice/"
- name: PETSTOREORDERSERVICE_EMAIL_TOPIC_CONNECTION_STRING
valueFrom:
secretKeyRef:
name: emailtopicconnstring
key: secret
- name: PETSTOREORDERSERVICE_SUBSCRIPTION_ID
valueFrom:
secretKeyRef:
name: subscriptionid
key: secret
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: aks-petstoreorderservice-hpa
spec:
# orders are in memory for the moment, need to implement a distributed order cache before inscreasing scale...
maxReplicas: 1 # define max replica count
minReplicas: 1 # define min replica count
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: aks-petstoreorderservice
targetCPUUtilizationPercentage: 90 # target CPU utilization