<p>I'm currently setting up a kubernetes cluster with 3 nodes on 3 differents vm and each node is composed of 1 pod witch run the following docker image: ethereum/client-go:stable</p>

<p>The problem is that I want to do a health check test using a bash script (because I have to test a lot of things) but I don't understand how I can export this file to each container that are deployed with my yaml deployment file.</p>

<p>I've tried to add <code>wget</code> command in the yaml file to download my health check script from my github repo but it wasn't very clean from my point of view, maybe there is an other way ?</p>

<p><strong>My current deployment file:</strong></p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: goerli
  name: goerli-deploy
spec:
  replicas: 3
  selector:
    matchLabels:
      app: goerli
  template:
    metadata:
      labels:
        app: goerli
    spec:
      containers:
        - image: ethereum/client-go:stable
          name: goerli-geth
          args: ["--goerli", "--datadir", "/test2"]
          env:
          - name: LASTBLOCK
            value: "0"
          - name: FAILCOUNTER
            value: "0"
          ports:
          - containerPort: 30303
            name: geth
          livenessProbe:
            exec:
              command:
              - /bin/sh
              - /test/health.sh
            initialDelaySeconds: 60
            periodSeconds: 100
          volumeMounts:
          - name: test
            mountPath: /test
      restartPolicy: Always
      volumes:
      - name: test
        hostPath:
          path: /test
</code></pre>

<p>I expect to put health check script in /test/health.sh</p>

<p>Any ideas ?</p>

yatsukino
<p>This could be a perfect usecase for the init container, As there could be different images for the init container and the Application container thus they have different file system inside the pods, therefore we need to use <strong>Emptydir</strong> in order to share the state.   </p>

<p>for further detail follow the link <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/" rel="nofollow noreferrer">init-containers</a></p>
