Render diagrams from your kubernetes manifests.
Use kubernetes-models-ts, react-flow and dagre for layouting.
See demo : https://socialgouv.github.io/react-k8s-viewer
K8sViewer
expect a list of Manifest
or a ManifestList
as JSON
import { K8sViewer } from "@socialgouv/react-k8s-viewer";
import manifests from "./manifests.json";
const App = () => (
<div style={{ width: 1000, height: 400 }}>
<K8sViewer manifests={manifests} />
</div>
);
To extract the manifests from some namespace:
kubectl --namespace some-app get deploy,ing,service,secret,sealedsecret,configmap -ojson > manifests.json
- handle multiple namespaces