瀏覽代碼

devnet: fix Ready state delay by switching to readinessProbe

This works around an apparent k8s bug where startupProbe does not
respect periodSeconds.

Instead, use a readinessProbe.

Change-Id: I43251284db336ea5ade5b1735a867cf294a7b1c4
Leo 4 年之前
父節點
當前提交
7728b47659
共有 3 個文件被更改,包括 6 次插入7 次删除
  1. 3 2
      devnet/eth-devnet.yaml
  2. 2 1
      devnet/solana-devnet.yaml
  3. 1 4
      solana/devnet_setup.sh

+ 3 - 2
devnet/eth-devnet.yaml

@@ -48,11 +48,12 @@ spec:
               port: rpc
         - name: tests
           image: eth-node
+          stdin: true
           command:
             - /bin/sh
             - -c
-            - "npm run migrate && npx truffle exec scripts/deploy_test_token.js && nc -l -p 2000 && sleep infinity"
-          startupProbe:
+            - "npm run migrate && npx truffle exec scripts/deploy_test_token.js && nc -lkp 2000 0.0.0.0"
+          readinessProbe:
             periodSeconds: 1
             failureThreshold: 300
             tcpSocket:

+ 2 - 1
devnet/solana-devnet.yaml

@@ -77,11 +77,12 @@ spec:
             httpGet:
               port: rpc
               path: /health
+            periodSeconds: 1
         - name: setup
           image: solana-client
           command:
             - /usr/src/solana/devnet_setup.sh
-          startupProbe:
+          readinessProbe:
             tcpSocket:
               port: 2000
             periodSeconds: 1

+ 1 - 4
solana/devnet_setup.sh

@@ -47,7 +47,4 @@ spl-token mint "$token" 10000000000 "$account"
 retry client create-bridge "$bridge_address" "$initial_guardian" 86400 100
 
 # Let k8s startup probe succeed
-nc -l -p 2000
-
-# Keep the container alive for interactive CLI usage
-sleep infinity
+nc -k -l -p 2000