-
Notifications
You must be signed in to change notification settings - Fork 3
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
test: 2 Ceph clusters to ensure both are read/writable #41
base: main
Are you sure you want to change the base?
Conversation
98a97ea
to
0c278fb
Compare
0c278fb
to
6d8fe47
Compare
4c5651c
to
1a54ea8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments to aid the reviewer
charmcraft.yaml
Outdated
- {namespace} - the charm configured namespace | ||
|
||
Example: | ||
juju config ceph-csi csidriver-name-formatter="{name}.{app}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this isn't the best example???
Which would you rather see in your cluster:
*ceph-csi-alt.rbd.csi.ceph.com
*rbd.csi.ceph.com.ceph-csi-alt
charmcraft.yaml
Outdated
|
||
NOTE: Can only be specified on deployment since some | ||
attributes of kubernetes resources are non-modifiable. | ||
The admin is responsible for creating the namespace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The admin is responsible...
part is a copy/past error. The rest of the note could be improved
juju config ceph-csi cephfs-storage-class-name-formatter="{cluster}-{namespace}-{storageclass}" | ||
juju config ceph-csi cephfs-storage-class-name-formatter="cephfs-{namespace}-{pool}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive by docs repair
juju config ceph-csi ceph-xfs-storage-class-name-formatter="{cluster}-{namespace}-{storageclass}" | ||
juju config ceph-csi ceph-xfs-storage-class-name-formatter="ceph-xfs-{app}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive by docs repair
juju config ceph-csi ceph-ext4-storage-class-name-formatter="{cluster}-{namespace}-{storageclass}" | ||
juju config ceph-csi ceph-ext4-storage-class-name-formatter="ceph-ext4-{app}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive by docs repair
class ManifestLabelExcluder(ManifestLabel): | ||
"""Exclude applying labels to CSIDriver.""" | ||
|
||
def __call__(self, obj: AnyResource) -> None: | ||
super().__call__(obj) | ||
if obj.kind == "CSIDriver" and obj.metadata and obj.metadata.labels: | ||
# Remove the app label from the CSIDriver to disassociate it from the application | ||
obj.metadata.labels.pop(APP_LABEL, None) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hooray, now each application deploys its own CSIDriver with a different name.
@@ -251,3 +248,94 @@ def from_space_separated(cls, tolerations: str) -> List["CephToleration"]: | |||
return [cls._from_string(toleration) for toleration in tolerations.split()] | |||
except ValueError as e: | |||
raise ValueError(f"Invalid tolerations: {e}") from e | |||
|
|||
|
|||
class ProvisionerAdjustments(Patch): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class was yanked from each of RBDManifest and CephFSManifest and consolidated here. It does the same jobs it did before, now it's also responsible for adjusting the csidriver name where it can.
|
||
for c in obj.spec.template.spec.containers: | ||
for idx in range(len(c.args)): | ||
if original_dn in c.args[idx] and updated_dn not in c.args[idx]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is by far my least favorite line.
in the upstream manifests, there are container arguments that contain *.csi.ceph.com
. We need to change those argument strings to whatever the formatted name for the driver is. But we can only replace them once. Otherwise we might end up with:
alt.alt.alt.alt.alt.alt.alt.alt.alt.rdb.csi.ceph.com
if this method is called multiple times on the same resource.
for v in obj.spec.template.spec.volumes: | ||
if v.hostPath: | ||
v.hostPath.path = v.hostPath.path.replace("/var/lib/kubelet", kubelet_dir) | ||
v.hostPath.path = v.hostPath.path.replace(original_dn, updated_dn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... that repeated alt.alt.alt.alt.alt.alt.alt.alt.alt.rdb.csi.ceph.com
could end up here too... need to check on that.
tests/functional/overlay.yaml
Outdated
@@ -47,6 +75,7 @@ applications: | |||
options: | |||
provisioner-replicas: 1 | |||
namespace: {{ namespace }} | |||
csidriver-name-formatter: '{name}.alt' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder, maybe this should be switched to alt.{name}
Overview
Ensure that Canonical K8s (or charmed kubernetes) can operate with N Ceph Clusters without conflict
Details