From 5bcc8af724274ab770dd0db7fed347c675fa682f Mon Sep 17 00:00:00 2001 From: mahmut Date: Fri, 12 Jun 2026 21:18:53 +0800 Subject: [PATCH] fix(deploy): align kubernetes manifests with chart names --- configs/controlplane/config.yaml | 4 +-- deploy/README.md | 27 ++++++++---------- .../kubernetes/addons/dataplane-hpa/hpa.yaml | 4 +-- deploy/kubernetes/base/controlplane.yaml | 20 ++++++------- deploy/kubernetes/base/dataplane.yaml | 20 ++++++------- deploy/kubernetes/base/kustomization.yaml | 4 +-- .../base/namespace-gatewayclass.yaml | 2 +- deploy/kubernetes/base/rbac.yaml | 12 ++++---- .../base/services-networkpolicy.yaml | 28 +++++++++---------- .../kind-conformance/controlplane-config.yaml | 2 +- .../kind-conformance/dataplane-config.yaml | 2 +- .../kind-conformance/kustomization.yaml | 6 ++-- .../patch-dataplane-hostnetwork.yaml | 4 +-- .../overlays/kind/controlplane-replicas.yaml | 2 +- .../overlays/kind/dataplane-replicas.yaml | 2 +- .../kubernetes/overlays/production/README.md | 2 +- ...ontrolplane-admin-auth.secret.example.yaml | 2 +- ...ntrolplane-alert-rules.prometheusrule.yaml | 4 +-- .../controlplane-grpc-tls.secret.example.yaml | 2 +- .../dataplane-admin-auth.secret.example.yaml | 2 +- .../overlays/production/dataplane-config.yaml | 4 +-- ...ne-session-persistence.secret.example.yaml | 2 +- .../dataplane-xds-tls.secret.example.yaml | 2 +- .../patch-controlplane-deployment.yaml | 8 +++--- .../patch-dataplane-deployment.yaml | 8 +++--- ...ngora-gateway-observability-dashboard.json | 16 +++++------ deploy/observability/prometheus/README.md | 26 ++++++++--------- .../prometheus-controlplane-scrape.yaml | 8 +++--- .../native/prometheus-dataplane-rules.yaml | 16 +++++------ .../native/prometheus-dataplane-scrape.yaml | 12 ++++---- .../networkpolicy-prometheus-scrape.yaml | 4 +-- .../operator/podmonitor-controlplane.yaml | 4 +-- .../operator/podmonitor-dataplane.yaml | 6 ++-- .../operator/prometheusrule-dataplane.yaml | 18 ++++++------ .../secret-dataplane-admin-token.example.yaml | 2 +- .../operator/servicemonitor-controlplane.yaml | 2 +- .../operator/servicemonitor-dataplane.yaml | 4 +-- internal/admin/dataplane_client_test.go | 2 +- internal/admin/dataplane_discovery_test.go | 6 ++-- internal/admin/server_chatbot_test.go | 2 +- internal/admin/server_infrastructure_test.go | 2 +- internal/admin/server_test.go | 2 +- internal/infrastructure/defaults_test.go | 17 +++++++++++ .../frontend_eligibility_test.go | 4 +-- .../frontend_endpoint_slice_ownerrefs_test.go | 2 +- .../inspector_benchmark_test.go | 2 +- internal/infrastructure/inspector_test.go | 8 +++--- .../mesh_services_benchmark_test.go | 2 +- internal/infrastructure/networkpolicies.go | 2 +- internal/infrastructure/reconciler.go | 4 +-- .../infrastructure/reconciler_cleanup_test.go | 2 +- .../infrastructure/reconciler_core_test.go | 4 +-- .../reconciler_gateway_services_test.go | 6 ++-- .../reconciler_mesh_scoped_queries_test.go | 2 +- .../infrastructure/reconciler_mesh_test.go | 24 ++++++++-------- .../reconciler_ownership_test.go | 4 +-- .../reconciler_parameters_test.go | 6 ++-- 57 files changed, 204 insertions(+), 192 deletions(-) create mode 100644 internal/infrastructure/defaults_test.go diff --git a/configs/controlplane/config.yaml b/configs/controlplane/config.yaml index 25d000c3..d2ca224f 100644 --- a/configs/controlplane/config.yaml +++ b/configs/controlplane/config.yaml @@ -28,7 +28,7 @@ adminRuntime: writeTimeout: "30s" idleTimeout: "2m" dataplaneAggregation: - serviceName: "nantian-dataplane-admin" + serviceName: "nantian-gw-dataplane-admin" namespace: "nantian-gw" portName: "admin" timeout: "2s" @@ -55,7 +55,7 @@ adminAuth: dashboardApi: enabled: true basePath: "/api/dashboard" - dataplaneAdminUrl: "http://nantian-dataplane-admin.nantian-gw.svc.cluster.local:19080" + dataplaneAdminUrl: "http://nantian-gw-dataplane-admin.nantian-gw.svc.cluster.local:19080" requestTimeout: "5s" resourceMutationsEnabled: true pprof: diff --git a/deploy/README.md b/deploy/README.md index ac3e8b72..c72334b8 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -92,12 +92,7 @@ Fixed Service roles currently include: - `admin` - `metrics` -The only fixed Service renamed in this refactor is the controlplane gRPC Service: - -- Old name: `nantian-controlplane` -- New name: `nantian-controlplane-grpc` - -This aligns with the naming style of `-admin` and `-metrics`, so you no longer have to guess whether it's the workload itself when reading directories or troubleshooting. +Static install resources now use the `nantian-gw-` prefix consistently. Fixed Services use `nantian-gw--`, so controlplane and dataplane admin, metrics, and gRPC endpoints are distinguishable from their workloads when reading directories or troubleshooting. Additionally, fixed static resources now include standard `app.kubernetes.io/*` labels wherever possible. If you use `kubectl get all --show-labels` or filter by labels in the cluster, it is now easier to distinguish controlplane, dataplane, and fixed Service roles than before. @@ -106,16 +101,16 @@ If you use `kubectl get all --show-labels` or filter by labels in the cluster, i | Service | Port | Purpose | Who Accesses It | | --- | --- | --- | --- | -| `nantian-controlplane-grpc` | `18080` | controlplane gRPC / xDS publish entry | dataplane | -| `nantian-controlplane-admin` | `18081` | controlplane admin API | Ops entry, `kubectl port-forward`, controlled proxies | -| `nantian-controlplane-metrics` | `18082` | controlplane metrics scrape entry | Prometheus or other scrapers | -| `nantian-dataplane-admin` | `19080` | dataplane admin API | Ops entry, `kubectl port-forward`, controlled proxies | -| `nantian-dataplane-metrics` | `19080` | dataplane metrics scrape entry, currently reuses admin server port | Prometheus or other scrapers | +| `nantian-gw-controlplane-grpc` | `18080` | controlplane gRPC / xDS publish entry | dataplane | +| `nantian-gw-controlplane-admin` | `18081` | controlplane admin API | Ops entry, `kubectl port-forward`, controlled proxies | +| `nantian-gw-controlplane-metrics` | `18082` | controlplane metrics scrape entry | Prometheus or other scrapers | +| `nantian-gw-dataplane-admin` | `19080` | dataplane admin API | Ops entry, `kubectl port-forward`, controlled proxies | +| `nantian-gw-dataplane-metrics` | `19080` | dataplane metrics scrape entry, currently reuses admin server port | Prometheus or other scrapers | | `nantian-gw-dashboard` | `8080` | Web admin console, Node server serves SPA and same-origin proxies admin API | Ops entry, `kubectl port-forward`, controlled proxies | Notes: -- `nantian-dataplane-metrics` and `nantian-dataplane-admin` both currently point to the dataplane `admin` port; the difference lies in purpose and scrape entry point, not in backend port numbers. +- `nantian-gw-dataplane-metrics` and `nantian-gw-dataplane-admin` both currently point to the dataplane `admin` port; the difference lies in purpose and scrape entry point, not in backend port numbers. - `nantian-gw-dashboard` does not directly access the Kubernetes API; it only proxies controlplane / dataplane admin Services through the container-internal Node server. - These Services are all part of the fixed static manifest and are suitable for writing into operations documentation, scripts, and monitoring configurations. - These fixed Services are all part of the base static manifest, currently defined in `deploy/kubernetes/base/services-networkpolicy.yaml`, not dynamically generated runtime objects. @@ -140,12 +135,12 @@ The two most important dynamic Services currently are: | Service | Source | Default Type | Purpose | Carries Business Traffic? | | --- | --- | --- | --- | --- | -| `nantian-dataplane` | shared dataplane Service | `NodePort` | Aggregates all current Gateway listener ports, providing a unified frontend entry for the dataplane | Yes | +| `nantian-gw-dataplane` | shared dataplane Service | `NodePort` | Aggregates all current Gateway listener ports, providing a unified frontend entry for the dataplane | Yes | | `nantian-gw-` | per-Gateway Service | `ClusterIP` | Dedicated frontend Service for a single Gateway, individually exposable per Gateway infrastructure parameters | Yes | Notes: -- `nantian-dataplane` is the shared frontend entry; current Kind smoke defaults to using it. +- `nantian-gw-dataplane` is the shared frontend entry; current Kind smoke defaults to using it. - `nantian-gw-` is a dedicated Service derived from the Gateway name; for example, if the `Gateway` is named `edge`, the corresponding Service is typically `nantian-gw-edge`. - per-Gateway Services default to `ClusterIP`, but can be lowered to `NodePort` or `LoadBalancer` via `Gateway.spec.infrastructure.parametersRef`, making them the more natural north-south exposure point in long-term environments. - These objects are maintained by the control plane reconcile loop and are not static install assets from `deploy/kubernetes/base/`. @@ -179,7 +174,7 @@ The most easily confused aspect of the current repository is that the entries se | Scenario | Default Entry | Notes | | --- | --- | --- | -| Kind / smoke | `nantian-dataplane` | Shared dataplane Service uses `NodePort`; Kind overlay maps HTTP `18080`, HTTPS/TLS `18443`, UDP `5300` / `5301`, TCPRoute `19000` / `19001` by default | +| Kind / smoke | `nantian-gw-dataplane` | Shared dataplane Service uses `NodePort`; Kind overlay maps HTTP `18080`, HTTPS/TLS `18443`, UDP `5300` / `5301`, TCPRoute `19000` / `19001` by default | | Long-term / production | `nantian-gw-` | Better to expose per Gateway individually, then control `ClusterIP` / `NodePort` / `LoadBalancer` via `parametersRef` | So if you see locally: @@ -212,4 +207,4 @@ If you're troubleshooting "why doesn't a certain Gateway have an external addres - Grafana observability dashboard: Use `deploy/observability/grafana/nantian-gw-observability-dashboard.json` -If you are choosing a business traffic entry point rather than an install entry point, see `docs/user/traffic-profiles.md`. That document provides north-south HTTP/gRPC, north-south TCP/UDP, and east-west service parent examples separately. \ No newline at end of file +If you are choosing a business traffic entry point rather than an install entry point, see `docs/user/traffic-profiles.md`. That document provides north-south HTTP/gRPC, north-south TCP/UDP, and east-west service parent examples separately. diff --git a/deploy/kubernetes/addons/dataplane-hpa/hpa.yaml b/deploy/kubernetes/addons/dataplane-hpa/hpa.yaml index 287d5c5a..db8800ca 100644 --- a/deploy/kubernetes/addons/dataplane-hpa/hpa.yaml +++ b/deploy/kubernetes/addons/dataplane-hpa/hpa.yaml @@ -1,7 +1,7 @@ apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: - name: nantian-dataplane + name: nantian-gw-dataplane namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw @@ -12,7 +12,7 @@ spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: nantian-dataplane + name: nantian-gw-dataplane minReplicas: 2 maxReplicas: 10 metrics: diff --git a/deploy/kubernetes/base/controlplane.yaml b/deploy/kubernetes/base/controlplane.yaml index 36e14067..ef22a445 100644 --- a/deploy/kubernetes/base/controlplane.yaml +++ b/deploy/kubernetes/base/controlplane.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: nantian-controlplane + name: nantian-gw-controlplane namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw @@ -19,16 +19,16 @@ spec: maxUnavailable: 0 selector: matchLabels: - app: nantian-controlplane + app: nantian-gw-controlplane template: metadata: labels: - app: nantian-controlplane + app: nantian-gw-controlplane app.kubernetes.io/name: nantian-gw app.kubernetes.io/part-of: nantian-gw app.kubernetes.io/component: controlplane spec: - serviceAccountName: nantian-controlplane + serviceAccountName: nantian-gw-controlplane terminationGracePeriodSeconds: 30 securityContext: runAsNonRoot: true @@ -43,7 +43,7 @@ spec: whenUnsatisfiable: ScheduleAnyway labelSelector: matchLabels: - app: nantian-controlplane + app: nantian-gw-controlplane containers: - name: controlplane image: nantian-controlplane:dev @@ -110,20 +110,20 @@ spec: volumes: - name: config configMap: - name: nantian-controlplane-config + name: nantian-gw-controlplane-config - name: grpc-tls secret: - secretName: nantian-controlplane-grpc-tls + secretName: nantian-gw-controlplane-grpc-tls optional: true - name: admin-auth secret: - secretName: nantian-controlplane-admin-auth + secretName: nantian-gw-controlplane-admin-auth optional: true --- apiVersion: policy/v1 kind: PodDisruptionBudget metadata: - name: nantian-controlplane + name: nantian-gw-controlplane namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw @@ -133,4 +133,4 @@ spec: minAvailable: 1 selector: matchLabels: - app: nantian-controlplane + app: nantian-gw-controlplane diff --git a/deploy/kubernetes/base/dataplane.yaml b/deploy/kubernetes/base/dataplane.yaml index cc725ab3..bc5d1e9f 100644 --- a/deploy/kubernetes/base/dataplane.yaml +++ b/deploy/kubernetes/base/dataplane.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: nantian-dataplane + name: nantian-gw-dataplane namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw @@ -19,16 +19,16 @@ spec: maxUnavailable: 0 selector: matchLabels: - app: nantian-dataplane + app: nantian-gw-dataplane template: metadata: labels: - app: nantian-dataplane + app: nantian-gw-dataplane app.kubernetes.io/name: nantian-gw app.kubernetes.io/part-of: nantian-gw app.kubernetes.io/component: dataplane spec: - serviceAccountName: nantian-dataplane + serviceAccountName: nantian-gw-dataplane automountServiceAccountToken: false terminationGracePeriodSeconds: 30 securityContext: @@ -47,7 +47,7 @@ spec: whenUnsatisfiable: ScheduleAnyway labelSelector: matchLabels: - app: nantian-dataplane + app: nantian-gw-dataplane containers: - name: dataplane image: nantian-dataplane:dev @@ -114,14 +114,14 @@ spec: volumes: - name: config configMap: - name: nantian-dataplane-config + name: nantian-gw-dataplane-config - name: xds-tls secret: - secretName: nantian-dataplane-xds-tls + secretName: nantian-gw-dataplane-xds-tls optional: true - name: admin-auth secret: - secretName: nantian-dataplane-admin-auth + secretName: nantian-gw-dataplane-admin-auth optional: true - name: tmp emptyDir: @@ -130,7 +130,7 @@ spec: apiVersion: policy/v1 kind: PodDisruptionBudget metadata: - name: nantian-dataplane + name: nantian-gw-dataplane namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw @@ -140,4 +140,4 @@ spec: minAvailable: 1 selector: matchLabels: - app: nantian-dataplane + app: nantian-gw-dataplane diff --git a/deploy/kubernetes/base/kustomization.yaml b/deploy/kubernetes/base/kustomization.yaml index 78c5d8d2..aa3ed484 100644 --- a/deploy/kubernetes/base/kustomization.yaml +++ b/deploy/kubernetes/base/kustomization.yaml @@ -16,11 +16,11 @@ generatorOptions: disableNameSuffixHash: true configMapGenerator: - - name: nantian-controlplane-config + - name: nantian-gw-controlplane-config namespace: nantian-gw files: - config.yaml=../../../configs/controlplane/config.yaml - - name: nantian-dataplane-config + - name: nantian-gw-dataplane-config namespace: nantian-gw files: - config.yaml=../../../configs/dataplane/config.yaml \ No newline at end of file diff --git a/deploy/kubernetes/base/namespace-gatewayclass.yaml b/deploy/kubernetes/base/namespace-gatewayclass.yaml index 5b6a6757..6ac4582d 100644 --- a/deploy/kubernetes/base/namespace-gatewayclass.yaml +++ b/deploy/kubernetes/base/namespace-gatewayclass.yaml @@ -9,7 +9,7 @@ metadata: apiVersion: gateway.networking.k8s.io/v1 kind: GatewayClass metadata: - name: nantian + name: nantian-gw labels: app.kubernetes.io/name: nantian-gw app.kubernetes.io/part-of: nantian-gw diff --git a/deploy/kubernetes/base/rbac.yaml b/deploy/kubernetes/base/rbac.yaml index abee4177..98b90bbe 100644 --- a/deploy/kubernetes/base/rbac.yaml +++ b/deploy/kubernetes/base/rbac.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: nantian-controlplane + name: nantian-gw-controlplane namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw @@ -11,7 +11,7 @@ metadata: apiVersion: v1 kind: ServiceAccount metadata: - name: nantian-dataplane + name: nantian-gw-dataplane namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw @@ -22,7 +22,7 @@ automountServiceAccountToken: false apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: nantian-controlplane + name: nantian-gw-controlplane labels: app.kubernetes.io/name: nantian-gw app.kubernetes.io/part-of: nantian-gw @@ -80,7 +80,7 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: nantian-controlplane + name: nantian-gw-controlplane labels: app.kubernetes.io/name: nantian-gw app.kubernetes.io/part-of: nantian-gw @@ -88,8 +88,8 @@ metadata: roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: nantian-controlplane + name: nantian-gw-controlplane subjects: - kind: ServiceAccount - name: nantian-controlplane + name: nantian-gw-controlplane namespace: nantian-gw diff --git a/deploy/kubernetes/base/services-networkpolicy.yaml b/deploy/kubernetes/base/services-networkpolicy.yaml index 0030adcf..1f76802e 100644 --- a/deploy/kubernetes/base/services-networkpolicy.yaml +++ b/deploy/kubernetes/base/services-networkpolicy.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Service metadata: - name: nantian-controlplane-grpc + name: nantian-gw-controlplane-grpc namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw @@ -10,7 +10,7 @@ metadata: gateway.nantian.dev/service-role: grpc spec: selector: - app: nantian-controlplane + app: nantian-gw-controlplane ports: - name: grpc port: 18080 @@ -19,7 +19,7 @@ spec: apiVersion: v1 kind: Service metadata: - name: nantian-controlplane-admin + name: nantian-gw-controlplane-admin namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw @@ -28,7 +28,7 @@ metadata: gateway.nantian.dev/service-role: admin spec: selector: - app: nantian-controlplane + app: nantian-gw-controlplane ports: - name: admin port: 18081 @@ -37,7 +37,7 @@ spec: apiVersion: v1 kind: Service metadata: - name: nantian-controlplane-metrics + name: nantian-gw-controlplane-metrics namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw @@ -46,7 +46,7 @@ metadata: gateway.nantian.dev/service-role: metrics spec: selector: - app: nantian-controlplane + app: nantian-gw-controlplane ports: - name: metrics port: 18082 @@ -55,7 +55,7 @@ spec: apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: - name: nantian-controlplane + name: nantian-gw-controlplane namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw @@ -64,7 +64,7 @@ metadata: spec: podSelector: matchLabels: - app: nantian-controlplane + app: nantian-gw-controlplane policyTypes: - Ingress ingress: @@ -91,7 +91,7 @@ spec: apiVersion: v1 kind: Service metadata: - name: nantian-dataplane-admin + name: nantian-gw-dataplane-admin namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw @@ -100,7 +100,7 @@ metadata: gateway.nantian.dev/service-role: admin spec: selector: - app: nantian-dataplane + app: nantian-gw-dataplane ports: - name: admin port: 19080 @@ -109,7 +109,7 @@ spec: apiVersion: v1 kind: Service metadata: - name: nantian-dataplane-metrics + name: nantian-gw-dataplane-metrics namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw @@ -118,7 +118,7 @@ metadata: gateway.nantian.dev/service-role: metrics spec: selector: - app: nantian-dataplane + app: nantian-gw-dataplane ports: - name: metrics port: 19080 @@ -127,7 +127,7 @@ spec: apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: - name: nantian-dataplane + name: nantian-gw-dataplane namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw @@ -136,7 +136,7 @@ metadata: spec: podSelector: matchLabels: - app: nantian-dataplane + app: nantian-gw-dataplane policyTypes: - Ingress ingress: diff --git a/deploy/kubernetes/overlays/kind-conformance/controlplane-config.yaml b/deploy/kubernetes/overlays/kind-conformance/controlplane-config.yaml index b7797a3a..75cd826e 100644 --- a/deploy/kubernetes/overlays/kind-conformance/controlplane-config.yaml +++ b/deploy/kubernetes/overlays/kind-conformance/controlplane-config.yaml @@ -32,4 +32,4 @@ grpcTLS: certPath: "" keyPath: "" clientCAPath: "" - requireClientCert: false \ No newline at end of file + requireClientCert: false diff --git a/deploy/kubernetes/overlays/kind-conformance/dataplane-config.yaml b/deploy/kubernetes/overlays/kind-conformance/dataplane-config.yaml index 83d6be42..d6fe4703 100644 --- a/deploy/kubernetes/overlays/kind-conformance/dataplane-config.yaml +++ b/deploy/kubernetes/overlays/kind-conformance/dataplane-config.yaml @@ -1,6 +1,6 @@ nodeId: "dp-kind" cluster: "kind" -controlPlaneAddr: "http://nantian-controlplane-grpc.nantian-gw.svc.cluster.local:18080" +controlPlaneAddr: "http://nantian-gw-controlplane-grpc.nantian-gw.svc.cluster.local:18080" adminAddr: "0.0.0.0:19080" log: level: "info,nantian_core::connectors=off" diff --git a/deploy/kubernetes/overlays/kind-conformance/kustomization.yaml b/deploy/kubernetes/overlays/kind-conformance/kustomization.yaml index 61fc4d9b..78299cf9 100644 --- a/deploy/kubernetes/overlays/kind-conformance/kustomization.yaml +++ b/deploy/kubernetes/overlays/kind-conformance/kustomization.yaml @@ -27,13 +27,13 @@ generatorOptions: disableNameSuffixHash: true configMapGenerator: - - name: nantian-controlplane-config + - name: nantian-gw-controlplane-config namespace: nantian-gw behavior: replace files: - config.yaml=controlplane-config.yaml - - name: nantian-dataplane-config + - name: nantian-gw-dataplane-config namespace: nantian-gw behavior: replace files: - - config.yaml=dataplane-config.yaml \ No newline at end of file + - config.yaml=dataplane-config.yaml diff --git a/deploy/kubernetes/overlays/kind-hostnetwork/patch-dataplane-hostnetwork.yaml b/deploy/kubernetes/overlays/kind-hostnetwork/patch-dataplane-hostnetwork.yaml index f41cadec..50ea0060 100644 --- a/deploy/kubernetes/overlays/kind-hostnetwork/patch-dataplane-hostnetwork.yaml +++ b/deploy/kubernetes/overlays/kind-hostnetwork/patch-dataplane-hostnetwork.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: nantian-dataplane + name: nantian-gw-dataplane namespace: nantian-gw spec: replicas: 1 @@ -19,5 +19,5 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchLabels: - app: nantian-dataplane + app: nantian-gw-dataplane topologyKey: kubernetes.io/hostname diff --git a/deploy/kubernetes/overlays/kind/controlplane-replicas.yaml b/deploy/kubernetes/overlays/kind/controlplane-replicas.yaml index 83333d81..9fdac73c 100644 --- a/deploy/kubernetes/overlays/kind/controlplane-replicas.yaml +++ b/deploy/kubernetes/overlays/kind/controlplane-replicas.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: nantian-controlplane + name: nantian-gw-controlplane namespace: nantian-gw spec: replicas: 1 \ No newline at end of file diff --git a/deploy/kubernetes/overlays/kind/dataplane-replicas.yaml b/deploy/kubernetes/overlays/kind/dataplane-replicas.yaml index 01234cf5..36a8ddab 100644 --- a/deploy/kubernetes/overlays/kind/dataplane-replicas.yaml +++ b/deploy/kubernetes/overlays/kind/dataplane-replicas.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: nantian-dataplane + name: nantian-gw-dataplane namespace: nantian-gw spec: replicas: 1 \ No newline at end of file diff --git a/deploy/kubernetes/overlays/production/README.md b/deploy/kubernetes/overlays/production/README.md index ed5b87d9..6bbf0cf6 100644 --- a/deploy/kubernetes/overlays/production/README.md +++ b/deploy/kubernetes/overlays/production/README.md @@ -106,4 +106,4 @@ GOWORK=off go run ./cmd/gateway-api-support -format names - `controlplane-config.yaml` and `dataplane-config.yaml` are the true sources for the current overlay — do not modify the `configs/` directory and assume the overlay will automatically inherit changes. - `dataplane-admin-auth.secret.example.yaml` serves dataplane's own admin auth; ensure this Secret is created and has correct content. - `enableHttp3` remains disabled; HTTP/3 / QUIC is currently not in this production overlay's default scope. -- If the environment already has Prometheus Operator installed, optional alert rules are available in `controlplane-alert-rules.prometheusrule.yaml`. This file is not merged into `kustomization.yaml` by default, to avoid binding the production overlay to the `PrometheusRule` CRD; apply it separately with `kubectl apply -f deploy/kubernetes/overlays/production/controlplane-alert-rules.prometheusrule.yaml`, or explicitly add it to the overlay's `resources`. \ No newline at end of file +- If the environment already has Prometheus Operator installed, optional alert rules are available in `controlplane-alert-rules.prometheusrule.yaml`. This file is not merged into `kustomization.yaml` by default, to avoid binding the production overlay to the `PrometheusRule` CRD; apply it separately with `kubectl apply -f deploy/kubernetes/overlays/production/controlplane-alert-rules.prometheusrule.yaml`, or explicitly add it to the overlay's `resources`. diff --git a/deploy/kubernetes/overlays/production/controlplane-admin-auth.secret.example.yaml b/deploy/kubernetes/overlays/production/controlplane-admin-auth.secret.example.yaml index dfb9569d..84cfc39f 100644 --- a/deploy/kubernetes/overlays/production/controlplane-admin-auth.secret.example.yaml +++ b/deploy/kubernetes/overlays/production/controlplane-admin-auth.secret.example.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Secret metadata: - name: nantian-controlplane-admin-auth + name: nantian-gw-controlplane-admin-auth namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw diff --git a/deploy/kubernetes/overlays/production/controlplane-alert-rules.prometheusrule.yaml b/deploy/kubernetes/overlays/production/controlplane-alert-rules.prometheusrule.yaml index 0bf6f0b5..b6d51357 100644 --- a/deploy/kubernetes/overlays/production/controlplane-alert-rules.prometheusrule.yaml +++ b/deploy/kubernetes/overlays/production/controlplane-alert-rules.prometheusrule.yaml @@ -1,7 +1,7 @@ apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: - name: nantian-controlplane-alerts + name: nantian-gw-controlplane-alerts namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw @@ -9,7 +9,7 @@ metadata: app.kubernetes.io/part-of: nantian-gw spec: groups: - - name: nantian-controlplane + - name: nantian-gw-controlplane rules: - alert: NantianGatewayControlplaneXDSSnapshotAckTimeouts expr: increase(nantian_gateway_controlplane_xds_snapshot_ack_timeouts_total[10m]) > 0 diff --git a/deploy/kubernetes/overlays/production/controlplane-grpc-tls.secret.example.yaml b/deploy/kubernetes/overlays/production/controlplane-grpc-tls.secret.example.yaml index 799ec2dc..96d3fe87 100644 --- a/deploy/kubernetes/overlays/production/controlplane-grpc-tls.secret.example.yaml +++ b/deploy/kubernetes/overlays/production/controlplane-grpc-tls.secret.example.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Secret metadata: - name: nantian-controlplane-grpc-tls + name: nantian-gw-controlplane-grpc-tls namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw diff --git a/deploy/kubernetes/overlays/production/dataplane-admin-auth.secret.example.yaml b/deploy/kubernetes/overlays/production/dataplane-admin-auth.secret.example.yaml index f6f2ce9c..6da78a49 100644 --- a/deploy/kubernetes/overlays/production/dataplane-admin-auth.secret.example.yaml +++ b/deploy/kubernetes/overlays/production/dataplane-admin-auth.secret.example.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Secret metadata: - name: nantian-dataplane-admin-auth + name: nantian-gw-dataplane-admin-auth namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw diff --git a/deploy/kubernetes/overlays/production/dataplane-config.yaml b/deploy/kubernetes/overlays/production/dataplane-config.yaml index 112cab51..e026ba6a 100644 --- a/deploy/kubernetes/overlays/production/dataplane-config.yaml +++ b/deploy/kubernetes/overlays/production/dataplane-config.yaml @@ -1,6 +1,6 @@ nodeId: "dp-kubernetes" cluster: "production" -controlPlaneAddr: "https://nantian-controlplane-grpc.nantian-gw.svc.cluster.local:18080" +controlPlaneAddr: "https://nantian-gw-controlplane-grpc.nantian-gw.svc.cluster.local:18080" adminAddr: "0.0.0.0:19080" log: level: "info,nantian_core::connectors=off" @@ -55,7 +55,7 @@ xdsTls: caPath: "/etc/nantian-gw/xds-tls/ca.crt" certPath: "/etc/nantian-gw/xds-tls/tls.crt" keyPath: "/etc/nantian-gw/xds-tls/tls.key" - domainName: "nantian-controlplane-grpc.nantian-gw.svc.cluster.local" + domainName: "nantian-gw-controlplane-grpc.nantian-gw.svc.cluster.local" experimental: enableExperimentalGateway: false enableAiGateway: false diff --git a/deploy/kubernetes/overlays/production/dataplane-session-persistence.secret.example.yaml b/deploy/kubernetes/overlays/production/dataplane-session-persistence.secret.example.yaml index 654a6713..f23bcbfa 100644 --- a/deploy/kubernetes/overlays/production/dataplane-session-persistence.secret.example.yaml +++ b/deploy/kubernetes/overlays/production/dataplane-session-persistence.secret.example.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Secret metadata: - name: nantian-dataplane-session-persistence + name: nantian-gw-dataplane-session-persistence namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw diff --git a/deploy/kubernetes/overlays/production/dataplane-xds-tls.secret.example.yaml b/deploy/kubernetes/overlays/production/dataplane-xds-tls.secret.example.yaml index 86251763..e9463b77 100644 --- a/deploy/kubernetes/overlays/production/dataplane-xds-tls.secret.example.yaml +++ b/deploy/kubernetes/overlays/production/dataplane-xds-tls.secret.example.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Secret metadata: - name: nantian-dataplane-xds-tls + name: nantian-gw-dataplane-xds-tls namespace: nantian-gw labels: app.kubernetes.io/name: nantian-gw diff --git a/deploy/kubernetes/overlays/production/patch-controlplane-deployment.yaml b/deploy/kubernetes/overlays/production/patch-controlplane-deployment.yaml index 772183b2..614194ac 100644 --- a/deploy/kubernetes/overlays/production/patch-controlplane-deployment.yaml +++ b/deploy/kubernetes/overlays/production/patch-controlplane-deployment.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: nantian-controlplane + name: nantian-gw-controlplane namespace: nantian-gw spec: template: @@ -15,13 +15,13 @@ spec: volumes: - name: grpc-tls secret: - secretName: nantian-controlplane-grpc-tls + secretName: nantian-gw-controlplane-grpc-tls optional: false - name: admin-auth secret: - secretName: nantian-controlplane-admin-auth + secretName: nantian-gw-controlplane-admin-auth optional: false - name: dataplane-admin-auth secret: - secretName: nantian-dataplane-admin-auth + secretName: nantian-gw-dataplane-admin-auth optional: false diff --git a/deploy/kubernetes/overlays/production/patch-dataplane-deployment.yaml b/deploy/kubernetes/overlays/production/patch-dataplane-deployment.yaml index 6ca0df37..ffde7d13 100644 --- a/deploy/kubernetes/overlays/production/patch-dataplane-deployment.yaml +++ b/deploy/kubernetes/overlays/production/patch-dataplane-deployment.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: nantian-dataplane + name: nantian-gw-dataplane namespace: nantian-gw spec: template: @@ -21,13 +21,13 @@ spec: volumes: - name: xds-tls secret: - secretName: nantian-dataplane-xds-tls + secretName: nantian-gw-dataplane-xds-tls optional: false - name: admin-auth secret: - secretName: nantian-dataplane-admin-auth + secretName: nantian-gw-dataplane-admin-auth optional: false - name: session-persistence secret: - secretName: nantian-dataplane-session-persistence + secretName: nantian-gw-dataplane-session-persistence optional: false diff --git a/deploy/observability/grafana/pingora-gateway-observability-dashboard.json b/deploy/observability/grafana/pingora-gateway-observability-dashboard.json index 7557acdc..5f971b94 100644 --- a/deploy/observability/grafana/pingora-gateway-observability-dashboard.json +++ b/deploy/observability/grafana/pingora-gateway-observability-dashboard.json @@ -400,7 +400,7 @@ }, "targets": [ { - "expr": "sum(nantian_gateway_dataplane_container_cpu_throttle_ratio{namespace=~\"$namespace\"} or rate(container_cpu_cfs_throttled_periods_total{namespace=~\"$namespace\",pod=~\"nantian-dataplane-.*\"}[5m]) / rate(container_cpu_cfs_periods_total{namespace=~\"$namespace\",pod=~\"nantian-dataplane-.*\"}[5m]))", + "expr": "sum(nantian_gateway_dataplane_container_cpu_throttle_ratio{namespace=~\"$namespace\"} or rate(container_cpu_cfs_throttled_periods_total{namespace=~\"$namespace\",pod=~\"nantian-gw-dataplane-.*\"}[5m]) / rate(container_cpu_cfs_periods_total{namespace=~\"$namespace\",pod=~\"nantian-gw-dataplane-.*\"}[5m]))", "refId": "A" } ], @@ -435,7 +435,7 @@ }, "targets": [ { - "expr": "sum(nantian_gateway_dataplane_container_memory_working_set_bytes{namespace=~\"$namespace\"} or container_memory_working_set_bytes{namespace=~\"$namespace\",pod=~\"nantian-dataplane-.*\"})", + "expr": "sum(nantian_gateway_dataplane_container_memory_working_set_bytes{namespace=~\"$namespace\"} or container_memory_working_set_bytes{namespace=~\"$namespace\",pod=~\"nantian-gw-dataplane-.*\"})", "refId": "A" } ], @@ -1208,12 +1208,12 @@ "options": {}, "targets": [ { - "expr": "nantian_gateway_dataplane_container_cpu_cores{namespace=~\"$namespace\"} or rate(container_cpu_usage_seconds_total{namespace=~\"$namespace\",pod=~\"nantian-dataplane-.*\"}[5m])", + "expr": "nantian_gateway_dataplane_container_cpu_cores{namespace=~\"$namespace\"} or rate(container_cpu_usage_seconds_total{namespace=~\"$namespace\",pod=~\"nantian-gw-dataplane-.*\"}[5m])", "legendFormat": "cores", "refId": "A" }, { - "expr": "nantian_gateway_dataplane_container_cpu_request_cores{namespace=~\"$namespace\"} or avg by (pod) (kube_pod_container_resource_requests{namespace=~\"$namespace\",pod=~\"nantian-dataplane-.*\",resource=\"cpu\"})", + "expr": "nantian_gateway_dataplane_container_cpu_request_cores{namespace=~\"$namespace\"} or avg by (pod) (kube_pod_container_resource_requests{namespace=~\"$namespace\",pod=~\"nantian-gw-dataplane-.*\",resource=\"cpu\"})", "legendFormat": "request", "refId": "B" } @@ -1241,7 +1241,7 @@ "options": {}, "targets": [ { - "expr": "nantian_gateway_dataplane_container_cpu_throttle_ratio{namespace=~\"$namespace\"} or rate(container_cpu_cfs_throttled_periods_total{namespace=~\"$namespace\",pod=~\"nantian-dataplane-.*\"}[5m]) / rate(container_cpu_cfs_periods_total{namespace=~\"$namespace\",pod=~\"nantian-dataplane-.*\"}[5m])", + "expr": "nantian_gateway_dataplane_container_cpu_throttle_ratio{namespace=~\"$namespace\"} or rate(container_cpu_cfs_throttled_periods_total{namespace=~\"$namespace\",pod=~\"nantian-gw-dataplane-.*\"}[5m]) / rate(container_cpu_cfs_periods_total{namespace=~\"$namespace\",pod=~\"nantian-gw-dataplane-.*\"}[5m])", "legendFormat": "throttle", "refId": "A" } @@ -1269,17 +1269,17 @@ "options": {}, "targets": [ { - "expr": "sum by (pod) (nantian_gateway_dataplane_container_memory_working_set_bytes{namespace=~\"$namespace\"} or container_memory_working_set_bytes{namespace=~\"$namespace\",pod=~\"nantian-dataplane-.*\"})", + "expr": "sum by (pod) (nantian_gateway_dataplane_container_memory_working_set_bytes{namespace=~\"$namespace\"} or container_memory_working_set_bytes{namespace=~\"$namespace\",pod=~\"nantian-gw-dataplane-.*\"})", "legendFormat": "{{pod}}", "refId": "A" }, { - "expr": "max by (pod) (nantian_gateway_dataplane_container_memory_limit_bytes{namespace=~\"$namespace\"} or avg by (pod) (kube_pod_container_resource_limits{namespace=~\"$namespace\",pod=~\"nantian-dataplane-.*\",resource=\"memory\"}))", + "expr": "max by (pod) (nantian_gateway_dataplane_container_memory_limit_bytes{namespace=~\"$namespace\"} or avg by (pod) (kube_pod_container_resource_limits{namespace=~\"$namespace\",pod=~\"nantian-gw-dataplane-.*\",resource=\"memory\"}))", "legendFormat": "limit", "refId": "B" }, { - "expr": "max by (pod) (nantian_gateway_dataplane_container_memory_request_bytes{namespace=~\"$namespace\"} or avg by (pod) (kube_pod_container_resource_requests{namespace=~\"$namespace\",pod=~\"nantian-dataplane-.*\",resource=\"memory\"}))", + "expr": "max by (pod) (nantian_gateway_dataplane_container_memory_request_bytes{namespace=~\"$namespace\"} or avg by (pod) (kube_pod_container_resource_requests{namespace=~\"$namespace\",pod=~\"nantian-gw-dataplane-.*\",resource=\"memory\"}))", "legendFormat": "request", "refId": "C" } diff --git a/deploy/observability/prometheus/README.md b/deploy/observability/prometheus/README.md index b912aff5..799b4126 100644 --- a/deploy/observability/prometheus/README.md +++ b/deploy/observability/prometheus/README.md @@ -2,8 +2,8 @@ This directory contains example Prometheus scrape assets for: -- the controlplane metrics endpoint exposed by `nantian-controlplane-metrics` -- the dataplane metrics endpoint exposed by `nantian-dataplane-metrics` +- the controlplane metrics endpoint exposed by `nantian-gw-controlplane-metrics` +- the dataplane metrics endpoint exposed by `nantian-gw-dataplane-metrics` Use these files when you want Prometheus to scrape each dataplane pod separately so queries like `sum(nantian_gateway_dataplane_ready)` reflect ready replica counts instead of the view from a single Service request. @@ -14,7 +14,7 @@ Metric names, label cardinality classes, and golden-signal expectations are docu `nantian_gateway_dataplane_ready` is a per-pod gauge, not a replica counter. - Metric definition: `1 if the dataplane has applied at least one snapshot, 0 otherwise.` -- A single request to `nantian-dataplane-metrics` only hits one backend pod. +- A single request to `nantian-gw-dataplane-metrics` only hits one backend pod. - Replica-level views require Prometheus to scrape every endpoint or pod independently and then aggregate with PromQL. Do not use a single static target such as: @@ -22,7 +22,7 @@ Do not use a single static target such as: ```yaml static_configs: - targets: - - nantian-dataplane-metrics.nantian-gw.svc:19080 + - nantian-gw-dataplane-metrics.nantian-gw.svc:19080 ``` That configuration only gives you a single-pod view. @@ -163,11 +163,11 @@ histogram_quantile(0.95, sum by (le, route) (rate(nantian_gateway_dataplane_admi ``` ```promql -kube_deployment_spec_replicas{namespace="nantian-gw",deployment="nantian-dataplane"} +kube_deployment_spec_replicas{namespace="nantian-gw",deployment="nantian-gw-dataplane"} ``` ```promql -kube_deployment_status_replicas_available{namespace="nantian-gw",deployment="nantian-dataplane"} +kube_deployment_status_replicas_available{namespace="nantian-gw",deployment="nantian-gw-dataplane"} ``` Interpretation: @@ -175,7 +175,7 @@ Interpretation: - `count = 3` and `sum = 3`: three dataplane pods are being scraped separately and all are ready. - `count = 1` and `sum = 1`: only one scrape target is being discovered. - `count = 3` and `sum = 2`: three scrape targets exist but one dataplane pod is not ready under this metric’s definition. -- Empty controlplane panels usually mean the controlplane scrape object or native `scrape_configs` block is missing, the `job_controlplane` Grafana variable is not matching the real `job` label, or NetworkPolicy blocks Prometheus from reaching `nantian-controlplane-metrics:18082`. +- Empty controlplane panels usually mean the controlplane scrape object or native `scrape_configs` block is missing, the `job_controlplane` Grafana variable is not matching the real `job` label, or NetworkPolicy blocks Prometheus from reaching `nantian-gw-controlplane-metrics:18082`. - Empty container resource recording rules usually mean kubelet cAdvisor or kube-state-metrics is not scraped, or your cluster uses different namespace, pod, or container labels. Keep the recording rules aligned with your deployed @@ -189,9 +189,9 @@ Copy it first, replace the placeholder token, then apply the real Secret manifes Prometheus Operator: ```bash -cp deploy/observability/prometheus/operator/secret-dataplane-admin-token.example.yaml /tmp/nantian-dataplane-admin-token.yaml -$EDITOR /tmp/nantian-dataplane-admin-token.yaml -kubectl apply -f /tmp/nantian-dataplane-admin-token.yaml +cp deploy/observability/prometheus/operator/secret-dataplane-admin-token.example.yaml /tmp/nantian-gw-dataplane-admin-token.yaml +$EDITOR /tmp/nantian-gw-dataplane-admin-token.yaml +kubectl apply -f /tmp/nantian-gw-dataplane-admin-token.yaml kubectl apply -f deploy/observability/prometheus/operator/networkpolicy-prometheus-scrape.yaml kubectl apply -f deploy/observability/prometheus/operator/podmonitor-controlplane.yaml kubectl apply -f deploy/observability/prometheus/operator/podmonitor-dataplane.yaml @@ -201,9 +201,9 @@ kubectl apply -f deploy/observability/prometheus/operator/prometheusrule-datapla Or, if you prefer Service-based discovery: ```bash -cp deploy/observability/prometheus/operator/secret-dataplane-admin-token.example.yaml /tmp/nantian-dataplane-admin-token.yaml -$EDITOR /tmp/nantian-dataplane-admin-token.yaml -kubectl apply -f /tmp/nantian-dataplane-admin-token.yaml +cp deploy/observability/prometheus/operator/secret-dataplane-admin-token.example.yaml /tmp/nantian-gw-dataplane-admin-token.yaml +$EDITOR /tmp/nantian-gw-dataplane-admin-token.yaml +kubectl apply -f /tmp/nantian-gw-dataplane-admin-token.yaml kubectl apply -f deploy/observability/prometheus/operator/networkpolicy-prometheus-scrape.yaml kubectl apply -f deploy/observability/prometheus/operator/servicemonitor-controlplane.yaml kubectl apply -f deploy/observability/prometheus/operator/servicemonitor-dataplane.yaml diff --git a/deploy/observability/prometheus/native/prometheus-controlplane-scrape.yaml b/deploy/observability/prometheus/native/prometheus-controlplane-scrape.yaml index ae74ed1b..87ce2bab 100644 --- a/deploy/observability/prometheus/native/prometheus-controlplane-scrape.yaml +++ b/deploy/observability/prometheus/native/prometheus-controlplane-scrape.yaml @@ -2,7 +2,7 @@ # Do not use both jobs at the same time for the same controlplane targets. scrape_configs: - - job_name: nantian-controlplane + - job_name: nantian-gw-controlplane metrics_path: /metrics scrape_interval: 15s scrape_timeout: 10s @@ -19,7 +19,7 @@ scrape_configs: - __meta_kubernetes_service_name - __meta_kubernetes_endpoint_port_name action: keep - regex: nantian-gw;nantian-controlplane-metrics;metrics + regex: nantian-gw;nantian-gw-controlplane-metrics;metrics - source_labels: [__meta_kubernetes_pod_name] target_label: pod @@ -40,7 +40,7 @@ scrape_configs: target_label: instance --- scrape_configs: - - job_name: nantian-controlplane + - job_name: nantian-gw-controlplane metrics_path: /metrics scrape_interval: 15s scrape_timeout: 10s @@ -57,7 +57,7 @@ scrape_configs: - __meta_kubernetes_service_name - __meta_kubernetes_endpointslice_port_name action: keep - regex: nantian-gw;nantian-controlplane-metrics;metrics + regex: nantian-gw;nantian-gw-controlplane-metrics;metrics - source_labels: [__meta_kubernetes_pod_name] target_label: pod diff --git a/deploy/observability/prometheus/native/prometheus-dataplane-rules.yaml b/deploy/observability/prometheus/native/prometheus-dataplane-rules.yaml index 2b939adb..ed4b065f 100644 --- a/deploy/observability/prometheus/native/prometheus-dataplane-rules.yaml +++ b/deploy/observability/prometheus/native/prometheus-dataplane-rules.yaml @@ -1,5 +1,5 @@ groups: - - name: nantian-dataplane + - name: nantian-gw-dataplane rules: - record: nantian_gateway_dataplane_ready_replicas expr: sum by (namespace, job) (nantian_gateway_dataplane_runtime_supervisor_http_states) @@ -11,37 +11,37 @@ groups: - record: nantian_gateway_dataplane_container_cpu_cores expr: | sum by (namespace, pod, container) ( - rate(container_cpu_usage_seconds_total{namespace="nantian-gw",pod=~"nantian-dataplane-.+",container="dataplane",image!=""}[5m]) + rate(container_cpu_usage_seconds_total{namespace="nantian-gw",pod=~"nantian-gw-dataplane-.+",container="dataplane",image!=""}[5m]) ) - record: nantian_gateway_dataplane_container_cpu_request_cores expr: | max by (namespace, pod, container) ( - kube_pod_container_resource_requests{namespace="nantian-gw",pod=~"nantian-dataplane-.+",container="dataplane",resource="cpu"} + kube_pod_container_resource_requests{namespace="nantian-gw",pod=~"nantian-gw-dataplane-.+",container="dataplane",resource="cpu"} ) - record: nantian_gateway_dataplane_container_cpu_throttle_ratio expr: | sum by (namespace, pod, container) ( - rate(container_cpu_cfs_throttled_periods_total{namespace="nantian-gw",pod=~"nantian-dataplane-.+",container="dataplane",image!=""}[5m]) + rate(container_cpu_cfs_throttled_periods_total{namespace="nantian-gw",pod=~"nantian-gw-dataplane-.+",container="dataplane",image!=""}[5m]) ) / clamp_min( sum by (namespace, pod, container) ( - rate(container_cpu_cfs_periods_total{namespace="nantian-gw",pod=~"nantian-dataplane-.+",container="dataplane",image!=""}[5m]) + rate(container_cpu_cfs_periods_total{namespace="nantian-gw",pod=~"nantian-gw-dataplane-.+",container="dataplane",image!=""}[5m]) ), 1e-9 ) - record: nantian_gateway_dataplane_container_memory_working_set_bytes expr: | sum by (namespace, pod, container) ( - container_memory_working_set_bytes{namespace="nantian-gw",pod=~"nantian-dataplane-.+",container="dataplane",image!=""} + container_memory_working_set_bytes{namespace="nantian-gw",pod=~"nantian-gw-dataplane-.+",container="dataplane",image!=""} ) - record: nantian_gateway_dataplane_container_memory_limit_bytes expr: | max by (namespace, pod, container) ( - kube_pod_container_resource_limits{namespace="nantian-gw",pod=~"nantian-dataplane-.+",container="dataplane",resource="memory"} + kube_pod_container_resource_limits{namespace="nantian-gw",pod=~"nantian-gw-dataplane-.+",container="dataplane",resource="memory"} ) - record: nantian_gateway_dataplane_container_memory_request_bytes expr: | max by (namespace, pod, container) ( - kube_pod_container_resource_requests{namespace="nantian-gw",pod=~"nantian-dataplane-.+",container="dataplane",resource="memory"} + kube_pod_container_resource_requests{namespace="nantian-gw",pod=~"nantian-gw-dataplane-.+",container="dataplane",resource="memory"} ) diff --git a/deploy/observability/prometheus/native/prometheus-dataplane-scrape.yaml b/deploy/observability/prometheus/native/prometheus-dataplane-scrape.yaml index 25734682..9a5f744e 100644 --- a/deploy/observability/prometheus/native/prometheus-dataplane-scrape.yaml +++ b/deploy/observability/prometheus/native/prometheus-dataplane-scrape.yaml @@ -2,7 +2,7 @@ # Do not use both jobs at the same time for the same dataplane targets. scrape_configs: - - job_name: nantian-dataplane + - job_name: nantian-gw-dataplane metrics_path: /metrics scrape_interval: 15s scrape_timeout: 10s @@ -10,7 +10,7 @@ scrape_configs: # Remove this block if dataplane admin auth is disabled. authorization: type: Bearer - credentials_file: /etc/prometheus/secrets/nantian-dataplane-admin-token/token + credentials_file: /etc/prometheus/secrets/nantian-gw-dataplane-admin-token/token kubernetes_sd_configs: - role: endpoints @@ -24,7 +24,7 @@ scrape_configs: - __meta_kubernetes_service_name - __meta_kubernetes_endpoint_port_name action: keep - regex: nantian-gw;nantian-dataplane-metrics;metrics + regex: nantian-gw;nantian-gw-dataplane-metrics;metrics - source_labels: [__meta_kubernetes_pod_name] target_label: pod @@ -45,7 +45,7 @@ scrape_configs: target_label: instance --- scrape_configs: - - job_name: nantian-dataplane + - job_name: nantian-gw-dataplane metrics_path: /metrics scrape_interval: 15s scrape_timeout: 10s @@ -53,7 +53,7 @@ scrape_configs: # Remove this block if dataplane admin auth is disabled. authorization: type: Bearer - credentials_file: /etc/prometheus/secrets/nantian-dataplane-admin-token/token + credentials_file: /etc/prometheus/secrets/nantian-gw-dataplane-admin-token/token kubernetes_sd_configs: - role: endpointslice @@ -67,7 +67,7 @@ scrape_configs: - __meta_kubernetes_service_name - __meta_kubernetes_endpointslice_port_name action: keep - regex: nantian-gw;nantian-dataplane-metrics;metrics + regex: nantian-gw;nantian-gw-dataplane-metrics;metrics - source_labels: [__meta_kubernetes_pod_name] target_label: pod diff --git a/deploy/observability/prometheus/operator/networkpolicy-prometheus-scrape.yaml b/deploy/observability/prometheus/operator/networkpolicy-prometheus-scrape.yaml index ef5158a6..90beb2c0 100644 --- a/deploy/observability/prometheus/operator/networkpolicy-prometheus-scrape.yaml +++ b/deploy/observability/prometheus/operator/networkpolicy-prometheus-scrape.yaml @@ -13,8 +13,8 @@ spec: - key: app operator: In values: - - nantian-controlplane - - nantian-dataplane + - nantian-gw-controlplane + - nantian-gw-dataplane policyTypes: - Ingress ingress: diff --git a/deploy/observability/prometheus/operator/podmonitor-controlplane.yaml b/deploy/observability/prometheus/operator/podmonitor-controlplane.yaml index a82ae71b..aa79f54b 100644 --- a/deploy/observability/prometheus/operator/podmonitor-controlplane.yaml +++ b/deploy/observability/prometheus/operator/podmonitor-controlplane.yaml @@ -1,7 +1,7 @@ apiVersion: monitoring.coreos.com/v1 kind: PodMonitor metadata: - name: nantian-controlplane + name: nantian-gw-controlplane namespace: monitoring labels: release: kube-prometheus-stack @@ -11,7 +11,7 @@ spec: - nantian-gw selector: matchLabels: - app: nantian-controlplane + app: nantian-gw-controlplane podMetricsEndpoints: - port: metrics path: /metrics diff --git a/deploy/observability/prometheus/operator/podmonitor-dataplane.yaml b/deploy/observability/prometheus/operator/podmonitor-dataplane.yaml index 841adee3..eb80b8e4 100644 --- a/deploy/observability/prometheus/operator/podmonitor-dataplane.yaml +++ b/deploy/observability/prometheus/operator/podmonitor-dataplane.yaml @@ -1,7 +1,7 @@ apiVersion: monitoring.coreos.com/v1 kind: PodMonitor metadata: - name: nantian-dataplane + name: nantian-gw-dataplane namespace: monitoring labels: release: kube-prometheus-stack @@ -11,7 +11,7 @@ spec: - nantian-gw selector: matchLabels: - app: nantian-dataplane + app: nantian-gw-dataplane podMetricsEndpoints: - port: admin path: /metrics @@ -21,5 +21,5 @@ spec: authorization: type: Bearer credentials: - name: nantian-dataplane-admin-token + name: nantian-gw-dataplane-admin-token key: token diff --git a/deploy/observability/prometheus/operator/prometheusrule-dataplane.yaml b/deploy/observability/prometheus/operator/prometheusrule-dataplane.yaml index c2e87b40..6f797db6 100644 --- a/deploy/observability/prometheus/operator/prometheusrule-dataplane.yaml +++ b/deploy/observability/prometheus/operator/prometheusrule-dataplane.yaml @@ -1,13 +1,13 @@ apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: - name: nantian-dataplane + name: nantian-gw-dataplane namespace: monitoring labels: release: kube-prometheus-stack spec: groups: - - name: nantian-dataplane + - name: nantian-gw-dataplane rules: - record: nantian_gateway_dataplane_ready_replicas expr: sum by (namespace, job) (nantian_gateway_dataplane_runtime_supervisor_http_states) @@ -18,37 +18,37 @@ spec: - record: nantian_gateway_dataplane_container_cpu_cores expr: | sum by (namespace, pod, container) ( - rate(container_cpu_usage_seconds_total{namespace="nantian-gw",pod=~"nantian-dataplane-.+",container="dataplane",image!=""}[5m]) + rate(container_cpu_usage_seconds_total{namespace="nantian-gw",pod=~"nantian-gw-dataplane-.+",container="dataplane",image!=""}[5m]) ) - record: nantian_gateway_dataplane_container_cpu_request_cores expr: | max by (namespace, pod, container) ( - kube_pod_container_resource_requests{namespace="nantian-gw",pod=~"nantian-dataplane-.+",container="dataplane",resource="cpu"} + kube_pod_container_resource_requests{namespace="nantian-gw",pod=~"nantian-gw-dataplane-.+",container="dataplane",resource="cpu"} ) - record: nantian_gateway_dataplane_container_cpu_throttle_ratio expr: | sum by (namespace, pod, container) ( - rate(container_cpu_cfs_throttled_periods_total{namespace="nantian-gw",pod=~"nantian-dataplane-.+",container="dataplane",image!=""}[5m]) + rate(container_cpu_cfs_throttled_periods_total{namespace="nantian-gw",pod=~"nantian-gw-dataplane-.+",container="dataplane",image!=""}[5m]) ) / clamp_min( sum by (namespace, pod, container) ( - rate(container_cpu_cfs_periods_total{namespace="nantian-gw",pod=~"nantian-dataplane-.+",container="dataplane",image!=""}[5m]) + rate(container_cpu_cfs_periods_total{namespace="nantian-gw",pod=~"nantian-gw-dataplane-.+",container="dataplane",image!=""}[5m]) ), 1e-9 ) - record: nantian_gateway_dataplane_container_memory_working_set_bytes expr: | sum by (namespace, pod, container) ( - container_memory_working_set_bytes{namespace="nantian-gw",pod=~"nantian-dataplane-.+",container="dataplane",image!=""} + container_memory_working_set_bytes{namespace="nantian-gw",pod=~"nantian-gw-dataplane-.+",container="dataplane",image!=""} ) - record: nantian_gateway_dataplane_container_memory_limit_bytes expr: | max by (namespace, pod, container) ( - kube_pod_container_resource_limits{namespace="nantian-gw",pod=~"nantian-dataplane-.+",container="dataplane",resource="memory"} + kube_pod_container_resource_limits{namespace="nantian-gw",pod=~"nantian-gw-dataplane-.+",container="dataplane",resource="memory"} ) - record: nantian_gateway_dataplane_container_memory_request_bytes expr: | max by (namespace, pod, container) ( - kube_pod_container_resource_requests{namespace="nantian-gw",pod=~"nantian-dataplane-.+",container="dataplane",resource="memory"} + kube_pod_container_resource_requests{namespace="nantian-gw",pod=~"nantian-gw-dataplane-.+",container="dataplane",resource="memory"} ) diff --git a/deploy/observability/prometheus/operator/secret-dataplane-admin-token.example.yaml b/deploy/observability/prometheus/operator/secret-dataplane-admin-token.example.yaml index 89a84eef..072e92f1 100644 --- a/deploy/observability/prometheus/operator/secret-dataplane-admin-token.example.yaml +++ b/deploy/observability/prometheus/operator/secret-dataplane-admin-token.example.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Secret metadata: - name: nantian-dataplane-admin-token + name: nantian-gw-dataplane-admin-token namespace: monitoring type: Opaque stringData: diff --git a/deploy/observability/prometheus/operator/servicemonitor-controlplane.yaml b/deploy/observability/prometheus/operator/servicemonitor-controlplane.yaml index 1da5a4cc..b4831e28 100644 --- a/deploy/observability/prometheus/operator/servicemonitor-controlplane.yaml +++ b/deploy/observability/prometheus/operator/servicemonitor-controlplane.yaml @@ -1,7 +1,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: nantian-controlplane + name: nantian-gw-controlplane namespace: monitoring labels: release: kube-prometheus-stack diff --git a/deploy/observability/prometheus/operator/servicemonitor-dataplane.yaml b/deploy/observability/prometheus/operator/servicemonitor-dataplane.yaml index 90c83e4d..d710b4ed 100644 --- a/deploy/observability/prometheus/operator/servicemonitor-dataplane.yaml +++ b/deploy/observability/prometheus/operator/servicemonitor-dataplane.yaml @@ -1,7 +1,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: nantian-dataplane + name: nantian-gw-dataplane namespace: monitoring labels: release: kube-prometheus-stack @@ -22,5 +22,5 @@ spec: authorization: type: Bearer credentials: - name: nantian-dataplane-admin-token + name: nantian-gw-dataplane-admin-token key: token diff --git a/internal/admin/dataplane_client_test.go b/internal/admin/dataplane_client_test.go index 11fa43ba..1a78637f 100644 --- a/internal/admin/dataplane_client_test.go +++ b/internal/admin/dataplane_client_test.go @@ -67,4 +67,4 @@ func TestDataplaneAdminClientTimeout(t *testing.T) { if err == nil { t.Fatal("expected timeout error, got nil") } -} \ No newline at end of file +} diff --git a/internal/admin/dataplane_discovery_test.go b/internal/admin/dataplane_discovery_test.go index 9059afd5..149feb7b 100644 --- a/internal/admin/dataplane_discovery_test.go +++ b/internal/admin/dataplane_discovery_test.go @@ -25,7 +25,7 @@ func TestDiscoverDataplaneAdminEndpointsFromEndpointSlices(t *testing.T) { Name: "dp-admin-a", Namespace: "nantian-gw", Labels: map[string]string{ - "kubernetes.io/service-name": "nantian-dataplane-admin", + "kubernetes.io/service-name": "nantian-gw-dataplane-admin", }, }, Ports: []discoveryv1.EndpointPort{{Name: &portName, Port: &port}}, @@ -45,7 +45,7 @@ func TestDiscoverDataplaneAdminEndpointsFromEndpointSlices(t *testing.T) { discovery := NewDataplaneAdminDiscovery(client, DataplaneAdminDiscoveryConfig{ Namespace: "nantian-gw", - ServiceName: "nantian-dataplane-admin", + ServiceName: "nantian-gw-dataplane-admin", PortName: "admin", }) @@ -59,4 +59,4 @@ func TestDiscoverDataplaneAdminEndpointsFromEndpointSlices(t *testing.T) { if endpoints[0].NodeID != "dp-1" || endpoints[0].URL != "http://10.244.0.10:19080" { t.Fatalf("unexpected endpoint: %+v", endpoints[0]) } -} \ No newline at end of file +} diff --git a/internal/admin/server_chatbot_test.go b/internal/admin/server_chatbot_test.go index 16b99618..5796d59c 100644 --- a/internal/admin/server_chatbot_test.go +++ b/internal/admin/server_chatbot_test.go @@ -433,4 +433,4 @@ func TestIsMaskedKey(t *testing.T) { if isMaskedKey("") { t.Error("expected empty key to NOT be detected as masked") } -} \ No newline at end of file +} diff --git a/internal/admin/server_infrastructure_test.go b/internal/admin/server_infrastructure_test.go index 5faf3ddb..cd314420 100644 --- a/internal/admin/server_infrastructure_test.go +++ b/internal/admin/server_infrastructure_test.go @@ -35,7 +35,7 @@ func TestInfrastructureEndpointReturnsDerivedResourceReport(t *testing.T) { for _, item := range report.Resources { if item.Kind == infrastructure.InfrastructureKindService && item.Namespace == "nantian-gw" && - item.Name == "nantian-dataplane" { + item.Name == "nantian-gw-dataplane" { sharedService = item break } diff --git a/internal/admin/server_test.go b/internal/admin/server_test.go index 98f7fb50..0644dee9 100644 --- a/internal/admin/server_test.go +++ b/internal/admin/server_test.go @@ -139,7 +139,7 @@ func newInfrastructureTestServer(t *testing.T) *Server { ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: "nantian-gw", - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", diff --git a/internal/infrastructure/defaults_test.go b/internal/infrastructure/defaults_test.go new file mode 100644 index 00000000..a6ac8501 --- /dev/null +++ b/internal/infrastructure/defaults_test.go @@ -0,0 +1,17 @@ +package infrastructure + +import "testing" + +func TestDefaultOptionsUseCanonicalInstallNames(t *testing.T) { + opts := DefaultOptions() + + if opts.SharedServiceName != "nantian-gw-dataplane" { + t.Fatalf("SharedServiceName = %q, want nantian-gw-dataplane", opts.SharedServiceName) + } + if got := opts.DataplaneSelector["app"]; got != "nantian-gw-dataplane" { + t.Fatalf("DataplaneSelector[app] = %q, want nantian-gw-dataplane", got) + } + if defaultDataplaneNetworkPolicyName != "nantian-gw-dataplane" { + t.Fatalf("defaultDataplaneNetworkPolicyName = %q, want nantian-gw-dataplane", defaultDataplaneNetworkPolicyName) + } +} diff --git a/internal/infrastructure/frontend_eligibility_test.go b/internal/infrastructure/frontend_eligibility_test.go index 41c22b45..d00c44a3 100644 --- a/internal/infrastructure/frontend_eligibility_test.go +++ b/internal/infrastructure/frontend_eligibility_test.go @@ -47,7 +47,7 @@ func TestLoadFrontendEligibleDataplanePodsRejectsPeerSnapshotAckForAllFrontends( ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-current", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.51", @@ -131,7 +131,7 @@ func newFrontendEligibilityTestReconciler(t *testing.T) (*Reconciler, *bytes.Buf ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-stable", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", diff --git a/internal/infrastructure/frontend_endpoint_slice_ownerrefs_test.go b/internal/infrastructure/frontend_endpoint_slice_ownerrefs_test.go index 5e27edc5..844bfb9c 100644 --- a/internal/infrastructure/frontend_endpoint_slice_ownerrefs_test.go +++ b/internal/infrastructure/frontend_endpoint_slice_ownerrefs_test.go @@ -143,7 +143,7 @@ func TestReconcileBackfillsGatewayEndpointSliceOwnerReference(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", diff --git a/internal/infrastructure/inspector_benchmark_test.go b/internal/infrastructure/inspector_benchmark_test.go index 4c59e5cf..6ce35724 100644 --- a/internal/infrastructure/inspector_benchmark_test.go +++ b/internal/infrastructure/inspector_benchmark_test.go @@ -156,7 +156,7 @@ func infrastructureBenchmarkObjects(routeCount int) []client.Object { ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", diff --git a/internal/infrastructure/inspector_test.go b/internal/infrastructure/inspector_test.go index 2762892e..deadab7f 100644 --- a/internal/infrastructure/inspector_test.go +++ b/internal/infrastructure/inspector_test.go @@ -72,7 +72,7 @@ func TestInspectReportsDerivedInfrastructureLifecycleAndDrift(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", @@ -286,7 +286,7 @@ func TestInspectScopesObservedServiceAndEndpointSliceQueries(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", @@ -424,7 +424,7 @@ func TestInspectCachesGatewayClassParametersAcrossGateways(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", @@ -532,7 +532,7 @@ func TestInspectUsesServiceParentRouteIndexes(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", diff --git a/internal/infrastructure/mesh_services_benchmark_test.go b/internal/infrastructure/mesh_services_benchmark_test.go index 9c7b380e..0628d4e7 100644 --- a/internal/infrastructure/mesh_services_benchmark_test.go +++ b/internal/infrastructure/mesh_services_benchmark_test.go @@ -151,7 +151,7 @@ func meshServiceBenchmarkObjects(routeCount int, attached bool) []client.Object ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", diff --git a/internal/infrastructure/networkpolicies.go b/internal/infrastructure/networkpolicies.go index ad2f593a..3948f37e 100644 --- a/internal/infrastructure/networkpolicies.go +++ b/internal/infrastructure/networkpolicies.go @@ -16,7 +16,7 @@ import ( "github.com/nantian-gw/gateway/internal/mesh" ) -const defaultDataplaneNetworkPolicyName = "nantian-dataplane" +const defaultDataplaneNetworkPolicyName = "nantian-gw-dataplane" type networkPolicyPortKey struct { port int32 diff --git a/internal/infrastructure/reconciler.go b/internal/infrastructure/reconciler.go index 389de32f..0f4d9960 100644 --- a/internal/infrastructure/reconciler.go +++ b/internal/infrastructure/reconciler.go @@ -15,7 +15,7 @@ import ( const ( defaultDataplaneNamespace = "nantian-gw" - defaultSharedServiceName = "nantian-dataplane" + defaultSharedServiceName = "nantian-gw-dataplane" defaultAdminPortName = "admin" defaultAdminPort = 19080 @@ -30,7 +30,7 @@ const ( ) var defaultDataplaneSelector = map[string]string{ - "app": "nantian-dataplane", + "app": "nantian-gw-dataplane", } type Options struct { diff --git a/internal/infrastructure/reconciler_cleanup_test.go b/internal/infrastructure/reconciler_cleanup_test.go index 05d89f8b..8f9328a9 100644 --- a/internal/infrastructure/reconciler_cleanup_test.go +++ b/internal/infrastructure/reconciler_cleanup_test.go @@ -147,7 +147,7 @@ func TestReconcileDeletesSharedServiceWithoutManagedListeners(t *testing.T) { }, Spec: corev1.ServiceSpec{ Type: corev1.ServiceTypeNodePort, - Selector: map[string]string{"app": "nantian-dataplane"}, + Selector: map[string]string{"app": "nantian-gw-dataplane"}, Ports: []corev1.ServicePort{{ Name: "tcp-80", Port: 80, diff --git a/internal/infrastructure/reconciler_core_test.go b/internal/infrastructure/reconciler_core_test.go index 526e9e17..9de4e577 100644 --- a/internal/infrastructure/reconciler_core_test.go +++ b/internal/infrastructure/reconciler_core_test.go @@ -68,7 +68,7 @@ func TestReconcileCreatesGatewayInfrastructureServiceAndUpdatesSharedPorts(t *te }, Spec: corev1.ServiceSpec{ Type: corev1.ServiceTypeNodePort, - Selector: map[string]string{"app": "nantian-dataplane"}, + Selector: map[string]string{"app": "nantian-gw-dataplane"}, Ports: []corev1.ServicePort{ { Name: "tcp-80", @@ -187,7 +187,7 @@ func TestReconcileListsDataplanePodsOncePerRun(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", diff --git a/internal/infrastructure/reconciler_gateway_services_test.go b/internal/infrastructure/reconciler_gateway_services_test.go index a308a7c7..a6f82098 100644 --- a/internal/infrastructure/reconciler_gateway_services_test.go +++ b/internal/infrastructure/reconciler_gateway_services_test.go @@ -58,7 +58,7 @@ func TestReconcileSharedServiceUpdateAvoidsRedundantReread(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", @@ -146,7 +146,7 @@ func TestReconcileGatewayServiceUpdateAvoidsRedundantReread(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", @@ -564,7 +564,7 @@ func TestReconcilePropagatesGatewayInfrastructureMetadataToEndpointSlices(t *tes ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", diff --git a/internal/infrastructure/reconciler_mesh_scoped_queries_test.go b/internal/infrastructure/reconciler_mesh_scoped_queries_test.go index 41407113..f0dc9f17 100644 --- a/internal/infrastructure/reconciler_mesh_scoped_queries_test.go +++ b/internal/infrastructure/reconciler_mesh_scoped_queries_test.go @@ -89,7 +89,7 @@ func TestReconcileMeshServicesScopesServiceAndEndpointLookups(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", diff --git a/internal/infrastructure/reconciler_mesh_test.go b/internal/infrastructure/reconciler_mesh_test.go index 9278bb06..0592f364 100644 --- a/internal/infrastructure/reconciler_mesh_test.go +++ b/internal/infrastructure/reconciler_mesh_test.go @@ -51,7 +51,7 @@ func TestReconcileGatewayInfrastructureServicesAreIdempotent(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", @@ -267,7 +267,7 @@ func TestReconcileFrontsMeshServiceAndCreatesShadow(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", @@ -434,7 +434,7 @@ func TestReconcileMeshServicesUsesServiceParentRouteIndexes(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", @@ -490,7 +490,7 @@ func TestReconcileFrontsMeshServiceFromSnapshotStoreWhenRouteCacheLags(t *testin ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", @@ -592,7 +592,7 @@ func TestReconcileFrontsMeshServiceOnlyWithAckedCurrentSnapshotNodes(t *testing. ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-current", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", @@ -606,7 +606,7 @@ func TestReconcileFrontsMeshServiceOnlyWithAckedCurrentSnapshotNodes(t *testing. ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-stale", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.51", @@ -700,7 +700,7 @@ func TestReconcileMeshServiceRequiresCurrentSnapshotAckNodes(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-stable", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", @@ -803,7 +803,7 @@ func TestReconcileMeshServiceDeletesForeignEndpointSlicesBeforeManagedReplacemen ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", @@ -910,7 +910,7 @@ func TestReconcileFrontsSharedAndGatewayServicesOnlyWithAckedCurrentSnapshotNode ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-current", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", @@ -924,7 +924,7 @@ func TestReconcileFrontsSharedAndGatewayServicesOnlyWithAckedCurrentSnapshotNode ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-stale", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.51", @@ -1057,7 +1057,7 @@ func TestReconcileFrontsSharedAndGatewayServicesRequireCurrentSnapshotAck(t *tes ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-stable-a", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", @@ -1071,7 +1071,7 @@ func TestReconcileFrontsSharedAndGatewayServicesRequireCurrentSnapshotAck(t *tes ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-stable-b", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.51", diff --git a/internal/infrastructure/reconciler_ownership_test.go b/internal/infrastructure/reconciler_ownership_test.go index 9bf638b8..6b62287e 100644 --- a/internal/infrastructure/reconciler_ownership_test.go +++ b/internal/infrastructure/reconciler_ownership_test.go @@ -130,7 +130,7 @@ func TestReconcileRemovesStaleInfrastructureParameterAnnotationOnRollback(t *tes "nantian.dev/infrastructure-parameters-ref": "default/stale-params", "nantian.dev/service-parameters-hash": "stale", "nantian.dev/owner-generation": "1", - "example.com/trace": "stale", + "example.com/trace": "stale", }, }, Spec: corev1.ServiceSpec{ @@ -236,7 +236,7 @@ func TestReconcilePropagatesOwnershipAnnotationsToGatewayEndpointSlices(t *testi ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", diff --git a/internal/infrastructure/reconciler_parameters_test.go b/internal/infrastructure/reconciler_parameters_test.go index d6237bea..e0d8aba6 100644 --- a/internal/infrastructure/reconciler_parameters_test.go +++ b/internal/infrastructure/reconciler_parameters_test.go @@ -74,7 +74,7 @@ func TestReconcileResolvesGatewayServiceParametersOncePerGateway(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", @@ -185,7 +185,7 @@ func TestReconcileCachesGatewayClassParametersAcrossGateways(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "nantian-dataplane-0", Namespace: defaultDataplaneNamespace, - Labels: map[string]string{"app": "nantian-dataplane"}, + Labels: map[string]string{"app": "nantian-gw-dataplane"}, }, Status: corev1.PodStatus{ PodIP: "10.0.0.50", @@ -745,7 +745,7 @@ func TestReconcileResetsGatewayServiceFieldsWhenParametersRefRemoved(t *testing. }, Spec: corev1.ServiceSpec{ Type: corev1.ServiceTypeLoadBalancer, - Selector: map[string]string{"app": "nantian-dataplane"}, + Selector: map[string]string{"app": "nantian-gw-dataplane"}, ExternalTrafficPolicy: corev1.ServiceExternalTrafficPolicyLocal, InternalTrafficPolicy: &internalTrafficPolicy, SessionAffinity: corev1.ServiceAffinityClientIP,