diff --git a/config/gateway/gateway-plugin.yaml b/config/gateway/gateway-plugin.yaml index e1130e32..c6d33f71 100644 --- a/config/gateway/gateway-plugin.yaml +++ b/config/gateway/gateway-plugin.yaml @@ -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 diff --git a/docs/development/app/gateway-plugin.yaml b/docs/development/app/gateway-plugin.yaml index 88f10d40..e43c9e4a 100644 --- a/docs/development/app/gateway-plugin.yaml +++ b/docs/development/app/gateway-plugin.yaml @@ -5,7 +5,7 @@ metadata: namespace: aibrix-system spec: selector: - app: aibrix-gateway-plugins + app: gateway-plugins ports: - protocol: TCP port: 50052 @@ -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: diff --git a/docs/development/app/redis.yaml b/docs/development/app/redis.yaml index 6d5ee8f8..5b9f883c 100644 --- a/docs/development/app/redis.yaml +++ b/docs/development/app/redis.yaml @@ -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