# Is it possible to have vault-csi-provider on separate cluster to vault server?

**URL:** <https://discuss.hashicorp.com/t/is-it-possible-to-have-vault-csi-provider-on-separate-cluster-to-vault-server/69898>\
**Category:** Vault\
**Created:** [September 11, 2024, 5:09pm UTC](https://discuss.hashicorp.com/t/is-it-possible-to-have-vault-csi-provider-on-separate-cluster-to-vault-server/69898 "2024-09-11T17:09:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ewan-chalmers](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/ewan-chalmers/32/42937_2.png) [@ewan-chalmers](https://discuss.hashicorp.com/u/ewan-chalmers)\
**Post date:** [September 11, 2024, 5:09pm UTC](https://discuss.hashicorp.com/t/is-it-possible-to-have-vault-csi-provider-on-separate-cluster-to-vault-server/69898/1 "2024-09-11T17:09:38Z")

</div>

I have a working prototype with vault, csi and vault-csi-driver mounting secrets in pods in a single cluster.

I’m now trying to separate the vault server to a separate cluster

- vault cluster
  - vault server

- workload cluster
  - vault-csi-provider
  - csi-secrets-store-csi-driver

I get 403 errors, e.g. in logs of vault-csi-provider

SecretProviderClass looks like

```auto
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
  annotations:
  creationTimestamp: "2024-09-11T16:52:37Z"
  generation: 1
  name: csiapp-database
  namespace: default
  resourceVersion: "196860"
  uid: 9349cafd-0506-4d5c-8930-1f4a594ab11f
spec:
  parameters:
    objects: |
      - objectName: "db-password"
        secretPath: "secret/data/db-pass"
        secretKey: "password"
      - objectName: "db-whoopsi"
        secretPath: "secret/data/db-pass"
        secretKey: "whoopsi"
      - objectName: "db-time"
        secretPath: "secret/data/db-pass"
        secretKey: "time"
    roleName: csiapp
    vaultAddress: http://k8s.ingress/vault
  provider: vault

```

The role

```auto
vault write auth/kubernetes/role/csiapp \
    bound_service_account_names=csiapp-sa \
    bound_service_account_namespaces=default \
    policies=csiapp \
    ttl=20m

```

I guess that kubernetes auth is incompatible in this cross-cluster scenario?

---

<div class="post-metadata">

**Author:** ![ausmartway](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/ausmartway/32/10504_2.png) [@ausmartway](https://discuss.hashicorp.com/u/ausmartway)\
**Post date:** [September 11, 2024, 11:00pm UTC](https://discuss.hashicorp.com/t/is-it-possible-to-have-vault-csi-provider-on-separate-cluster-to-vault-server/69898/2 "2024-09-11T23:00:04Z")

</div>

you need to configure a new k8s auth method that points to the workload k8s cluster.

---

<div class="post-metadata">

**Author:** ![ewan-chalmers](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/ewan-chalmers/32/42937_2.png) [@ewan-chalmers](https://discuss.hashicorp.com/u/ewan-chalmers)\
**Post date:** [September 12, 2024, 8:31am UTC](https://discuss.hashicorp.com/t/is-it-possible-to-have-vault-csi-provider-on-separate-cluster-to-vault-server/69898/3 "2024-09-12T08:31:55Z")

</div>

OK thanks. So I should follow this guide - [Kubernetes - Auth Methods | Vault | HashiCorp Developer](https://developer.hashicorp.com/vault/docs/auth/kubernetes#configuration) - to configure a kubernetes authentication method in the vault server pointing to the workload cluster.

I guess it means that if you had multiple workload clusters sharing one vault server, you would need to configure the vault server with an auth method for each workload cluster?

---

<div class="post-metadata">

**Author:** ![ausmartway](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/ausmartway/32/10504_2.png) [@ausmartway](https://discuss.hashicorp.com/u/ausmartway)\
**Post date:** [September 25, 2024, 12:14pm UTC](https://discuss.hashicorp.com/t/is-it-possible-to-have-vault-csi-provider-on-separate-cluster-to-vault-server/69898/4 "2024-09-25T12:14:06Z")

</div>

yes, as each cluster api credential would be different.
