forked from OT-CONTAINER-KIT/redis-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add replication to chainsaw setup (OT-CONTAINER-KIT#730)
Signed-off-by: Shubham Gupta <[email protected]> Signed-off-by: Matt Robinson <[email protected]>
- Loading branch information
1 parent
0c4fd0a
commit f1d7517
Showing
5 changed files
with
198 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
tests/e2e-chainsaw/v1beta2/setup/redis-replication/chainsaw-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,18 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json | ||
|
||
apiVersion: chainsaw.kyverno.io/v1alpha1 | ||
kind: Test | ||
metadata: | ||
name: redis-replication-setup | ||
spec: | ||
steps: | ||
- try: | ||
- apply: | ||
file: replication.yaml | ||
- assert: | ||
file: ready-sts.yaml | ||
- assert: | ||
file: ready-svc.yaml | ||
- assert: | ||
file: ready-pvc.yaml | ||
|
44 changes: 44 additions & 0 deletions
44
tests/e2e-chainsaw/v1beta2/setup/redis-replication/ready-pvc.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,44 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: redis-replication-redis-replication-0 | ||
labels: | ||
app: redis-replication | ||
redis_setup_type: replication | ||
role: replication | ||
status: | ||
accessModes: | ||
- ReadWriteOnce | ||
capacity: | ||
storage: 1Gi | ||
phase: Bound | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: redis-replication-redis-replication-1 | ||
labels: | ||
app: redis-replication | ||
redis_setup_type: replication | ||
role: replication | ||
status: | ||
accessModes: | ||
- ReadWriteOnce | ||
capacity: | ||
storage: 1Gi | ||
phase: Bound | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: redis-replication-redis-replication-2 | ||
labels: | ||
app: redis-replication | ||
redis_setup_type: replication | ||
role: replication | ||
status: | ||
accessModes: | ||
- ReadWriteOnce | ||
capacity: | ||
storage: 1Gi | ||
phase: Bound |
19 changes: 19 additions & 0 deletions
19
tests/e2e-chainsaw/v1beta2/setup/redis-replication/ready-sts.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,19 @@ | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
annotations: | ||
redis.opstreelabs.in: "true" | ||
redis.opstreelabs.instance: redis-replication | ||
labels: | ||
app: redis-replication | ||
redis_setup_type: replication | ||
role: replication | ||
name: redis-replication | ||
ownerReferences: | ||
- apiVersion: redis.redis.opstreelabs.in/v1beta2 | ||
controller: true | ||
kind: RedisReplication | ||
name: redis-replication | ||
status: | ||
readyReplicas: 3 | ||
replicas: 3 |
90 changes: 90 additions & 0 deletions
90
tests/e2e-chainsaw/v1beta2/setup/redis-replication/ready-svc.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,90 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
prometheus.io/port: "9121" | ||
prometheus.io/scrape: "true" | ||
redis.opstreelabs.in: "true" | ||
redis.opstreelabs.instance: redis-replication | ||
labels: | ||
app: redis-replication | ||
redis_setup_type: replication | ||
role: replication | ||
name: redis-replication | ||
ownerReferences: | ||
- apiVersion: redis.redis.opstreelabs.in/v1beta2 | ||
controller: true | ||
kind: RedisReplication | ||
name: redis-replication | ||
spec: | ||
ports: | ||
- name: redis-client | ||
port: 6379 | ||
protocol: TCP | ||
targetPort: 6379 | ||
selector: | ||
app: redis-replication | ||
redis_setup_type: replication | ||
role: replication | ||
type: ClusterIP | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
prometheus.io/port: "9121" | ||
prometheus.io/scrape: "true" | ||
redis.opstreelabs.in: "true" | ||
redis.opstreelabs.instance: redis-replication | ||
labels: | ||
app: redis-replication | ||
redis_setup_type: replication | ||
role: replication | ||
name: redis-replication-additional | ||
ownerReferences: | ||
- apiVersion: redis.redis.opstreelabs.in/v1beta2 | ||
controller: true | ||
kind: RedisReplication | ||
name: redis-replication | ||
spec: | ||
ports: | ||
- name: redis-client | ||
port: 6379 | ||
protocol: TCP | ||
targetPort: 6379 | ||
selector: | ||
app: redis-replication | ||
redis_setup_type: replication | ||
role: replication | ||
type: ClusterIP | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
prometheus.io/port: "9121" | ||
prometheus.io/scrape: "true" | ||
redis.opstreelabs.in: "true" | ||
redis.opstreelabs.instance: redis-replication | ||
labels: | ||
app: redis-replication | ||
redis_setup_type: replication | ||
role: replication | ||
name: redis-replication-headless | ||
ownerReferences: | ||
- apiVersion: redis.redis.opstreelabs.in/v1beta2 | ||
controller: true | ||
kind: RedisReplication | ||
name: redis-replication | ||
spec: | ||
clusterIP: None | ||
ports: | ||
- name: redis-client | ||
port: 6379 | ||
protocol: TCP | ||
targetPort: 6379 | ||
selector: | ||
app: redis-replication | ||
redis_setup_type: replication | ||
role: replication | ||
type: ClusterIP |
27 changes: 27 additions & 0 deletions
27
tests/e2e-chainsaw/v1beta2/setup/redis-replication/replication.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,27 @@ | ||
--- | ||
apiVersion: redis.redis.opstreelabs.in/v1beta2 | ||
kind: RedisReplication | ||
metadata: | ||
name: redis-replication | ||
spec: | ||
clusterSize: 3 | ||
podSecurityContext: | ||
runAsUser: 1000 | ||
fsGroup: 1000 | ||
kubernetesConfig: | ||
image: quay.io/opstree/redis:latest | ||
imagePullPolicy: Always | ||
resources: | ||
requests: | ||
cpu: 101m | ||
memory: 128Mi | ||
limits: | ||
cpu: 101m | ||
memory: 128Mi | ||
storage: | ||
volumeClaimTemplate: | ||
spec: | ||
accessModes: ["ReadWriteOnce"] | ||
resources: | ||
requests: | ||
storage: 1Gi |