Skip to content

Commit

Permalink
Add readiness check for redis in gateway plugin (#173)
Browse files Browse the repository at this point in the history
Co-authored-by: varungupta <[email protected]>
  • Loading branch information
varungup90 and varungupta authored Sep 13, 2024
1 parent e2ad163 commit 9e8bb30
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
4 changes: 4 additions & 0 deletions config/gateway/gateway-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ spec:
labels:
app: gateway-plugins
spec:
initContainers:
- name: init-c
image: busybox
command: ['sh', '-c', "until nslookup aibrix-redis-master.aibrix-system.svc.cluster.local; do echo waiting for service aibrix-redis-master; sleep 2; done"]
containers:
- name: golang-app-container
image: aibrix/plugins:nightly
Expand Down
13 changes: 9 additions & 4 deletions docs/development/app/gateway-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: aibrix-system
spec:
selector:
app: aibrix-gateway-plugins
app: gateway-plugins
ports:
- protocol: TCP
port: 50052
Expand All @@ -20,15 +20,20 @@ spec:
replicas: 1
selector:
matchLabels:
app: aibrix-gateway-plugins
app: gateway-plugins
template:
metadata:
labels:
app: aibrix-gateway-plugins
app: gateway-plugins
spec:
serviceAccountName: aibrix-gateway-plugin
initContainers:
- name: init-c
image: busybox
command: ['sh', '-c', "until nslookup aibrix-redis-master.aibrix-system.svc.cluster.local; do echo waiting for service aibrix-redis-master; sleep 2; done"]
containers:
- name: golang-app-container
image: aibrix/plugins:v0.1.0
image: aibrix/plugins:nightly
ports:
- containerPort: 50052
env:
Expand Down
10 changes: 10 additions & 0 deletions docs/development/app/redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ spec:
memory: 100Mi
ports:
- containerPort: 6379
readinessProbe:
exec:
command:
- redis-cli
- ping
initialDelaySeconds: 3
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 3
---
apiVersion: v1
kind: Service # Type of Kubernetes resource
Expand Down

0 comments on commit 9e8bb30

Please sign in to comment.