Skip to content

Commit

Permalink
Add --generate-mesh-id-experimental flag to server bootstrap (#24)
Browse files Browse the repository at this point in the history
This flag has been added to the client deployment but not the server
deployment. Adding it to server now.

We need this fix in order for the CSM Observability Test to properly
record the server side metrics.

---------

Co-authored-by: Sergii Tkachenko <sergiitk@google.com>
  • Loading branch information
stanley-cheung and sergiitk authored Jan 26, 2024
1 parent 57cb40f commit c311b79
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions framework/test_app/runners/k8s/gamma_server_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def run( # pylint: disable=arguments-differ
bootstrap_version: Optional[str] = None,
route_template: str = "gamma/route_http.yaml",
enable_csm_observability: bool = False,
generate_mesh_id: bool = False,
) -> List[XdsTestServer]:
if not maintenance_port:
maintenance_port = self._get_default_maintenance_port(secure_mode)
Expand Down Expand Up @@ -208,6 +209,7 @@ def run( # pylint: disable=arguments-differ
termination_grace_period_seconds=self.termination_grace_period_seconds,
pre_stop_hook=self.pre_stop_hook,
enable_csm_observability=enable_csm_observability,
generate_mesh_id=generate_mesh_id,
)

servers = self._make_servers_for_deployment(
Expand Down
10 changes: 9 additions & 1 deletion framework/xds_gamma_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
import datetime
import logging
from typing import Optional
from typing import List, Optional

from framework.infrastructure import k8s
import framework.infrastructure.traffic_director_gamma as td_gamma
Expand Down Expand Up @@ -139,3 +139,11 @@ def startTestClient(
wait_for_server_channel_ready_timeout=datetime.timedelta(minutes=9),
**kwargs,
)

def startTestServers(
self, replica_count=1, server_runner=None, **kwargs
) -> List[XdsTestServer]:
kwargs.setdefault("generate_mesh_id", True)
return super().startTestServers(
replica_count=replica_count, server_runner=server_runner, **kwargs
)
3 changes: 3 additions & 0 deletions kubernetes-manifests/server.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ spec:
% else:
- "--node-metadata=app=${namespace_name}-${deployment_name}"
% endif
% if generate_mesh_id:
- "--generate-mesh-id-experimental"
% endif
resources:
limits:
cpu: 100m
Expand Down

0 comments on commit c311b79

Please sign in to comment.