-
Notifications
You must be signed in to change notification settings - Fork 241
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
Add system volumes to vitess pods #3959
Conversation
75bf9a4
to
2141f9c
Compare
class HostPathVolume(TypedDict, total=False): | ||
path: str | ||
type: str | ||
|
||
|
||
class KubernetesVolume(TypedDict, total=False): | ||
name: str | ||
hostPath: HostPathVolume |
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'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
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.
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( |
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.
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)
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.
for volume_mount in VTTABLET_EXTRA_VOLUME_MOUNTS: | ||
extra_volume_mounts.append( | ||
api_client.sanitize_for_serialization(volume_mount) | ||
) |
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.
should we store this in the final serialized format instead of having to convert before using them?
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 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,
},
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.
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
Remove vtgate lifecycle hooks as we're not proceeding with #3959 and would like to have functional vtgate pods for testing
Additional changes needed locally to test
Modified
k8s_itests/deployments/paasta/fake_etc_paasta/volumes.json
to the devc versionUpdated
paasta_tools/contrib/create_paasta_playground.py
to not modify the paasta config locally https://fluffy.yelpcorp.com/i/BhR02T8wwShMWjvK38JPptz9B2cX0c3g.html