forked from LaconicNetwork/kompose
Merge branch 'main' into fix-1853
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
This commit is contained in:
@@ -345,6 +345,11 @@ k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/initcontainer/compose.yam
|
||||
k8s_output="$KOMPOSE_ROOT/script/test/fixtures/initcontainer/output-k8s.yaml"
|
||||
convert::expect_success_and_warning "$k8s_cmd" "$k8s_output" || exit 1
|
||||
|
||||
# Test HPA
|
||||
k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/hpa/compose.yaml convert --stdout --with-kompose-annotation=false"
|
||||
k8s_output="$KOMPOSE_ROOT/script/test/fixtures/hpa/output-k8s.yaml"
|
||||
convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1
|
||||
|
||||
# Test env var with status
|
||||
k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/envvars-with-status/compose.yaml convert --stdout --with-kompose-annotation=false"
|
||||
k8s_output="$KOMPOSE_ROOT/script/test/fixtures/envvars-with-status/output-k8s.yaml"
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
version: "3.8"
|
||||
services:
|
||||
web:
|
||||
image: nginx
|
||||
labels:
|
||||
kompose.hpa.cpu: 50
|
||||
kompose.hpa.memory: 70
|
||||
kompose.hpa.replicas.min: 1
|
||||
kompose.hpa.replicas.max: 10
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
io.kompose.service: web
|
||||
name: web
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
io.kompose.service: web
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
io.kompose.network/hpa-default: "true"
|
||||
io.kompose.service: web
|
||||
spec:
|
||||
containers:
|
||||
- image: nginx
|
||||
name: web
|
||||
restartPolicy: Always
|
||||
|
||||
---
|
||||
apiVersion: autoscaling/v2
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: web
|
||||
spec:
|
||||
maxReplicas: 10
|
||||
metrics:
|
||||
- resource:
|
||||
name: cpu
|
||||
target:
|
||||
averageUtilization: 50
|
||||
type: Utilization
|
||||
type: Resource
|
||||
- resource:
|
||||
name: memory
|
||||
target:
|
||||
averageUtilization: 70
|
||||
type: Utilization
|
||||
type: Resource
|
||||
minReplicas: 1
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: web
|
||||
|
||||
Reference in New Issue
Block a user