container-tools / kind-action

Apache License 2.0
24 stars 10 forks source link

Question: Can we mount a hostPath ? #6

Open cmoulliard opened 2 years ago

cmoulliard commented 2 years ago

Question

Can we mount a hostPath to kind ? Why such a question: The following config works pretty well on my laptop as the command is executed within the project containing the subpath /$ENGINE/wks but that will fail using this github action as as we cannot specify the working-directory.

Is there a way to pass en env var to specify the path to use to mount a hostPath which corresponds to the project checkout + ./$ENGINE/wks ?

apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
containerdConfigPatches:
  - |-
    [plugins."io.containerd.grpc.v1.cri".registry.mirrors."kind-registry:5000"]
      endpoint = ["http://kind-registry:5000"]
nodes:
  - role: control-plane
    extraMounts:
      - hostPath: $(pwd)/wks ## DO NOT WORK USING A GITHUB FLOW ACTION
        containerPath: /workspace
    extraPortMappings:
      - containerPort: 80
        hostPort: 80
        protocol: TCP
      - containerPort: 443
        hostPort: 443
        protocol: TCP