mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-08 06:38:46 +00:00
Enhancement: support for Kubernetes gateway API (#4643)
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com> Co-authored-by: lyons <gittea.sand@gmail.com> Co-authored-by: Brett Dudo <brett@dudo.io>
This commit is contained in:
parent
2a95f88cdf
commit
91d5fc8e42
14 changed files with 407 additions and 168 deletions
26
src/utils/kubernetes/ingress-list.js
Normal file
26
src/utils/kubernetes/ingress-list.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
import { NetworkingV1Api } from "@kubernetes/client-node";
|
||||
|
||||
import { getKubernetes, getKubeConfig } from "utils/config/kubernetes";
|
||||
import createLogger from "utils/logger";
|
||||
|
||||
const logger = createLogger("ingress-list");
|
||||
const kc = getKubeConfig();
|
||||
|
||||
export default async function listIngress() {
|
||||
const networking = kc.makeApiClient(NetworkingV1Api);
|
||||
const { ingress } = getKubernetes();
|
||||
let ingressList = [];
|
||||
|
||||
if (ingress) {
|
||||
const ingressData = await networking
|
||||
.listIngressForAllNamespaces()
|
||||
.then((response) => response)
|
||||
.catch((error) => {
|
||||
logger.error("Error getting ingresses: %d %s %s", error.statusCode, error.body, error.response);
|
||||
logger.debug(error);
|
||||
return null;
|
||||
});
|
||||
ingressList = ingressData.items;
|
||||
}
|
||||
return ingressList;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue