-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
173 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
webhosting-operator/config/policy/controlplane/tests/kube-apiserver-scale/kyverno-test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: kube-apiserver-scale | ||
policies: | ||
- ../../kube-apiserver-scale.yaml | ||
resources: | ||
# spec.replicas=1 -> expect spec.replicas=4 | ||
- scale.yaml | ||
variables: variables.yaml | ||
results: | ||
- policy: kube-apiserver-scale | ||
rule: replicas | ||
resource: kube-apiserver | ||
namespace: shoot--fb28d21f90--sharding | ||
kind: Scale | ||
result: pass | ||
patchedResource: scale_expected.yaml |
7 changes: 7 additions & 0 deletions
7
webhosting-operator/config/policy/controlplane/tests/kube-apiserver-scale/scale.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kind: Scale | ||
apiVersion: autoscaling/v1 | ||
metadata: | ||
name: kube-apiserver | ||
namespace: shoot--fb28d21f90--sharding | ||
spec: | ||
replicas: 1 |
7 changes: 7 additions & 0 deletions
7
...osting-operator/config/policy/controlplane/tests/kube-apiserver-scale/scale_expected.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kind: Scale | ||
apiVersion: autoscaling/v1 | ||
metadata: | ||
name: kube-apiserver | ||
namespace: shoot--fb28d21f90--sharding | ||
spec: | ||
replicas: 4 |
11 changes: 11 additions & 0 deletions
11
webhosting-operator/config/policy/controlplane/tests/kube-apiserver-scale/variables.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
subresources: | ||
- subresource: | ||
name: "deployments/scale" | ||
kind: "Scale" | ||
group: "autoscaling" | ||
version: "v1" | ||
parentResource: | ||
name: "deployments" | ||
kind: "Deployment" | ||
group: "apps" | ||
version: "v1" |
18 changes: 18 additions & 0 deletions
18
...osting-operator/config/policy/controlplane/tests/kube-apiserver/kube-apiserver-awake.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: kubernetes | ||
role: apiserver | ||
name: kube-apiserver-awake | ||
namespace: shoot--fb28d21f90--sharding | ||
spec: | ||
replicas: 1 | ||
template: | ||
spec: | ||
containers: | ||
- name: kube-apiserver | ||
resources: | ||
requests: | ||
cpu: 800m | ||
memory: 800Mi |
18 changes: 18 additions & 0 deletions
18
...erator/config/policy/controlplane/tests/kube-apiserver/kube-apiserver-awake_expected.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: kubernetes | ||
role: apiserver | ||
name: kube-apiserver-awake | ||
namespace: shoot--fb28d21f90--sharding | ||
spec: | ||
replicas: 4 | ||
template: | ||
spec: | ||
containers: | ||
- name: kube-apiserver | ||
resources: | ||
requests: | ||
cpu: 800m | ||
memory: 800Mi |
18 changes: 18 additions & 0 deletions
18
...g-operator/config/policy/controlplane/tests/kube-apiserver/kube-apiserver-hibernated.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: kubernetes | ||
role: apiserver | ||
name: kube-apiserver-hibernated | ||
namespace: shoot--fb28d21f90--sharding | ||
spec: | ||
replicas: 0 | ||
template: | ||
spec: | ||
containers: | ||
- name: kube-apiserver | ||
resources: | ||
requests: | ||
cpu: 800m | ||
memory: 800Mi |
17 changes: 17 additions & 0 deletions
17
webhosting-operator/config/policy/controlplane/tests/kube-apiserver/kube-apiserver-null.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: kubernetes | ||
role: apiserver | ||
name: kube-apiserver-null | ||
namespace: shoot--fb28d21f90--sharding | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: kube-apiserver | ||
resources: | ||
requests: | ||
cpu: 800m | ||
memory: 800Mi |
18 changes: 18 additions & 0 deletions
18
...perator/config/policy/controlplane/tests/kube-apiserver/kube-apiserver-null_expected.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: kubernetes | ||
role: apiserver | ||
name: kube-apiserver-null | ||
namespace: shoot--fb28d21f90--sharding | ||
spec: | ||
replicas: 4 | ||
template: | ||
spec: | ||
containers: | ||
- name: kube-apiserver | ||
resources: | ||
requests: | ||
cpu: 800m | ||
memory: 800Mi |
31 changes: 31 additions & 0 deletions
31
webhosting-operator/config/policy/controlplane/tests/kube-apiserver/kyverno-test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: kube-apiserver | ||
policies: | ||
- ../../kube-apiserver.yaml | ||
resources: | ||
# spec.replicas=1 -> expect spec.replicas=4 | ||
- kube-apiserver-awake.yaml | ||
# spec.replicas=null -> expect spec.replicas=4 | ||
- kube-apiserver-null.yaml | ||
# spec.replicas=0 -> expect spec.replicas=0 | ||
- kube-apiserver-hibernated.yaml | ||
results: | ||
- policy: kube-apiserver | ||
rule: replicas | ||
resource: kube-apiserver-awake | ||
namespace: shoot--fb28d21f90--sharding | ||
kind: Deployment | ||
result: pass | ||
patchedResource: kube-apiserver-awake_expected.yaml | ||
- policy: kube-apiserver | ||
rule: replicas | ||
resource: kube-apiserver-null | ||
namespace: shoot--fb28d21f90--sharding | ||
kind: Deployment | ||
result: pass | ||
patchedResource: kube-apiserver-null_expected.yaml | ||
- policy: kube-apiserver | ||
rule: replicas | ||
resource: kube-apiserver-hibernated | ||
namespace: shoot--fb28d21f90--sharding | ||
kind: Deployment | ||
result: skip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters