koperator icon indicating copy to clipboard operation
koperator copied to clipboard

Pvcglobaluniqeid

Open zaidenwerg opened this issue 3 years ago • 3 comments

Q A
Bug fix? no
New feature? yes
API breaks? no
Deprecations? no
Related tickets fixes #744
License Apache 2.0

What's in this PR?

Created ObjectMetaWithNameAndAnnotations and ObjectMetaWithName to allow creation of objects with a deterministic name. Use ObjectMetaWithNameAndAnnotations instead of ObjectMetaWithGeneratedNameAndAnnotations When creating a PVC. Removed the hyphen at the end of brokerStorageTemplate since there isn't going to be a generated suffix.

Why?

When using storage classes that span multiple Kubernetes clusters which use the PVC name to identify the volume that is referenced by the PersistentVolumeClaim or VolumeClaimTemplates, the PVC must have a deterministic name so it could be referenced on all the Kubernetes clusters that will reference it.

Checklist

  • [x] Implementation tested
  • [x] Error handling code meets the guideline
  • [x] Logging code meets the guideline
  • [ ] User guide and development docs updated (if needed)

To Do

  • [ ] Testing

Additional notes

We have tested the the code yesterday, it works but we have other issues that prevent the scenario we are aiming for to succeed. Would love your thoughts about it in the meanwhile. Also, I make this change optional by adding a flag to StorageConfig:

type StorageConfig struct {
	MountPath string                                                     `json:"mountPath"`
        IsGlobal      bool                                                       `json:"isGlobal"`
	PvcSpec    *corev1.PersistentVolumeClaimSpec `json:"pvcSpec"`
}

zaidenwerg avatar Jan 23 '22 07:01 zaidenwerg

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Uri Zaidenwerg seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Jan 23 '22 07:01 CLAassistant

Hi @zaidenwerg please look my answer here how can you create manually your own PV and PVC for the operator. https://github.com/banzaicloud/koperator/issues/572#issuecomment-805668287

baluchicken avatar Jan 28 '22 09:01 baluchicken

@zaidenwerg could you describe the use case global PVC names would be needed across multiple Kubernetes clusters for Kafka?

cc @pregnor @hi-im-aren @bartam1 @amberimam @panyuenlau @Kuvesz

stoader avatar Jul 03 '22 20:07 stoader