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

Add system volumes to vitess pods #3959

Closed

Conversation

VinaySagarGonabavi
Copy link
Contributor

Additional changes needed locally to test
Modified k8s_itests/deployments/paasta/fake_etc_paasta/volumes.json to the devc version
Updated paasta_tools/contrib/create_paasta_playground.py to not modify the paasta config locally https://fluffy.yelpcorp.com/i/BhR02T8wwShMWjvK38JPptz9B2cX0c3g.html

@VinaySagarGonabavi VinaySagarGonabavi force-pushed the u/gonabavi/DREIMP-10984_add_default_volumes branch from 75bf9a4 to 2141f9c Compare September 13, 2024 20:41
Comment on lines +133 to +140
class HostPathVolume(TypedDict, total=False):
path: str
type: str


class KubernetesVolume(TypedDict, total=False):
name: str
hostPath: HostPathVolume
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm a little surprised that we don't have typed dicts for this type of k8s volume shenanigans - but i guess that's maybe because we never store the volume info as a dict outside of representing the config as seen in soaconfigs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, looks like DockerVolume format is used in the parent classes, and I used this as required for Vitess manifest

@@ -775,16 +782,50 @@ def get_global_lock_server(self) -> Dict[str, Dict[str, str]]:
}
}

def get_kubernetes_volumes(self) -> List[KubernetesVolume]:
system_volumes = load_system_paasta_config().get_volumes()
docker_volumes = self.get_volumes(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should hardcode passing in uses_bulkdata_default=False to all the self.get_volumes() calls so that we skip adding bulkdata mounts (that y'all don't need)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking again at it, the get_volumes method of InstanceConfig has the uses_bulkdata_default argument but not SystemPaastaConfig one

Comment on lines +905 to +908
for volume_mount in VTTABLET_EXTRA_VOLUME_MOUNTS:
extra_volume_mounts.append(
api_client.sanitize_for_serialization(volume_mount)
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we store this in the final serialized format instead of having to convert before using them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the final format in which we expect it to be part of the spec, for reference in tests

{
                                            "mountPath": "/etc/vault/all_cas",
                                            "name": "vault-secrets",
                                            "readOnly": True,
                                        },

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, do you mean to store the global variable for VTTABLET_EXTRA_VOLUME_MOUNTS in a serialized format instead of List[V1VolumeMount]? I did that to avoid mypy errors when performing extra_volume_mounts.append operation

nemacysts pushed a commit that referenced this pull request Oct 7, 2024
Remove vtgate lifecycle hooks as we're not proceeding with #3959 and would like to have functional vtgate pods for testing
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.

3 participants