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

Pvcglobaluniqeid #751

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zaidenwerg
Copy link

@zaidenwerg zaidenwerg commented Jan 23, 2022

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

  • Implementation tested
  • Error handling code meets the guideline
  • 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"`
}

Uri Zaidenwerg added 2 commits January 23, 2022 07:49
Fixes banzaicloud#744

Create PersistentVolumeClaim with Name instead of Generated Name
Will allow kafka k8s cluster switch over using global storage classes that span multiple kubernetes clusters.
@zaidenwerg zaidenwerg requested a review from a team as a code owner January 23, 2022 07:04
@CLAassistant
Copy link

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.

@baluchicken
Copy link
Member

Hi @zaidenwerg please look my answer here how can you create manually your own PV and PVC for the operator.
#572 (comment)

@stoader
Copy link
Member

stoader commented Jul 3, 2022

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

launching Kafka components using StatefulSet insted of Deployments
4 participants