diff --git a/debian/changelog b/debian/changelog index de6caa3da9..03fdd8377b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +paasta-tools (1.4.6) xenial; urgency=medium + + * 1.4.6 tagged with 'make release' + Commit: Merge pull request #3902 from Yelp/u/gonabavi/DREIMP- + 10725_add_paasta_status_for_vitesscluster Add paasta status for + vitesscluster and mount /nail/etc/srv-configs to VTTablets + + -- Vinay Sagar Gonabavi Thu, 27 Jun 2024 10:40:09 -0700 + paasta-tools (1.4.5) xenial; urgency=medium * 1.4.5 tagged with 'make release' diff --git a/docs/source/generated/paasta_tools.paastaapi.model.instance_status_vitesscluster.rst b/docs/source/generated/paasta_tools.paastaapi.model.instance_status_vitesscluster.rst new file mode 100644 index 0000000000..417bef83ec --- /dev/null +++ b/docs/source/generated/paasta_tools.paastaapi.model.instance_status_vitesscluster.rst @@ -0,0 +1,7 @@ +paasta\_tools.paastaapi.model.instance\_status\_vitesscluster module +==================================================================== + +.. automodule:: paasta_tools.paastaapi.model.instance_status_vitesscluster + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/generated/paasta_tools.paastaapi.model.rst b/docs/source/generated/paasta_tools.paastaapi.model.rst index ad9af417da..3c9f6c358f 100644 --- a/docs/source/generated/paasta_tools.paastaapi.model.rst +++ b/docs/source/generated/paasta_tools.paastaapi.model.rst @@ -34,6 +34,7 @@ Submodules paasta_tools.paastaapi.model.instance_status_kubernetes_autoscaling_status paasta_tools.paastaapi.model.instance_status_kubernetes_v2 paasta_tools.paastaapi.model.instance_status_tron + paasta_tools.paastaapi.model.instance_status_vitesscluster paasta_tools.paastaapi.model.instance_tasks paasta_tools.paastaapi.model.integer_and_error paasta_tools.paastaapi.model.kubernetes_container diff --git a/paasta_tools/__init__.py b/paasta_tools/__init__.py index 09604826f9..9f61c2c156 100644 --- a/paasta_tools/__init__.py +++ b/paasta_tools/__init__.py @@ -17,4 +17,4 @@ # setup phase, the dependencies may not exist on disk yet. # # Don't bump version manually. See `make release` docs in ./Makefile -__version__ = "1.4.5" +__version__ = "1.4.6" diff --git a/paasta_tools/api/api_docs/oapi.yaml b/paasta_tools/api/api_docs/oapi.yaml index 2a0aac64aa..a7ffb68434 100644 --- a/paasta_tools/api/api_docs/oapi.yaml +++ b/paasta_tools/api/api_docs/oapi.yaml @@ -339,6 +339,12 @@ components: InstanceSpecCassandraCluster: description: Cassandra instance spec type: object + InstanceMetadataVitessCluster: + description: VitessCluster instance metadata + type: object + InstanceSpecVitessCluster: + description: VitessCluster instance spec + type: object InstanceStatus: properties: adhoc: @@ -377,6 +383,14 @@ components: status: $ref: '#/components/schemas/InstanceStatusCassandraCluster' type: object + vitesscluster: + description: Nullable VitessCluster instance status and metadata + properties: + metadata: + $ref: '#/components/schemas/InstanceMetadataVitessCluster' + status: + $ref: '#/components/schemas/InstanceStatusVitessCluster' + type: object kafkacluster: description: Nullable KafkaCluster instance status and metadata properties: @@ -412,6 +426,9 @@ components: InstanceStatusCassandraCluster: description: Cassandra instance status type: object + InstanceStatusVitessCluster: + description: VitessCluster instance status + type: object InstanceStatusKafkaCluster: description: Kafka instance status type: object diff --git a/paasta_tools/api/api_docs/swagger.json b/paasta_tools/api/api_docs/swagger.json index 1f2d4a8c5d..7b0a30b051 100644 --- a/paasta_tools/api/api_docs/swagger.json +++ b/paasta_tools/api/api_docs/swagger.json @@ -953,6 +953,18 @@ } }, "description": "Nullable CassandraCluster instance status" + }, + "vitesscluster": { + "type": "object", + "properties": { + "status": { + "$ref": "#/definitions/InstanceStatusVitessCluster" + }, + "metadata": { + "$ref": "#/definitions/InstanceMetadataVitessCluster" + } + }, + "description": "Nullable VitessCluster instance status and metadata" } } }, @@ -1737,6 +1749,14 @@ "type": "object", "description": "Cassandra instance status" }, + "InstanceStatusVitessCluster": { + "type": "object", + "description": "VitessCluster instance status" + }, + "InstanceMetadataVitessCluster": { + "type": "object", + "description": "VitessCluster instance metadata" + }, "InstanceTasks": { "type": "array", "description": "List of tasks associated with instance", diff --git a/paasta_tools/cli/cmds/status.py b/paasta_tools/cli/cmds/status.py index 83370c03bc..61a26de038 100644 --- a/paasta_tools/cli/cmds/status.py +++ b/paasta_tools/cli/cmds/status.py @@ -37,6 +37,7 @@ from typing import Sequence from typing import Tuple from typing import Type +from typing import TypedDict from typing import Union import a_sync @@ -94,12 +95,14 @@ from paasta_tools.utils import PaastaColors from paasta_tools.utils import remove_ansi_escape_sequences from paasta_tools.utils import SystemPaastaConfig +from paasta_tools.vitesscluster_tools import VitessDeploymentConfig FLINK_STATUS_MAX_THREAD_POOL_WORKERS = 50 ALLOWED_INSTANCE_CONFIG: Sequence[Type[InstanceConfig]] = [ FlinkDeploymentConfig, FlinkEksDeploymentConfig, CassandraClusterDeploymentConfig, + VitessDeploymentConfig, KafkaClusterDeploymentConfig, KubernetesDeploymentConfig, EksDeploymentConfig, @@ -112,6 +115,7 @@ FlinkDeploymentConfig, FlinkEksDeploymentConfig, CassandraClusterDeploymentConfig, + VitessDeploymentConfig, KafkaClusterDeploymentConfig, KubernetesDeploymentConfig, EksDeploymentConfig, @@ -1878,6 +1882,250 @@ def print_kafka_status( return 0 +class EtcdLockServerStatus(TypedDict, total=False): + observedGeneration: int + available: str + clientServiceName: str + + +class LockServerStatus(TypedDict, total=False): + etcd: EtcdLockServerStatus + + +class VitessClusterCellStatus(TypedDict, total=False): + pendingChanges: str + gatewayAvailable: str + + +class VitessClusterKeyspaceStatus(TypedDict, total=False): + pendingChanges: str + cells: List[str] + desiredShards: int + shards: int + readyShards: int + updatedShards: int + desiredTablets: int + tablets: int + readyTablets: int + updatedTablets: int + + +class VitessDashboardStatus(TypedDict, total=False): + available: str + serviceName: str + + +class VTAdminStatus(TypedDict, total=False): + available: str + serviceName: str + + +class OrphanStatus(TypedDict, total=False): + reason: str + message: str + + +class VitessClusterStatus(TypedDict, total=False): + observedGeneration: int + globalLockserver: LockServerStatus + gatewayServiceName: str + vitessDashboard: VitessDashboardStatus + cells: Dict[str, VitessClusterCellStatus] + keyspaces: Dict[str, VitessClusterKeyspaceStatus] + vtadmin: VTAdminStatus + orphanedCells: Dict[str, OrphanStatus] + orphanedKeyspaces: Dict[str, OrphanStatus] + + +def print_vitess_status( + cluster: str, + service: str, + instance: str, + output: List[str], + vitess_status: Mapping[str, Any], + verbose: int = 0, +) -> int: + tab = " " + indent = 1 + + status: VitessClusterStatus = vitess_status.get("status") + if status is None: + output.append( + PaastaColors.red("indent * tab + Vitess cluster is not available yet") + ) + return 1 + + output.append(indent * tab + "Vitess Cluster:") + indent += 1 + + output.append( + indent * tab + + "Observed Generation: " + + str(status.get("observedGeneration", 0)) + ) + output.append( + indent * tab + "Gateway Service Name: " + status.get("gatewayServiceName", "") + ) + + output.append(indent * tab + "Cells:") + indent += 1 + cells: Dict[str, VitessClusterCellStatus] = status.get("cells") + if not cells: + output.append( + indent * tab + "Cells: " + PaastaColors.red("No cell status available") + ) + return 0 + for cell, cell_status in cells.items(): + gateway_available: str = cell_status.get("gatewayAvailable") + if gateway_available == "True": + output.append( + indent * tab + + f"Cell: {cell} - VTGate: {PaastaColors.green('available')}" + ) + else: + output.append( + indent * tab + + f"Cell: {cell} - VTGate: {PaastaColors.red('unavailable')}" + ) + cell_pending_changes: str = cell_status.get("pendingChanges", None) + if cell_pending_changes: + output.append(indent * tab + f" Pending Changes: {cell_pending_changes}") + indent -= 1 + + output.append(indent * tab + "Vitess Dashboard:") + indent += 1 + vitess_dashboard: VitessDashboardStatus = status.get("vitessDashboard") + if not vitess_dashboard: + output.append( + indent * tab + + "Vitess Dashboard: " + + PaastaColors.red("No dashboard status available") + ) + return 0 + vitess_dashboard_available: str = vitess_dashboard.get("available", "") + vitess_dashboard_service_name: str = vitess_dashboard.get("serviceName", "") + if vitess_dashboard_available == "True": + output.append( + indent * tab + + f"Vitess Dashboard: {vitess_dashboard_service_name} - {PaastaColors.green('available')}" + ) + else: + output.append( + indent * tab + + f"Vitess Dashboard: {vitess_dashboard_service_name} - {PaastaColors.red('unavailable')}" + ) + indent -= 1 + + output.append(indent * tab + "VTAdmin:") + indent += 1 + vtadmin: VTAdminStatus = status.get("vtadmin") + if not vtadmin: + output.append( + indent * tab + "VTAdmin: " + PaastaColors.red("No VTAdmin status available") + ) + return 0 + vtadmin_available: str = vtadmin.get("available", "") + vtadmin_service_name: str = vtadmin.get("serviceName", "") + if vtadmin_available == "True": + output.append( + indent * tab + + f"VTAdmin: {vtadmin_service_name} - {PaastaColors.green('available')}" + ) + else: + output.append( + indent * tab + + f"VTAdmin: {vtadmin_service_name} - {PaastaColors.red('unavailable')}" + ) + indent -= 1 + + output.append(indent * tab + "Keyspaces:") + indent += 1 + keyspaces: Dict[str, VitessClusterKeyspaceStatus] = status.get("keyspaces") + if not keyspaces: + output.append( + indent * tab + + "Keyspaces: " + + PaastaColors.red("No keyspace status available") + ) + return 0 + for keyspace, keyspace_status in keyspaces.items(): + output.append(indent * tab + f"Keyspace: {keyspace}") + indent += 1 + keyspace_pending_changes: str = keyspace_status.get("pendingChanges", None) + if keyspace_pending_changes: + output.append( + indent * tab + + f"Keyspace: {keyspace} - Pending Changes: {keyspace_pending_changes}" + ) + keyspace_cells: List[str] = keyspace_status.get("cells", []) + output.append(indent * tab + f" Cells: {', '.join(keyspace_cells)}") + desired_shards: int = keyspace_status.get("desiredShards", 0) + shards: int = keyspace_status.get("shards", 0) + ready_shards: int = keyspace_status.get("readyShards", 0) + updated_shards: int = keyspace_status.get("updatedShards", 0) + output.append( + indent * tab + + f" Shards: {shards} observed, {ready_shards}/{desired_shards} ready, {updated_shards}/{desired_shards} updated" + ) + desired_tablets: int = keyspace_status.get("desiredTablets", 0) + tablets: int = keyspace_status.get("tablets", 0) + ready_tablets: int = keyspace_status.get("readyTablets", 0) + updated_tablets: int = keyspace_status.get("updatedTablets", 0) + output.append( + indent * tab + + f" Tablets: {tablets} observed, {ready_tablets}/{desired_tablets} ready, {updated_tablets}/{desired_tablets} updated" + ) + indent -= 1 + indent -= 1 + + # This is not needed when not using etcd. We use zk instead + global_lockserver: LockServerStatus = status.get("globalLockserver", {}) + if global_lockserver: + output.append(indent * tab + "Global Lockserver:") + indent += 1 + etcd: EtcdLockServerStatus = global_lockserver.get("etcd") + if etcd: + output.append(indent * tab + "Global Lockserver:") + indent += 1 + observed_generation: int = etcd.get("observedGeneration", 0) + available: str = etcd.get("available", "") + client_service_name: str = etcd.get("clientServiceName", "") + output.append( + indent * tab + + f"Observed Generation: {observed_generation}, Available: {available}, Client Service Name: {client_service_name}" + ) + indent -= 1 + + # Orphaned Cells are not mandatorily seen each time + orphaned_cells: Dict[str, OrphanStatus] = status.get("orphanedCells", {}) + if orphaned_cells: + output.append(indent * tab + "Orphaned Cells:") + indent += 1 + for cell, orphan_status in orphaned_cells.items(): + orphaned_cell_reason: str = orphan_status.get("reason", "") + orphaned_cell_message: str = orphan_status.get("message", "") + output.append( + indent * tab + + f"Cell: {cell} - Reason: {orphaned_cell_reason}, Message: {orphaned_cell_message}" + ) + indent -= 1 + + # Orphaned Keyspaces are not mandatorily seen each time + orphaned_keyspaces: Dict[str, OrphanStatus] = status.get("orphanedKeyspaces", {}) + if orphaned_keyspaces: + output.append(indent * tab + "Orphaned Keyspaces:") + indent += 1 + for keyspace, orphan_status in orphaned_keyspaces.items(): + orphaned_keyspace_reason: str = orphan_status.get("reason", "") + orphaned_keyspace_message: str = orphan_status.get("message", "") + output.append( + indent * tab + + f"Keyspace: {keyspace} - Reason: {orphaned_keyspace_reason}, Message: {orphaned_keyspace_message}" + ) + indent -= 1 + return 0 + + def report_status_for_cluster( service: str, cluster: str, @@ -2273,4 +2521,5 @@ def _use_new_paasta_status(args, system_paasta_config) -> bool: flinkeks=print_flinkeks_status, kafkacluster=print_kafka_status, cassandracluster=print_cassandra_status, + vitesscluster=print_vitess_status, ) diff --git a/paasta_tools/paastaapi/model/instance_status.py b/paasta_tools/paastaapi/model/instance_status.py index 16f1478aa4..b010970a86 100644 --- a/paasta_tools/paastaapi/model/instance_status.py +++ b/paasta_tools/paastaapi/model/instance_status.py @@ -38,6 +38,7 @@ def lazy_import(): from paasta_tools.paastaapi.model.instance_status_kubernetes import InstanceStatusKubernetes from paasta_tools.paastaapi.model.instance_status_kubernetes_v2 import InstanceStatusKubernetesV2 from paasta_tools.paastaapi.model.instance_status_tron import InstanceStatusTron + from paasta_tools.paastaapi.model.instance_status_vitesscluster import InstanceStatusVitesscluster globals()['InstanceStatusAdhoc'] = InstanceStatusAdhoc globals()['InstanceStatusCassandracluster'] = InstanceStatusCassandracluster globals()['InstanceStatusFlink'] = InstanceStatusFlink @@ -45,6 +46,7 @@ def lazy_import(): globals()['InstanceStatusKubernetes'] = InstanceStatusKubernetes globals()['InstanceStatusKubernetesV2'] = InstanceStatusKubernetesV2 globals()['InstanceStatusTron'] = InstanceStatusTron + globals()['InstanceStatusVitesscluster'] = InstanceStatusVitesscluster class InstanceStatus(ModelNormal): @@ -100,6 +102,7 @@ def openapi_types(): 'version': (str,), # noqa: E501 'instance': (str,), # noqa: E501 'cassandracluster': (InstanceStatusCassandracluster,), # noqa: E501 + 'vitesscluster': (InstanceStatusVitesscluster,), # noqa: E501 'kafkacluster': (InstanceStatusKafkacluster,), # noqa: E501 'kubernetes': (InstanceStatusKubernetes,), # noqa: E501 'kubernetes_v2': (InstanceStatusKubernetesV2,), # noqa: E501 @@ -120,6 +123,7 @@ def discriminator(): 'version': 'version', # noqa: E501 'instance': 'instance', # noqa: E501 'cassandracluster': 'cassandracluster', # noqa: E501 + 'vitesscluster': 'vitesscluster', # noqa: E501 'kafkacluster': 'kafkacluster', # noqa: E501 'kubernetes': 'kubernetes', # noqa: E501 'kubernetes_v2': 'kubernetes_v2', # noqa: E501 @@ -180,6 +184,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 version (str): Deployment Version of a service. [optional] # noqa: E501 instance (str): Instance name. [optional] # noqa: E501 cassandracluster (InstanceStatusCassandracluster): [optional] # noqa: E501 + vitesscluster (InstanceStatusVitesscluster): [optional] # noqa: E501 kafkacluster (InstanceStatusKafkacluster): [optional] # noqa: E501 kubernetes (InstanceStatusKubernetes): [optional] # noqa: E501 kubernetes_v2 (InstanceStatusKubernetesV2): [optional] # noqa: E501 diff --git a/paasta_tools/paastaapi/model/instance_status_vitesscluster.py b/paasta_tools/paastaapi/model/instance_status_vitesscluster.py new file mode 100644 index 0000000000..4ad8cb1d43 --- /dev/null +++ b/paasta_tools/paastaapi/model/instance_status_vitesscluster.py @@ -0,0 +1,173 @@ +# coding: utf-8 + +""" + Paasta API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +import nulltype # noqa: F401 + +from paasta_tools.paastaapi.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class InstanceStatusVitesscluster(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + 'status': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'metadata': 'metadata', # noqa: E501 + 'status': 'status', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """InstanceStatusVitesscluster - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): VitessCluster instance metadata. [optional] # noqa: E501 + status ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): VitessCluster instance status. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/paasta_tools/paastaapi/models/__init__.py b/paasta_tools/paastaapi/models/__init__.py index edfcf07914..0d1278ee23 100644 --- a/paasta_tools/paastaapi/models/__init__.py +++ b/paasta_tools/paastaapi/models/__init__.py @@ -39,6 +39,7 @@ from paasta_tools.paastaapi.model.instance_status_kubernetes_autoscaling_status import InstanceStatusKubernetesAutoscalingStatus from paasta_tools.paastaapi.model.instance_status_kubernetes_v2 import InstanceStatusKubernetesV2 from paasta_tools.paastaapi.model.instance_status_tron import InstanceStatusTron +from paasta_tools.paastaapi.model.instance_status_vitesscluster import InstanceStatusVitesscluster from paasta_tools.paastaapi.model.instance_tasks import InstanceTasks from paasta_tools.paastaapi.model.integer_and_error import IntegerAndError from paasta_tools.paastaapi.model.kubernetes_container import KubernetesContainer diff --git a/paasta_tools/vitesscluster_tools.py b/paasta_tools/vitesscluster_tools.py index dec79b3cf9..51914a15ab 100644 --- a/paasta_tools/vitesscluster_tools.py +++ b/paasta_tools/vitesscluster_tools.py @@ -365,7 +365,7 @@ def get_tablet_pool_config( "throttle_metrics_query": f"select max_replication_delay from max_mysql_replication_delay.{throttle_query_table};", "throttle_metrics_threshold": throttle_metrics_threshold, "enforce-tableacl-config": "true", - "table-acl-config": f"/etc/srv/configs/vitess_keyspace_acls/acls_for_{db_name}.json", + "table-acl-config": f"/nail/srv/configs/vitess_keyspace_acls/acls_for_{db_name}.json", "table-acl-config-reload-interval": "60s", "queryserver-config-strict-table-acl": "true", "db-credentials-server": "vault", @@ -422,10 +422,15 @@ def get_tablet_pool_config( "readOnly": True, }, { - "mountPath": "/etc/srv", + "mountPath": "/nail/srv", "name": "srv-configs", "readOnly": True, }, + { + "mountPath": "/nail/etc/srv-configs", + "name": "etc-srv-configs", + "readOnly": True, + }, { "mountPath": "etc/credentials.yaml", "name": "vttablet-fake-credentials", @@ -443,6 +448,10 @@ def get_tablet_pool_config( "name": "srv-configs", "hostPath": {"path": "/nail/srv"}, }, + { + "name": "etc-srv-configs", + "hostPath": {"path": "/nail/etc/srv-configs"}, + }, {"name": "vttablet-fake-credentials", "hostPath": {"path": "/dev/null"}}, {"name": "keyspace-fake-init-script", "hostPath": {"path": "/dev/null"}}, ], @@ -841,8 +850,8 @@ def load_vitess_service_instance_configs( # TODO: read this from CRD in service configs def cr_id(service: str, instance: str) -> Mapping[str, str]: return dict( - group="yelp.com", - version="v1alpha1", + group="planetscale.com", + version="v2", namespace=KUBERNETES_NAMESPACE, plural="vitessclusters", name=sanitised_cr_name(service, instance), diff --git a/tests/test_vitesscluster_tools.py b/tests/test_vitesscluster_tools.py index 1db55914ee..0cfa6af1a4 100644 --- a/tests/test_vitesscluster_tools.py +++ b/tests/test_vitesscluster_tools.py @@ -251,10 +251,15 @@ "readOnly": True, }, { - "mountPath": "/etc/srv", + "mountPath": "/nail/srv", "name": "srv-configs", "readOnly": True, }, + { + "mountPath": "/nail/etc/srv-configs", + "name": "etc-srv-configs", + "readOnly": True, + }, { "mountPath": "etc/credentials.yaml", "name": "vttablet-fake-credentials", @@ -274,8 +279,14 @@ "name": "vault-secrets", }, { - "hostPath": {"path": "/nail/srv"}, "name": "srv-configs", + "hostPath": {"path": "/nail/srv"}, + }, + { + "name": "etc-srv-configs", + "hostPath": { + "path": "/nail/etc/srv-configs" + }, }, { "hostPath": {"path": "/dev/null"}, @@ -307,7 +318,7 @@ "log_err_stacks": "true", "queryserver-config-schema-reload-time": "1800", "queryserver-config-strict-table-acl": "true", - "table-acl-config": "/etc/srv/configs/vitess_keyspace_acls/acls_for_fake_keyspaces.json", + "table-acl-config": "/nail/srv/configs/vitess_keyspace_acls/acls_for_fake_keyspaces.json", "table-acl-config-reload-interval": "60s", "throttle_check_as_check_self": "true", "throttle_metrics_query": "select " @@ -424,10 +435,15 @@ "readOnly": True, }, { - "mountPath": "/etc/srv", + "mountPath": "/nail/srv", "name": "srv-configs", "readOnly": True, }, + { + "mountPath": "/nail/etc/srv-configs", + "name": "etc-srv-configs", + "readOnly": True, + }, { "mountPath": "etc/credentials.yaml", "name": "vttablet-fake-credentials", @@ -447,8 +463,14 @@ "name": "vault-secrets", }, { - "hostPath": {"path": "/nail/srv"}, "name": "srv-configs", + "hostPath": {"path": "/nail/srv"}, + }, + { + "name": "etc-srv-configs", + "hostPath": { + "path": "/nail/etc/srv-configs" + }, }, { "hostPath": {"path": "/dev/null"}, @@ -480,7 +502,7 @@ "log_err_stacks": "true", "queryserver-config-schema-reload-time": "1800", "queryserver-config-strict-table-acl": "true", - "table-acl-config": "/etc/srv/configs/vitess_keyspace_acls/acls_for_fake_keyspaces.json", + "table-acl-config": "/nail/srv/configs/vitess_keyspace_acls/acls_for_fake_keyspaces.json", "table-acl-config-reload-interval": "60s", "throttle_check_as_check_self": "true", "throttle_metrics_query": "select " diff --git a/yelp_package/Makefile b/yelp_package/Makefile index ad70712887..b77c627291 100644 --- a/yelp_package/Makefile +++ b/yelp_package/Makefile @@ -13,7 +13,7 @@ # limitations under the License. # Edit this release and run "make release" -RELEASE=1.4.5 +RELEASE=1.4.6 SHELL=/bin/bash