hpe-storage / truenas-csp

TrueNAS Container Storage Provider for HPE CSI Driver for Kubernetes
https://scod.hpedev.io
MIT License
71 stars 9 forks source link

Configure basename and portal #22

Closed mahlbom closed 1 year ago

mahlbom commented 3 years ago

Possible to change default value of; self.target_basename = 'iqn.2011-08.org.truenas.ctl' and self.target_portal = 'hpe-csi' with a config map/secret. Apply config map to values in backend.py.

datamattsson commented 3 years ago

The target_basename is hardcoded in the CSI driver (https://git.io/J1Enf), it doesn't have to be - it's a separate issue, but that's how the CSI driver currently limit the scope of what targets to look for on the host.

The target_portal could technically be associated with something else, Secret, ConfigMap etc but the TrueNAS CSP is oblivious to the fact it's running on Kubernetes (you could technically run it on the appliance itself).

Another approach could be to remove the "hpe-csi" comment requirement all together and simply return all portal IPs found with the target_basename. The CSI driver will figure out for us which ones to perform the discovery on (it matches the node IP address/subnet with the returned discovery IPs).

Let me noodle on this for the next release.

datamattsson commented 1 year ago

The CSP now (#40) supports either of the official target names. Custom target names altogether needs to be fixed in the upstream CSI driver if desired.

kingnarmer commented 1 year ago

Where to define target_basename and target_portal ? I tried adding them to secret and storage class without success.

datamattsson commented 1 year ago

Where to define target_basename and target_portal ? I tried adding them to secret and storage class without success.

Did you follow the INSTALL guide? You configure them on the FreeNAS/TrueNAS appliance.

kingnarmer commented 1 year ago

I got install working with iqn.2011-08.org.truenas.ctl/hpe-csi. I am asking here how to pass my own custom target_basename and target_portal ?

datamattsson commented 1 year ago

I am asking here how to pass my own custom target_basename and target_portal

The target_basename is hardcoded in the HPE CSI Driver and the TrueNAS CSP so you need to fork and build everything yourself if you want a different name. The target_portal is only hardcoded in the TrueNAS CSP.

Why do these things matter as both parameters are merely keys to find devices and configuration?

kingnarmer commented 1 year ago

Thanks for clarification.

kingnarmer commented 1 year ago

Just wanted to add why this mattered in my case , I have 10 servers already iscsi-connected to TrueNAS. Changing target to hardcoded value "iqn.2011-08.org.truenas.ctl" will require downtime to reconfigure the 10 servers iscsi to new target.

datamattsson commented 1 year ago

Just wanted to add why this mattered in my case

The target IQNs are hardcoded in the CSI node driver, not the TrueNAS CSP. It's how the HPE CSI Driver filter out iSCSI targets on the worker nodes. It would make sense to allow that list of targets to be dynamically set but it's outside the scope of the TrueNAS CSP.

kingnarmer commented 1 year ago

Thanks for your help.