Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions bundle/tests/scorecard/kuttl/probe/00-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,26 @@ metadata:
status:
readyReplicas: 1
---
apiVersion: v1
kind: Pod
spec:
containers:
- startupProbe:
failureThreshold: 10
periodSeconds: 5
readinessProbe:
initialDelaySeconds: 1
livenessProbe:
initialDelaySeconds: 4
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/instance: probes-rc
name: probes-rc
spec:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment resource and the .spec fields are duplicated in all the modified files.

template:
containers:
spec:
selector:
matchLabels:
app.kubernetes.io/instance: probes-rc
template:
spec:
containers:
- readinessProbe:
initialDelaySeconds: 1
livenessProbe:
initialDelaySeconds: 4
startupProbe:
failureThreshold: 10
periodSeconds: 5
status:
readyReplicas: 1
32 changes: 17 additions & 15 deletions bundle/tests/scorecard/kuttl/probe/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: probes-rc
spec:
template:
containers:
spec:
selector:
matchLabels:
app.kubernetes.io/instance: probes-rc
template:
spec:
containers:
- readinessProbe:
initialDelaySeconds: 3
livenessProbe:
initialDelaySeconds: 6
startupProbe:
failureThreshold: 20
periodSeconds: 10
status:
readyReplicas: 1
---
apiVersion: v1
kind: Pod
spec:
containers:
- readinessProbe:
initialDelaySeconds: 3
livenessProbe:
initialDelaySeconds: 6
startupProbe:
failureThreshold: 20
periodSeconds: 10
metadata:
labels:
app.kubernetes.io/instance: probes-rc
35 changes: 22 additions & 13 deletions bundle/tests/scorecard/kuttl/probe/02-errors.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
apiVersion: v1
kind: Pod
spec:
containers:
- readinessProbe:
initialDelaySeconds: 3
livenessProbe:
initialDelaySeconds: 6
startupProbe:
failureThreshold: 20
periodSeconds: 10
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/instance: probes-rc
name: probes-rc
spec:
template:
containers:
spec:
selector:
matchLabels:
app.kubernetes.io/instance: probes-rc
template:
spec:
containers:
- readinessProbe:
initialDelaySeconds: 3
livenessProbe:
initialDelaySeconds: 6
startupProbe:
failureThreshold: 20
periodSeconds: 10
status:
readyReplicas: 1
35 changes: 35 additions & 0 deletions bundle/tests/scorecard/minikube-kuttl/annotations/00-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: rc-deployment-annotations
annotations:
bar2: foo2
foo1: bar1
conflict: deployment
spec:
template:
metadata:
annotations:
bar2: foo2
foo1: bar1
conflict: deployment
status:
readyReplicas: 1
---
apiVersion: v1
kind: Service
metadata:
name: rc-deployment-annotations
annotations:
foo1: bar1
conflict: component
---
apiVersion: v1
kind: Pod
metadata:
annotations:
bar2: foo2
foo1: bar1
conflict: deployment
labels:
app.kubernetes.io/instance: rc-deployment-annotations
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Service
metadata:
name: rc-deployment-annotations
annotations:
bar2: foo2
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: rc.app.stacks/v1beta2
kind: RuntimeComponent
metadata:
name: rc-deployment-annotations
annotations:
foo1: bar1
conflict: component
spec:
# Add fields here
applicationImage: 'k8s.gcr.io/pause:2.0'
replicas: 1
deployment:
annotations:
bar2: foo2
conflict: deployment

35 changes: 35 additions & 0 deletions bundle/tests/scorecard/minikube-kuttl/annotations/01-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: rc-deployment-annotations
annotations:
bar2: foo2
foo1: bar1
conflict: statefulSet
spec:
template:
metadata:
annotations:
bar2: foo2
foo1: bar1
conflict: statefulSet
status:
readyReplicas: 1
---
apiVersion: v1
kind: Service
metadata:
name: rc-deployment-annotations
annotations:
foo1: bar1
---
apiVersion: v1
kind: Pod
metadata:
annotations:
bar2: foo2
foo1: bar1
conflict: statefulSet
labels:
app.kubernetes.io/instance: rc-deployment-annotations

12 changes: 12 additions & 0 deletions bundle/tests/scorecard/minikube-kuttl/annotations/01-errors.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: rc-deployment-annotations
annotations:
bar2: foo2
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: rc-deployment-annotations

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: rc.app.stacks/v1beta2
kind: RuntimeComponent
metadata:
name: rc-deployment-annotations
annotations:
foo1: bar1
spec:
# Add fields here
applicationImage: 'k8s.gcr.io/pause:2.0'
replicas: 1
statefulSet:
annotations:
bar2: foo2
conflict: statefulSet
10 changes: 10 additions & 0 deletions bundle/tests/scorecard/minikube-kuttl/auto1/00-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 60
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: autoscaling1-rc
status:
readyReplicas: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: rc.app.stacks/v1beta2
kind: RuntimeComponent
metadata:
name: autoscaling1-rc
spec:
# Add fields here
applicationImage: 'k8s.gcr.io/pause:2.0'
replicas: 1
12 changes: 12 additions & 0 deletions bundle/tests/scorecard/minikube-kuttl/auto1/01-add-autoscale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rc.app.stacks/v1beta2
kind: RuntimeComponent
metadata:
name: autoscaling1-rc
spec:
resourceConstraints:
requests:
cpu: "0.2"
autoscaling:
maxReplicas: 5
targetCPUUtilizationPercentage: 50

19 changes: 19 additions & 0 deletions bundle/tests/scorecard/minikube-kuttl/auto1/01-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 60
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: autoscaling1-rc
status:
readyReplicas: 1
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: autoscaling1-rc
spec:
maxReplicas: 5
minReplicas: 1
targetCPUUtilizationPercentage: 50
19 changes: 19 additions & 0 deletions bundle/tests/scorecard/minikube-kuttl/auto1/02-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 60
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: autoscaling1-rc
status:
readyReplicas: 2
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: autoscaling1-rc
spec:
maxReplicas: 3
minReplicas: 2
targetCPUUtilizationPercentage: 30
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: rc.app.stacks/v1beta2
kind: RuntimeComponent
metadata:
name: autoscaling1-rc
spec:
autoscaling:
maxReplicas: 3
minReplicas: 2
targetCPUUtilizationPercentage: 30

19 changes: 19 additions & 0 deletions bundle/tests/scorecard/minikube-kuttl/auto1/03-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 60
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: autoscaling1-rc
status:
readyReplicas: 2
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: autoscaling1-rc
spec:
maxReplicas: 3
minReplicas: 2
targetCPUUtilizationPercentage: 30
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: rc.app.stacks/v1beta2
kind: RuntimeComponent
metadata:
name: autoscaling1-rc
spec:
autoscaling:
maxReplicas: 1
minReplicas: 6
targetCPUUtilizationPercentage: 10

19 changes: 19 additions & 0 deletions bundle/tests/scorecard/minikube-kuttl/auto1/04-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 60
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: autoscaling1-rc
status:
readyReplicas: 2
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: autoscaling1-rc
spec:
maxReplicas: 3
minReplicas: 2
targetCPUUtilizationPercentage: 30
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Check that when minReplicas is set to less that one that the update is rejected
# There should be no change to the existing autoscale resource
apiVersion: rc.app.stacks/v1beta2
kind: RuntimeComponent
metadata:
name: autoscaling1-rc
spec:
autoscaling:
maxReplicas: 4
minReplicas: 0
targetCPUUtilizationPercentage: 20

10 changes: 10 additions & 0 deletions bundle/tests/scorecard/minikube-kuttl/auto2/00-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 60
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: scale2-runtime-component
status:
readyReplicas: 1
Loading