Scale unique answer tracking

This commit is contained in:
hz
2026-07-13 02:11:54 -05:00
parent 700da4e415
commit f2c59388eb
23 changed files with 1064 additions and 131 deletions
+27 -1
View File
@@ -6,6 +6,11 @@ metadata:
app: step3-questions
spec:
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
selector:
matchLabels:
app: step3-questions
@@ -13,6 +18,10 @@ spec:
metadata:
labels:
app: step3-questions
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: "/metrics"
prometheus.io/port: "5008"
spec:
containers:
- name: step3-questions
@@ -20,9 +29,26 @@ spec:
imagePullPolicy: IfNotPresent
ports:
- containerPort: 5008
resources:
requests:
cpu: 250m
memory: 256Mi
limits:
cpu: "1"
memory: 512Mi
readinessProbe:
httpGet:
path: /healthz
path: /readyz
port: 5008
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
livenessProbe:
httpGet:
path: /healthz
port: 5008
initialDelaySeconds: 15
periodSeconds: 20
timeoutSeconds: 3
failureThreshold: 3
+35
View File
@@ -0,0 +1,35 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: step3-questions
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: step3-questions
minReplicas: 2
maxReplicas: 10
behavior:
scaleUp:
stabilizationWindowSeconds: 0
policies:
- type: Percent
value: 100
periodSeconds: 60
- type: Pods
value: 2
periodSeconds: 60
selectPolicy: Max
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 25
periodSeconds: 60
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 60
+7
View File
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml
- hpa.yaml
- pdb.yaml
+9
View File
@@ -0,0 +1,9 @@
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: step3-questions
spec:
minAvailable: 1
selector:
matchLabels:
app: step3-questions