Skip to content

Commit d3a9552

Browse files
Merge pull request #93 from ma-hill/HYPERFLEET-839
HYPERFLEET-839 - fix: update additional docs/scripts to explicitly se…
2 parents 3f47690 + 7ac161e commit d3a9552

2 files changed

Lines changed: 27 additions & 12 deletions

File tree

deploy-scripts/lib/gcp.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
# gcp.sh - Google Cloud Platform resource management functions
44
#
55
# This module handles discovery and cleanup of GCP resources (Pub/Sub topics and subscriptions)
6-
# created during deployment
6+
# created during deployment.
7+
#
8+
# NAMESPACE requirements
9+
# - Must be unique to prevent Pub/Sub topic/subscription collisions across deployments
10+
# - Must be DNS-1123 compliant (lowercase alphanumeric, hyphens, start/end with alphanumeric)
11+
# - Default: hyperfleet-e2e-$USER (when using .env configuration)
712

813
# ============================================================================
914
# Constants
@@ -48,10 +53,11 @@ discover_pubsub_topics() {
4853
fi
4954

5055
# List topics that match the namespace pattern
56+
# NAMESPACE must be unique and DNS-1123 compliant (default: hyperfleet-e2e-$USER when using .env)
5157
# Topics are named:
52-
# - ${NAMESPACE}-${resource_type} (e.g., hyperfleet-e2e-clusters, hyperfleet-e2e-nodepools)
53-
# - ${NAMESPACE}-${resource_type}-dlq (e.g., hyperfleet-e2e-clusters-dlq)
54-
# - ${NAMESPACE}-${resource_type}-${adapter_name}-dlq (e.g., testb-clusters-cl-namespace-dlq) - ACTUAL (Temporary))
58+
# - ${NAMESPACE}-${resource_type} (e.g., hyperfleet-e2e-jdoe-clusters, hyperfleet-e2e-jdoe-nodepools)
59+
# - ${NAMESPACE}-${resource_type}-dlq (e.g., hyperfleet-e2e-jdoe-clusters-dlq)
60+
# - ${NAMESPACE}-${resource_type}-${adapter_name}-dlq (e.g., hyperfleet-e2e-jdoe-clusters-adapter1-dlq)
5561
local topics=()
5662
local all_topics
5763

@@ -114,8 +120,9 @@ discover_pubsub_subscriptions() {
114120
fi
115121

116122
# List subscriptions that match the namespace pattern
123+
# NAMESPACE must be unique and DNS-1123 compliant (default: hyperfleet-e2e-$USER when using .env)
117124
# Subscriptions are named: ${NAMESPACE}-${resource_type}-${adapter_name}
118-
# Example: hyperfleet-e2e-clusters-example1-namespace, hyperfleet-e2e-nodepools-validation
125+
# Example: hyperfleet-e2e-jdoe-clusters-adapter1, <unique-namespace>-clusters-adapter1
119126
local subscriptions=()
120127
local all_subscriptions
121128

docs/runbook.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@ export NODEPOOL_TIER0_ADAPTERS_DEPLOYMENT="${NODEPOOL_TIER0_ADAPTERS_DEPLOYMENT:
153153
# Adapters for API cluster/nodepool configuration
154154
export API_ADAPTERS_CLUSTER="${API_ADAPTERS_CLUSTER:-cl-namespace,cl-job,cl-deployment,cl-maestro}"
155155
export API_ADAPTERS_NODEPOOL="${API_ADAPTERS_NODEPOOL:-np-configmap}"
156+
157+
158+
# NAMESPACE must be unique to prevent GCP Pub/Sub topic/subscription collisions.
159+
# Set in the .env.example file as:
160+
export NAMESPACE="${NAMESPACE:-hyperfleet-e2e-$(echo ${USER:-default} | tr '[:upper:]' '[:lower:]')}"
161+
# Or can manually set it with as the namespace is DNS-1123 compliant
162+
export NAMESPACE=<unique_namespace>
163+
156164
```
157165

158166
#### Verify Deployment
@@ -261,8 +269,8 @@ The following tools are available to help debug and interact with HyperFleet com
261269
**Important:** Set the `NAMESPACE` environment variable to match the namespace used during deployment. Some test cases deploy adapters dynamically and need to target the same namespace where your HyperFleet components are running.
262270

263271
```bash
264-
# Set NAMESPACE if you deployed to a custom namespace
265-
export NAMESPACE=my-custom-namespace
272+
# Set NAMESPACE if you deployed to a unique namespace
273+
export NAMESPACE=<unique_namespace>
266274
./bin/hyperfleet-e2e test --label-filter=tier0
267275
```
268276

@@ -281,7 +289,7 @@ Unexpected error:
281289

282290
1. **Check if all pods are running:**
283291
```bash
284-
kubectl get pods -n hyperfleet-e2e
292+
kubectl get pods -n ${NAMESPACE}
285293
```
286294

287295
Expected output - all pods should show `Running` with `READY 1/1`:
@@ -296,13 +304,13 @@ Unexpected error:
296304
2. **Check pod logs for errors:**
297305
```bash
298306
# Check API logs
299-
kubectl logs -n hyperfleet-e2e deployment/hyperfleet-api --tail=50
307+
kubectl logs -n ${NAMESPACE} deployment/hyperfleet-api --tail=50
300308

301309
# Check Sentinel logs
302-
kubectl logs -n hyperfleet-e2e deployment/hyperfleet-sentinel --tail=50
310+
kubectl logs -n ${NAMESPACE} deployment/hyperfleet-sentinel --tail=50
303311

304312
# Check adapter logs
305-
kubectl logs -n hyperfleet-e2e deployment/cl-namespace-adapter --tail=50
313+
kubectl logs -n ${NAMESPACE} deployment/cl-namespace-adapter --tail=50
306314
```
307315

308316
3. **Verify API connectivity:**
@@ -314,7 +322,7 @@ Unexpected error:
314322
4. **Check service endpoints:**
315323
```bash
316324
# Verify LoadBalancer has external IP
317-
kubectl get svc -n hyperfleet-e2e hyperfleet-api
325+
kubectl get svc -n ${NAMESPACE} hyperfleet-api
318326
```
319327

320328

0 commit comments

Comments
 (0)