Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subPath does not work when Anthos Service Mesh is enabled #47

Closed
songjiaxun opened this issue Jul 19, 2023 · 1 comment
Closed

subPath does not work when Anthos Service Mesh is enabled #47

songjiaxun opened this issue Jul 19, 2023 · 1 comment
Labels
bug Something isn't working enhancement New feature or request

Comments

@songjiaxun
Copy link
Contributor

songjiaxun commented Jul 19, 2023

Symptom

The subPath field does not work when Anthos Service Mesh is enabled.

Root Cause

The root cause is described in #46.

When the kubelet checks the subpath, it does not timeout in 2 minutes, thus the workload container start up will hang forever.

Workaround

Instead of using subPath, you can use only-dir flag to mount the bucket. It allows you to only mount a sub-folder in the bucket to the mount path.

See the documentation https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/cloud-storage-fuse-csi-driver#mounting-flags for details.

Solution

Similar to #46, The sidecar feature KEP will be the solution.

The sidecar container issue is tracked on GitHub, and we are waiting for the Kubernetes sidecar container feature to ultimately solve this issue.

@songjiaxun songjiaxun added the bug Something isn't working label Jul 19, 2023
@songjiaxun songjiaxun added the enhancement New feature or request label Aug 11, 2023
@songjiaxun
Copy link
Contributor Author

This is fixed in GKE 1.29 and above clusters.

To make subPath work with ASM or istio, you need to:

  1. Make sure all the nodes are upgraded to 1.29+.
  2. Add pod annotationproxy.istio.io/config: '{ "holdApplicationUntilProxyStarts": true }'.

For example:

apiVersion: v1
kind: Pod
metadata:
  annotations:
    gke-gcsfuse/volumes: "true"
    proxy.istio.io/config: '{ "holdApplicationUntilProxyStarts": true }'
  name: gcsfuse-istio-test
  namespace: default
spec:
  containers:
  - command:
    - /bin/sh
    - -c
    - sleep infinite
    image: busybox
    name: busybox
    volumeMounts:
    - mountPath: /data
      name: gcp-gcs-csi-ephemeral
      subPath: test-folder
  serviceAccount: default
  volumes:
  - name: gcp-gcs-csi-ephemeral
     csi:
      driver: gcsfuse.csi.storage.gke.io
      volumeAttributes:
        bucketName: xxx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant