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

csm: modify o11y test to use proxyless bootstrap injector #141

Merged
merged 12 commits into from
Dec 4, 2024
2 changes: 1 addition & 1 deletion .kokoro/psm_interop_kokoro_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ activate_gke_cluster() {
GKE_CLUSTER_ZONE="us-central1-a"
;;
GKE_CLUSTER_PSM_CSM)
GKE_CLUSTER_NAME="psm-interop-csm"
GKE_CLUSTER_NAME="psm-interop-csm-gateway"
GKE_CLUSTER_REGION="us-central1"
;;
GKE_CLUSTER_PSM_GAMMA)
Expand Down
63 changes: 63 additions & 0 deletions kubernetes-manifests/gamma/client.deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${deployment_name}
namespace: ${namespace_name}
labels:
app: ${app_label}
deployment_id: ${deployment_id}
owner: xds-k8s-interop-test
spec:
replicas: 1
selector:
matchLabels:
app: ${app_label}
deployment_id: ${deployment_id}
template:
metadata:
labels:
app: ${app_label}
deployment_id: ${deployment_id}
owner: xds-k8s-interop-test
spec:
% if service_account_name:
serviceAccountName: ${service_account_name}
% endif
containers:
- name: ${deployment_name}
image: ${image_name}
imagePullPolicy: Always
startupProbe:
tcpSocket:
port: ${stats_port}
periodSeconds: 3
## Extend the number of probes well beyond the duration of the test
## driver waiting for the container to start.
failureThreshold: 1000
args:
- "--server=${server_target}"
- "--stats_port=${stats_port}"
- "--qps=${qps}"
- "--rpc=${rpc}"
- "--metadata=${metadata}"
% if request_payload_size > 0:
- "--request_payload_size=${request_payload_size}"
% endif
% if response_payload_size > 0:
- "--response_payload_size=${response_payload_size}"
% endif
- "--print_response=${print_response}"
% if enable_csm_observability:
- "--enable_csm_observability=true"
% endif
ports:
- containerPort: ${stats_port}
resources:
limits:
cpu: 800m
memory: 512Mi
requests:
cpu: 100m
memory: 512Mi
...
10 changes: 10 additions & 0 deletions kubernetes-manifests/gamma/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: ${namespace_name}
labels:
name: ${namespace_name}
owner: xds-k8s-interop-test
mesh.cloud.google.com/csm-injection: proxyless
...
61 changes: 61 additions & 0 deletions kubernetes-manifests/gamma/server.deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${deployment_name}
namespace: ${namespace_name}
labels:
app: ${app_label}
deployment_id: ${deployment_id}
owner: xds-k8s-interop-test
spec:
replicas: ${replica_count}
selector:
matchLabels:
app: ${app_label}
deployment_id: ${deployment_id}
template:
metadata:
labels:
app: ${app_label}
deployment_id: ${deployment_id}
owner: xds-k8s-interop-test
spec:
% if service_account_name:
serviceAccountName: ${service_account_name}
% endif
% if termination_grace_period_seconds:
terminationGracePeriodSeconds: ${termination_grace_period_seconds}
% endif
containers:
- name: ${deployment_name}
image: ${image_name}
imagePullPolicy: Always
# TODO:(lsafran) test without this when ipv6 HC fw rules are in place
arvindbr8 marked this conversation as resolved.
Show resolved Hide resolved
% if address_type != "ipv6":
startupProbe:
tcpSocket:
port: ${test_port}
periodSeconds: 3
## Extend the number of probes well beyond the duration of the test
## driver waiting for the container to start.
failureThreshold: 1000
% endif
args:
- "--port=${test_port}"
% if enable_csm_observability:
- "--enable_csm_observability=true"
% endif
% if address_type:
- "--address_type=${address_type}"
% endif
ports:
- containerPort: ${test_port}
resources:
limits:
cpu: 800m
memory: 512Mi
requests:
cpu: 100m
memory: 512Mi
...
10 changes: 8 additions & 2 deletions tests/gamma/csm_observability_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ def initKubernetesClientRunner(self, **kwargs) -> KubernetesClientRunner:
enable_csm_observability=True,
csm_workload_name=CSM_WORKLOAD_NAME_CLIENT,
csm_canonical_service_name=CSM_CANONICAL_SERVICE_NAME_CLIENT,
)
),
namespace_template="gamma/namespace.yaml",
deployment_template="gamma/client.deployment.yaml",
)

# These parameters are more pertaining to the test itself, not to
Expand All @@ -204,7 +206,9 @@ def initKubernetesServerRunner(self, **kwargs) -> GammaServerRunner:
enable_csm_observability=True,
csm_workload_name=CSM_WORKLOAD_NAME_SERVER,
csm_canonical_service_name=CSM_CANONICAL_SERVICE_NAME_SERVER,
)
),
namespace_template="gamma/namespace.yaml",
deployment_template="gamma/server.deployment.yaml",
)

def test_csm_observability(self):
Expand Down Expand Up @@ -284,6 +288,7 @@ def test_csm_observability(self):
# values
with self.subTest("7_check_metrics_labels_histogram_client"):
expected_metric_labels = {
# TODO(arvindbright): Add assetion to CSM_MESH_ID
"csm_mesh_id": ANY,
"csm_remote_workload_canonical_service": CSM_CANONICAL_SERVICE_NAME_SERVER,
"csm_remote_workload_cluster_name": ANY,
Expand Down Expand Up @@ -315,6 +320,7 @@ def test_csm_observability(self):
# values
with self.subTest("8_check_metrics_labels_histogram_server"):
expected_metric_labels = {
# TODO(arvindbright): Add assetion to CSM_MESH_ID
"csm_mesh_id": ANY,
"csm_remote_workload_canonical_service": CSM_CANONICAL_SERVICE_NAME_CLIENT,
"csm_remote_workload_cluster_name": ANY,
Expand Down