cartservice: rm initContainer, fix probe query ip

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
Ahmet Alp Balkan 2018-07-09 12:56:54 -07:00
parent a8508f8f74
commit 0be5e7b1e2
2 changed files with 4 additions and 17 deletions

View file

@ -9,19 +9,6 @@ spec:
app: cartservice app: cartservice
spec: spec:
terminationGracePeriodSeconds: 5 terminationGracePeriodSeconds: 5
initContainers:
- name: wait-redis
image: redis:alpine
command: ['sh', '-c', 'set -x;
until timeout -t 5 redis-cli -h "${REDIS_HOST}" -p "${REDIS_PORT}" ping; do
echo "waiting for redis at ${REDIS_HOST}:${REDIS_PORT}...";
sleep 2;
done;']
env:
- name: REDIS_HOST
value: "redis-cart"
- name: REDIS_PORT
value: "6379"
containers: containers:
- name: server - name: server
image: gcr.io/istio-next/cartservice image: gcr.io/istio-next/cartservice
@ -42,11 +29,11 @@ spec:
cpu: 300m cpu: 300m
memory: 128Mi memory: 128Mi
readinessProbe: readinessProbe:
initialDelaySeconds: 5 initialDelaySeconds: 15
exec: exec:
command: ["/cartservice_probe"] command: ["/cartservice_probe"]
livenessProbe: livenessProbe:
initialDelaySeconds: 10 initialDelaySeconds: 15
periodSeconds: 10 periodSeconds: 10
exec: exec:
command: ["/cartservice_probe"] command: ["/cartservice_probe"]

View file

@ -19,10 +19,10 @@ func main() {
log.Printf("probe executing on port %q", port) log.Printf("probe executing on port %q", port)
conn, err := grpc.DialContext(context.TODO(), conn, err := grpc.DialContext(context.TODO(),
"localhost:"+port, "127.0.0.1:"+port,
grpc.WithInsecure(), grpc.WithInsecure(),
grpc.WithBlock(), grpc.WithBlock(),
grpc.WithTimeout(time.Second*1)) grpc.WithTimeout(time.Second*3))
if err != nil { if err != nil {
log.Fatalf("probe failed: failed to connect: %+v", err) log.Fatalf("probe failed: failed to connect: %+v", err)
} }