adding files 2
This commit is contained in:
44
k8s/fix-order-hpa-command-spec.yaml
Normal file
44
k8s/fix-order-hpa-command-spec.yaml
Normal file
@@ -0,0 +1,44 @@
|
||||
version: 0.1
|
||||
component: command
|
||||
timeoutInSeconds: 600
|
||||
shell: bash
|
||||
failImmediatelyOnError: true
|
||||
|
||||
env:
|
||||
variables:
|
||||
APP_NAMESPACE: kagent-demo
|
||||
HPA_NAME: order-service
|
||||
MIN_REPLICAS: "3"
|
||||
MAX_REPLICAS: "8"
|
||||
CPU_TARGET: "65"
|
||||
|
||||
steps:
|
||||
- type: Command
|
||||
name: Patch order HPA capacity
|
||||
command: |
|
||||
kubectl patch hpa "${HPA_NAME}" -n "${APP_NAMESPACE}" \
|
||||
--type merge \
|
||||
-p "{
|
||||
\"spec\": {
|
||||
\"minReplicas\": ${MIN_REPLICAS},
|
||||
\"maxReplicas\": ${MAX_REPLICAS},
|
||||
\"metrics\": [
|
||||
{
|
||||
\"type\": \"Resource\",
|
||||
\"resource\": {
|
||||
\"name\": \"cpu\",
|
||||
\"target\": {
|
||||
\"type\": \"Utilization\",
|
||||
\"averageUtilization\": ${CPU_TARGET}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}"
|
||||
|
||||
- type: Command
|
||||
name: Show HPA state
|
||||
command: |
|
||||
kubectl get hpa "${HPA_NAME}" -n "${APP_NAMESPACE}" -o wide
|
||||
kubectl describe hpa "${HPA_NAME}" -n "${APP_NAMESPACE}"
|
||||
Reference in New Issue
Block a user