Skip to content

Commit

Permalink
Mount srv-configs onto vtgate pods
Browse files Browse the repository at this point in the history
  • Loading branch information
VinaySagarGonabavi committed Sep 12, 2024
1 parent e4b077d commit d835427
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
24 changes: 24 additions & 0 deletions paasta_tools/vitesscluster_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ class GatewayConfigDict(TypedDict, total=False):
extraEnv: List[Union[KVEnvVar, KVEnvVarValueFrom]]
extraFlags: Dict[str, str]
extraLabels: Dict[str, str]
extraVolumeMounts: List[Dict[str, Any]]
extraVolumes: List[Dict[str, Any]]
lifecycle: Dict[str, Dict[str, Dict[str, List[str]]]]
replicas: int
resources: Dict[str, Any]
Expand Down Expand Up @@ -287,6 +289,28 @@ def get_cell_config(
"mysql_auth_vault_tls_ca": f"/etc/vault/all_cas/acm-privateca-{region}.crt",
"mysql_auth_vault_ttl": "60s",
},
extraVolumeMounts=[
{
"mountPath": "/nail/srv",
"name": "srv-configs",
"readOnly": True,
},
{
"mountPath": "/nail/etc/srv-configs",
"name": "etc-srv-configs",
"readOnly": True,
},
],
extraVolumes=[
{
"name": "srv-configs",
"hostPath": {"path": "/nail/srv"},
},
{
"name": "etc-srv-configs",
"hostPath": {"path": "/nail/etc/srv-configs"},
},
],
extraLabels=labels,
replicas=replicas,
resources={
Expand Down
15 changes: 15 additions & 0 deletions tests/test_vitesscluster_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,21 @@
"mysql_auth_vault_ttl": "60s",
},
"extraLabels": {"tablet_type": "fake_keyspaces_migration"},
"extraVolumeMounts": [
{"mountPath": "/nail/srv", "name": "srv-configs", "readOnly": True},
{
"mountPath": "/nail/etc/srv-configs",
"name": "etc-srv-configs",
"readOnly": True,
},
],
"extraVolumes": [
{"hostPath": {"path": "/nail/srv"}, "name": "srv-configs"},
{
"hostPath": {"path": "/nail/etc/srv-configs"},
"name": "etc-srv-configs",
},
],
"lifecycle": {
"postStart": {
"exec": {
Expand Down

0 comments on commit d835427

Please sign in to comment.