Skip to content

frontend: MapView: Build MapView for Gateway API #3776

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

Merged
merged 1 commit into from
Aug 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions frontend/src/components/gateway/ClassDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ import GatewayClass, { KubeGatewayClass } from '../../lib/k8s/gatewayClass';
import { ConditionsTable, DetailsGrid } from '../common/Resource';
import SectionBox from '../common/SectionBox';

export default function GatewayClassDetails() {
const { name } = useParams<{ name: string }>();
export default function GatewayClassDetails(props: { name?: string }) {
const params = useParams<{ name: string }>();
const { name = params.name } = props;
const { t } = useTranslation(['glossary', 'translation']);

return (
Expand Down
13 changes: 13 additions & 0 deletions frontend/src/components/resourceMap/details/KubeNodeDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ import CustomResourceDefinitionDetails from '../../crd/Details';
import CronJobDetails from '../../cronjob/Details';
import DaemonSetDetails from '../../daemonset/Details';
import EndpointDetails from '../../endpoints/Details';
import BackendTLSPolicyDetails from '../../gateway/BackendTLSPolicyDetails';
import GatewayClassDetails from '../../gateway/ClassDetails';
import GatewayDetails from '../../gateway/GatewayDetails';
import GRPCRouteDetails from '../../gateway/GRPCRouteDetails';
import HTTPRouteDetails from '../../gateway/HTTPRouteDetails';
import ReferenceGrantDetails from '../../gateway/ReferenceGrantDetails';
import HpaDetails from '../../horizontalPodAutoscaler/Details';
import IngressClassDetails from '../../ingress/ClassDetails';
import IngressDetails from '../../ingress/Details';
Expand Down Expand Up @@ -91,6 +97,13 @@ const kindComponentMap: Record<
IngressClass: IngressClassDetails,
CustomResourceDefinition: CustomResourceDefinitionDetails,
crd: CustomResourceDefinitionDetails,
Gateway: GatewayDetails,
GatewayClass: GatewayClassDetails,
HTTPRoute: HTTPRouteDetails,
GRPCRoute: GRPCRouteDetails,
ReferenceGrant: ReferenceGrantDetails,
BackendTLSPolicy: BackendTLSPolicyDetails,
XBackendTrafficPolicy: BackendTLSPolicyDetails,
};

export const canRenderDetails = (maybeKind: string) =>
Expand Down
14 changes: 14 additions & 0 deletions frontend/src/components/resourceMap/kubeIcon/img/gateway.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@
*/

import { useMemo } from 'react';
import BackendTLSPolicy from '../../../../lib/k8s/backendTLSPolicy';
import BackendTrafficPolicy from '../../../../lib/k8s/backendTrafficPolicy';
import ConfigMap from '../../../../lib/k8s/configMap';
import CustomResourceDefinition from '../../../../lib/k8s/crd';
import CronJob from '../../../../lib/k8s/cronJob';
import DaemonSet from '../../../../lib/k8s/daemonSet';
import Deployment from '../../../../lib/k8s/deployment';
import Endpoints from '../../../../lib/k8s/endpoints';
import Gateway from '../../../../lib/k8s/gateway';
import GatewayClass from '../../../../lib/k8s/gatewayClass';
import HPA from '../../../../lib/k8s/hpa';
import HTTPRoute from '../../../../lib/k8s/httpRoute';
import Ingress from '../../../../lib/k8s/ingress';
import Job from '../../../../lib/k8s/job';
import { KubeObject, KubeObjectClass } from '../../../../lib/k8s/KubeObject';
Expand Down Expand Up @@ -221,6 +226,38 @@ const jobToCronJob = makeRelation(Job, CronJob, (job, cronJob) =>
job.metadata.ownerReferences?.find(owner => owner.uid === cronJob.metadata.uid)
);

const gatewayToGatewayClass = makeRelation(
Gateway,
GatewayClass,
(gateway, gatewayClass) => gateway.spec.gatewayClassName === gatewayClass.metadata.name
);

const httpRouteToGateway = makeRelation(HTTPRoute, Gateway, (httpRoute, gateway) =>
httpRoute.spec.parentRefs?.find(ref => ref.name === gateway.metadata.name)
);

const httpRouteToService = makeRelation(HTTPRoute, Service, (httpRoute, service) =>
httpRoute.spec.rules?.find(rule =>
rule.backendRefs?.find(backend => backend.name === service.metadata.name)
)
);

const backendTLSPolicyToService = makeRelation(
BackendTLSPolicy,
Service,
(tlsPolicy, service) =>
tlsPolicy.spec.targetRef?.name === service.metadata.name &&
tlsPolicy.spec.targetRef?.kind === 'Service'
);

const backendTrafficPolicyToService = makeRelation(
BackendTrafficPolicy,
Service,
(trafficPolicy, service) =>
trafficPolicy.spec.targetRef?.name === service.metadata.name &&
trafficPolicy.spec.targetRef?.kind === 'Service'
);

export function useGetAllRelations(): Relation[] {
const staticRelations = [
configMapUsedInPods,
Expand All @@ -244,6 +281,11 @@ export function useGetAllRelations(): Relation[] {
podToOwner,
repliaceSetToOwner,
jobToCronJob,
gatewayToGatewayClass,
httpRouteToGateway,
httpRouteToService,
backendTLSPolicyToService,
backendTrafficPolicyToService,
];

const crdRelations = useGetCRToOwnerRelations();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@

import { Icon } from '@iconify/react';
import React, { useMemo } from 'react';
import BackendTLSPolicy from '../../../../lib/k8s/backendTLSPolicy';
import BackendTrafficPolicy from '../../../../lib/k8s/backendTrafficPolicy';
import ConfigMap from '../../../../lib/k8s/configMap';
import CRD from '../../../../lib/k8s/crd';
import CronJob from '../../../../lib/k8s/cronJob';
import DaemonSet from '../../../../lib/k8s/daemonSet';
import Deployment from '../../../../lib/k8s/deployment';
import Endpoints from '../../../../lib/k8s/endpoints';
import Gateway from '../../../../lib/k8s/gateway';
import GatewayClass from '../../../../lib/k8s/gatewayClass';
import GRPCRoute from '../../../../lib/k8s/grpcRoute';
import HPA from '../../../../lib/k8s/hpa';
import HTTPRoute from '../../../../lib/k8s/httpRoute';
import Ingress from '../../../../lib/k8s/ingress';
import IngressClass from '../../../../lib/k8s/ingressClass';
import Job from '../../../../lib/k8s/job';
Expand All @@ -31,6 +37,7 @@ import MutatingWebhookConfiguration from '../../../../lib/k8s/mutatingWebhookCon
import NetworkPolicy from '../../../../lib/k8s/networkpolicy';
import PersistentVolumeClaim from '../../../../lib/k8s/persistentVolumeClaim';
import Pod from '../../../../lib/k8s/pod';
import ReferenceGrant from '../../../../lib/k8s/referenceGrant';
import ReplicaSet from '../../../../lib/k8s/replicaSet';
import Role from '../../../../lib/k8s/role';
import RoleBinding from '../../../../lib/k8s/roleBinding';
Expand Down Expand Up @@ -174,6 +181,28 @@ export function useGetAllSources(): GraphSource[] {
// leases
],
},
{
id: 'gateway-beta',
label: 'Gateway (beta)',
icon: (
<Icon
icon="mdi:lan-connect"
width="100%"
height="100%"
color={getKindGroupColor('network')}
/>
),
isEnabledByDefault: false,
sources: [
makeKubeSource(GatewayClass),
makeKubeSource(Gateway),
makeKubeSource(HTTPRoute),
makeKubeSource(GRPCRoute),
makeKubeSource(ReferenceGrant),
makeKubeSource(BackendTLSPolicy),
makeKubeSource(BackendTrafficPolicy),
],
},
];

if (CustomResourceDefinition !== null) {
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/i18n/locales/de/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"Help": "Hilfe",
"Documentation": "Dokumentation",
"Open an Issue": "Ein Problem melden",
"Invalid URL": "Ungültige URL",
"Application opened with an invalid URL: {{ url }}": "Anwendung mit einer ungültigen URL geöffnet: {{ url }}",
"Another process is running": "Ein anderer Prozess läuft",
"Looks like another process is already running. Continue by terminating that process automatically, or quit?": "Es sieht so aus, als ob bereits ein anderer Prozess läuft. Fortfahren, indem Sie diesen Prozess automatisch beenden, oder beenden?",
"Continue": "Weiter",
"Failed to quit the other running process": "Konnte den anderen laufenden Prozess nicht beenden",
"Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.": "Konnte den anderen laufenden Prozess nicht beenden, PIDs: {{ process_list }}. Bitte stoppen Sie diesen Prozess und starten Sie die App neu."
"Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.": "Konnte den anderen laufenden Prozess nicht beenden, PIDs: {{ process_list }}. Bitte stoppen Sie diesen Prozess und starten Sie die App neu.",
"Invalid URL": "Ungültige URL",
"Application opened with an invalid URL: {{ url }}": "Anwendung mit einer ungültigen URL geöffnet: {{ url }}"
}
6 changes: 3 additions & 3 deletions frontend/src/i18n/locales/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"Help": "Help",
"Documentation": "Documentation",
"Open an Issue": "Open an Issue",
"Invalid URL": "Invalid URL",
"Application opened with an invalid URL: {{ url }}": "Application opened with an invalid URL: {{ url }}",
"Another process is running": "Another process is running",
"Looks like another process is already running. Continue by terminating that process automatically, or quit?": "Looks like another process is already running. Continue by terminating that process automatically, or quit?",
"Continue": "Continue",
"Failed to quit the other running process": "Failed to quit the other running process",
"Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.": "Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app."
"Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.": "Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.",
"Invalid URL": "Invalid URL",
"Application opened with an invalid URL: {{ url }}": "Application opened with an invalid URL: {{ url }}"
}
6 changes: 3 additions & 3 deletions frontend/src/i18n/locales/es/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"Help": "Ayuda",
"Documentation": "Documentación",
"Open an Issue": "Abrir un incidente",
"Invalid URL": "URL inválida",
"Application opened with an invalid URL: {{ url }}": "Aplicación abierta con una URL inválida: {{ url }}",
"Another process is running": "Un otro proceso está corriendo",
"Looks like another process is already running. Continue by terminating that process automatically, or quit?": "Parece que ya hay un otro proceso corriendo. Continuar y terminar el proceso automaticamente ou salir?",
"Continue": "Continuar",
"Failed to quit the other running process": "Fallo al quitar el otro proceso en ejecución",
"Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.": "No se ha podido terminar el otro proceso, PIDs: {{ process_list }}. Por favor, termine el otro proceso y vuelva a lanzar la aplicación."
"Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.": "No se ha podido terminar el otro proceso, PIDs: {{ process_list }}. Por favor, termine el otro proceso y vuelva a lanzar la aplicación.",
"Invalid URL": "URL inválida",
"Application opened with an invalid URL: {{ url }}": "Aplicación abierta con una URL inválida: {{ url }}"
}
6 changes: 3 additions & 3 deletions frontend/src/i18n/locales/fr/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"Help": "Aide",
"Documentation": "Documentation",
"Open an Issue": "Ouvrir un problème",
"Invalid URL": "URL invalide",
"Application opened with an invalid URL: {{ url }}": "Application ouverte avec une URL invalide : {{ url }}",
"Another process is running": "Un autre processus est en cours",
"Looks like another process is already running. Continue by terminating that process automatically, or quit?": "Il semble qu'un autre processus soit déjà en cours. Continuer en terminant ce processus automatiquement, ou quitter ?",
"Continue": "Continuer",
"Failed to quit the other running process": "Échec de la fermeture de l'autre processus en cours",
"Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.": "Impossible de quitter l'autre processus en cours, PIDs : {{ process_list }}. Veuillez arrêter ce processus et relancer l'application."
"Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.": "Impossible de quitter l'autre processus en cours, PIDs : {{ process_list }}. Veuillez arrêter ce processus et relancer l'application.",
"Invalid URL": "URL invalide",
"Application opened with an invalid URL: {{ url }}": "Application ouverte avec une URL invalide : {{ url }}"
}
6 changes: 3 additions & 3 deletions frontend/src/i18n/locales/hi/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"Help": "सहायता",
"Documentation": "दस्तावेज़ीकरण",
"Open an Issue": "एक इशू खोलें",
"Invalid URL": "अमान्य URL",
"Application opened with an invalid URL: {{ url }}": "अनुप्रयोग एक अमान्य URL के साथ खोला गया: {{ url }}",
"Another process is running": "एक अन्य प्रक्रिया चल रही है",
"Looks like another process is already running. Continue by terminating that process automatically, or quit?": "लगता है कि एक अन्य प्रक्रिया पहले से ही चल रही है। उस प्रक्रिया को स्वचालित रूप से समाप्त करके जारी रखें, या बाहर निकलें?",
"Continue": "जारी रखें",
"Failed to quit the other running process": "अन्य चल रही प्रक्रिया से बाहर निकलने में विफल",
"Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.": "अन्य चल रही प्रक्रिया से बाहर नहीं निकल सका, PIDs: {{ process_list }}। कृपया उस प्रक्रिया को रोकें और ऐप को फिर से लॉन्च करें।"
"Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.": "अन्य चल रही प्रक्रिया से बाहर नहीं निकल सका, PIDs: {{ process_list }}। कृपया उस प्रक्रिया को रोकें और ऐप को फिर से लॉन्च करें।",
"Invalid URL": "अमान्य URL",
"Application opened with an invalid URL: {{ url }}": "अनुप्रयोग एक अमान्य URL के साथ खोला गया: {{ url }}"
}
6 changes: 3 additions & 3 deletions frontend/src/i18n/locales/it/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"Help": "Aiuto",
"Documentation": "Documentazione",
"Open an Issue": "Segnala un Problema",
"Invalid URL": "URL Non Valido",
"Application opened with an invalid URL: {{ url }}": "Applicazione avviata con un URL non valido: {{ url }}",
"Another process is running": "Un altro processo è in esecuzione",
"Looks like another process is already running. Continue by terminating that process automatically, or quit?": "Sembra che un altro processo sia già in esecuzione. Vuoi continuare terminando automaticamente quel processo o uscire?",
"Continue": "Continua",
"Failed to quit the other running process": "Impossibile terminare l'altro processo in esecuzione",
"Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.": "Impossibile terminare l'altro processo in esecuzione, PID: {{ process_list }}. Ferma quel processo e riavvia l'app."
"Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.": "Impossibile terminare l'altro processo in esecuzione, PID: {{ process_list }}. Ferma quel processo e riavvia l'app.",
"Invalid URL": "URL Non Valido",
"Application opened with an invalid URL: {{ url }}": "Applicazione avviata con un URL non valido: {{ url }}"
}
6 changes: 3 additions & 3 deletions frontend/src/i18n/locales/ja/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"Help": "ヘルプ",
"Documentation": "ドキュメント",
"Open an Issue": "問題を報告",
"Invalid URL": "無効な URL",
"Application opened with an invalid URL: {{ url }}": "無効な URL でアプリケーションが開かれました: {{ url }}",
"Another process is running": "別のプロセスが実行中です",
"Looks like another process is already running. Continue by terminating that process automatically, or quit?": "別のプロセスが既に実行されているようです。そのプロセスを自動的に終了して続行しますか、それとも終了しますか?",
"Continue": "続行",
"Failed to quit the other running process": "他の実行中のプロセスの終了に失敗しました",
"Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.": "他の実行中のプロセス PID: {{ process_list }} を終了できませんでした。そのプロセスを停止してアプリを再起動してください。"
"Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.": "他の実行中のプロセス PID: {{ process_list }} を終了できませんでした。そのプロセスを停止してアプリを再起動してください。",
"Invalid URL": "無効な URL",
"Application opened with an invalid URL: {{ url }}": "無効な URL でアプリケーションが開かれました: {{ url }}"
}
6 changes: 3 additions & 3 deletions frontend/src/i18n/locales/ko/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"Help": "도움말",
"Documentation": "문서",
"Open an Issue": "이슈 열기",
"Invalid URL": "잘못된 URL",
"Application opened with an invalid URL: {{ url }}": "잘못된 URL로 애플리케이션이 열렸습니다: {{ url }}",
"Another process is running": "다른 프로세스가 실행 중입니다",
"Looks like another process is already running. Continue by terminating that process automatically, or quit?": "이미 다른 프로세스가 실행 중인 것 같습니다. 해당 프로세스를 자동으로 종료하고 계속하시겠습니까, 아니면 종료하시겠습니까?",
"Continue": "계속",
"Failed to quit the other running process": "다른 실행 중인 프로세스를 종료하지 못했습니다",
"Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.": "다른 실행 중인 프로세스를 종료할 수 없습니다. PID: {{ process_list }}. 해당 프로세스를 종료한 후 앱을 다시 실행하세요."
"Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.": "다른 실행 중인 프로세스를 종료할 수 없습니다. PID: {{ process_list }}. 해당 프로세스를 종료한 후 앱을 다시 실행하세요.",
"Invalid URL": "잘못된 URL",
"Application opened with an invalid URL: {{ url }}": "잘못된 URL로 애플리케이션이 열렸습니다: {{ url }}"
}
6 changes: 3 additions & 3 deletions frontend/src/i18n/locales/pt/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"Help": "Ajuda",
"Documentation": "Documentação",
"Open an Issue": "Abrir um incidente",
"Invalid URL": "URL inválido",
"Application opened with an invalid URL: {{ url }}": "Aplicação aberta com um URL inválido: {{ url }}",
"Another process is running": "Há outro processo em execução",
"Looks like another process is already running. Continue by terminating that process automatically, or quit?": "Parece que há outro processo em execução. Continuar com a eliminação automática desse processo ou sair?",
"Continue": "Continuar",
"Failed to quit the other running process": "Falha ao eliminar o outro processo em execução",
"Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.": "Não foi possível eliminar o outro processo em execução. PIDs: {{ process_list }}. Por favor pare esse processo e reinicie o programa."
"Could not quit the other running process, PIDs: {{ process_list }}. Please stop that process and relaunch the app.": "Não foi possível eliminar o outro processo em execução. PIDs: {{ process_list }}. Por favor pare esse processo e reinicie o programa.",
"Invalid URL": "URL inválido",
"Application opened with an invalid URL: {{ url }}": "Aplicação aberta com um URL inválido: {{ url }}"
}
Loading
Loading