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.
sentinel-setup (OT-CONTAINER-KIT#733)
Signed-off-by: Shubham Gupta <[email protected]> Signed-off-by: Matt Robinson <[email protected]>
- Loading branch information
1 parent
ee9f5de
commit b5da54b
Showing
4 changed files
with
168 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
tests/e2e-chainsaw/v1beta2/setup/redis-sentinel/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,15 @@ | ||
# 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-sentinel-setup | ||
spec: | ||
steps: | ||
- try: | ||
- apply: | ||
file: sentinel.yaml | ||
- assert: | ||
file: ready-sts.yaml | ||
- assert: | ||
file: ready-svc.yaml |
35 changes: 35 additions & 0 deletions
35
tests/e2e-chainsaw/v1beta2/setup/redis-sentinel/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,35 @@ | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
annotations: | ||
redis.opstreelabs.in: "true" | ||
redis.opstreelabs.instance: redis-sentinel | ||
labels: | ||
app: redis-sentinel-sentinel | ||
redis_setup_type: sentinel | ||
role: sentinel | ||
name: redis-sentinel-sentinel | ||
ownerReferences: | ||
- apiVersion: redis.redis.opstreelabs.in/v1beta2 | ||
controller: true | ||
kind: RedisSentinel | ||
name: redis-sentinel | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: redis-sentinel-sentinel | ||
redis_setup_type: sentinel | ||
role: sentinel | ||
serviceName: redis-sentinel-sentinel-headless | ||
template: | ||
metadata: | ||
annotations: | ||
redis.opstreelabs.in: "true" | ||
redis.opstreelabs.instance: redis-sentinel | ||
labels: | ||
app: redis-sentinel-sentinel | ||
redis_setup_type: sentinel | ||
role: sentinel | ||
status: | ||
readyReplicas: 3 | ||
replicas: 3 |
96 changes: 96 additions & 0 deletions
96
tests/e2e-chainsaw/v1beta2/setup/redis-sentinel/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,96 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
prometheus.io/port: "9121" | ||
prometheus.io/scrape: "true" | ||
redis.opstreelabs.in: "true" | ||
redis.opstreelabs.instance: redis-sentinel | ||
labels: | ||
app: redis-sentinel-sentinel | ||
redis_setup_type: sentinel | ||
role: sentinel | ||
name: redis-sentinel-sentinel | ||
ownerReferences: | ||
- apiVersion: redis.redis.opstreelabs.in/v1beta2 | ||
controller: true | ||
kind: RedisSentinel | ||
name: redis-sentinel | ||
spec: | ||
ports: | ||
- name: sentinel-client | ||
port: 26379 | ||
protocol: TCP | ||
targetPort: 26379 | ||
selector: | ||
app: redis-sentinel-sentinel | ||
redis_setup_type: sentinel | ||
role: sentinel | ||
type: ClusterIP | ||
status: | ||
loadBalancer: {} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
prometheus.io/port: "9121" | ||
prometheus.io/scrape: "true" | ||
redis.opstreelabs.in: "true" | ||
redis.opstreelabs.instance: redis-sentinel | ||
labels: | ||
app: redis-sentinel-sentinel | ||
redis_setup_type: sentinel | ||
role: sentinel | ||
name: redis-sentinel-sentinel-additional | ||
ownerReferences: | ||
- apiVersion: redis.redis.opstreelabs.in/v1beta2 | ||
controller: true | ||
kind: RedisSentinel | ||
name: redis-sentinel | ||
spec: | ||
ports: | ||
- name: sentinel-client | ||
port: 26379 | ||
protocol: TCP | ||
targetPort: 26379 | ||
selector: | ||
app: redis-sentinel-sentinel | ||
redis_setup_type: sentinel | ||
role: sentinel | ||
type: ClusterIP | ||
status: | ||
loadBalancer: {} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
prometheus.io/port: "9121" | ||
prometheus.io/scrape: "true" | ||
redis.opstreelabs.in: "true" | ||
redis.opstreelabs.instance: redis-sentinel | ||
labels: | ||
app: redis-sentinel-sentinel | ||
redis_setup_type: sentinel | ||
role: sentinel | ||
name: redis-sentinel-sentinel-headless | ||
ownerReferences: | ||
- apiVersion: redis.redis.opstreelabs.in/v1beta2 | ||
controller: true | ||
kind: RedisSentinel | ||
name: redis-sentinel | ||
spec: | ||
clusterIP: None | ||
ports: | ||
- name: sentinel-client | ||
port: 26379 | ||
protocol: TCP | ||
targetPort: 26379 | ||
selector: | ||
app: redis-sentinel-sentinel | ||
redis_setup_type: sentinel | ||
role: sentinel | ||
type: ClusterIP | ||
status: | ||
loadBalancer: {} |
22 changes: 22 additions & 0 deletions
22
tests/e2e-chainsaw/v1beta2/setup/redis-sentinel/sentinel.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,22 @@ | ||
--- | ||
apiVersion: redis.redis.opstreelabs.in/v1beta2 | ||
kind: RedisSentinel | ||
metadata: | ||
name: redis-sentinel | ||
spec: | ||
clusterSize: 3 | ||
podSecurityContext: | ||
runAsUser: 1000 | ||
fsGroup: 1000 | ||
# redisSentinelConfig: | ||
# redisReplicationName : redis-replication | ||
kubernetesConfig: | ||
image: quay.io/opstree/redis-sentinel:latest | ||
imagePullPolicy: Always | ||
resources: | ||
requests: | ||
cpu: 101m | ||
memory: 128Mi | ||
limits: | ||
cpu: 101m | ||
memory: 128Mi |