Skip to content

Commit 25d807a

Browse files
authored
sentinel-setup (#733)
Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>
1 parent 0ed854f commit 25d807a

File tree

4 files changed

+168
-0
lines changed

4 files changed

+168
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
2+
3+
apiVersion: chainsaw.kyverno.io/v1alpha1
4+
kind: Test
5+
metadata:
6+
name: redis-sentinel-setup
7+
spec:
8+
steps:
9+
- try:
10+
- apply:
11+
file: sentinel.yaml
12+
- assert:
13+
file: ready-sts.yaml
14+
- assert:
15+
file: ready-svc.yaml
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: apps/v1
2+
kind: StatefulSet
3+
metadata:
4+
annotations:
5+
redis.opstreelabs.in: "true"
6+
redis.opstreelabs.instance: redis-sentinel
7+
labels:
8+
app: redis-sentinel-sentinel
9+
redis_setup_type: sentinel
10+
role: sentinel
11+
name: redis-sentinel-sentinel
12+
ownerReferences:
13+
- apiVersion: redis.redis.opstreelabs.in/v1beta2
14+
controller: true
15+
kind: RedisSentinel
16+
name: redis-sentinel
17+
spec:
18+
selector:
19+
matchLabels:
20+
app: redis-sentinel-sentinel
21+
redis_setup_type: sentinel
22+
role: sentinel
23+
serviceName: redis-sentinel-sentinel-headless
24+
template:
25+
metadata:
26+
annotations:
27+
redis.opstreelabs.in: "true"
28+
redis.opstreelabs.instance: redis-sentinel
29+
labels:
30+
app: redis-sentinel-sentinel
31+
redis_setup_type: sentinel
32+
role: sentinel
33+
status:
34+
readyReplicas: 3
35+
replicas: 3
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
annotations:
5+
prometheus.io/port: "9121"
6+
prometheus.io/scrape: "true"
7+
redis.opstreelabs.in: "true"
8+
redis.opstreelabs.instance: redis-sentinel
9+
labels:
10+
app: redis-sentinel-sentinel
11+
redis_setup_type: sentinel
12+
role: sentinel
13+
name: redis-sentinel-sentinel
14+
ownerReferences:
15+
- apiVersion: redis.redis.opstreelabs.in/v1beta2
16+
controller: true
17+
kind: RedisSentinel
18+
name: redis-sentinel
19+
spec:
20+
ports:
21+
- name: sentinel-client
22+
port: 26379
23+
protocol: TCP
24+
targetPort: 26379
25+
selector:
26+
app: redis-sentinel-sentinel
27+
redis_setup_type: sentinel
28+
role: sentinel
29+
type: ClusterIP
30+
status:
31+
loadBalancer: {}
32+
---
33+
apiVersion: v1
34+
kind: Service
35+
metadata:
36+
annotations:
37+
prometheus.io/port: "9121"
38+
prometheus.io/scrape: "true"
39+
redis.opstreelabs.in: "true"
40+
redis.opstreelabs.instance: redis-sentinel
41+
labels:
42+
app: redis-sentinel-sentinel
43+
redis_setup_type: sentinel
44+
role: sentinel
45+
name: redis-sentinel-sentinel-additional
46+
ownerReferences:
47+
- apiVersion: redis.redis.opstreelabs.in/v1beta2
48+
controller: true
49+
kind: RedisSentinel
50+
name: redis-sentinel
51+
spec:
52+
ports:
53+
- name: sentinel-client
54+
port: 26379
55+
protocol: TCP
56+
targetPort: 26379
57+
selector:
58+
app: redis-sentinel-sentinel
59+
redis_setup_type: sentinel
60+
role: sentinel
61+
type: ClusterIP
62+
status:
63+
loadBalancer: {}
64+
---
65+
apiVersion: v1
66+
kind: Service
67+
metadata:
68+
annotations:
69+
prometheus.io/port: "9121"
70+
prometheus.io/scrape: "true"
71+
redis.opstreelabs.in: "true"
72+
redis.opstreelabs.instance: redis-sentinel
73+
labels:
74+
app: redis-sentinel-sentinel
75+
redis_setup_type: sentinel
76+
role: sentinel
77+
name: redis-sentinel-sentinel-headless
78+
ownerReferences:
79+
- apiVersion: redis.redis.opstreelabs.in/v1beta2
80+
controller: true
81+
kind: RedisSentinel
82+
name: redis-sentinel
83+
spec:
84+
clusterIP: None
85+
ports:
86+
- name: sentinel-client
87+
port: 26379
88+
protocol: TCP
89+
targetPort: 26379
90+
selector:
91+
app: redis-sentinel-sentinel
92+
redis_setup_type: sentinel
93+
role: sentinel
94+
type: ClusterIP
95+
status:
96+
loadBalancer: {}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
apiVersion: redis.redis.opstreelabs.in/v1beta2
3+
kind: RedisSentinel
4+
metadata:
5+
name: redis-sentinel
6+
spec:
7+
clusterSize: 3
8+
podSecurityContext:
9+
runAsUser: 1000
10+
fsGroup: 1000
11+
# redisSentinelConfig:
12+
# redisReplicationName : redis-replication
13+
kubernetesConfig:
14+
image: quay.io/opstree/redis-sentinel:latest
15+
imagePullPolicy: Always
16+
resources:
17+
requests:
18+
cpu: 101m
19+
memory: 128Mi
20+
limits:
21+
cpu: 101m
22+
memory: 128Mi

0 commit comments

Comments
 (0)