vcluster
vcluster copied to clipboard
Rewriting secrets in the azureFile volume
I'm having an issue with the applications deployed in vCluster, whose secret is defined in k8s inline mount. When trying to deploy the application, the secret is looked up in the wrong path.
Example of application deployment: Host cluster -> vcluster (namespace) -> application (namespace) -> secret
Instead of looking for the secret in the application namespace (inside vCluster), the deployment looks it up in the vcluster/secret namespace. I would expect deployment to search the secret in vCluster's namespace, where the mount and resource are defined.
Here is the k8s resource for the inline mount sample:
...
volumeMounts:
- mountPath: /some/path/file
name: secret
volumes:
- azureFile:
secretName: secret-name
shareName: sharexyz
name: secret
...
Would it be possible to have vCluster rewriting the secrets in the azureFile volume?
@ipopovic5 thanks for creating this issue! You are correct, vcluster currently does not rewrite the secret name there, we should fix this.
@FabianKramm is this still an issue? I tried replicating the same, could not! If it's something to work on, can you please elaborate?
@sandeep540 Thank you for looking into this. You are right that it is not reproducible. I think it is fixed by these lines: https://github.com/loft-sh/vcluster/blob/5ad633df5a2f8841d2a935d7a6be4d7daf68a653/pkg/controllers/resources/pods/translate/translator.go#L356-L358
Closing.