[FEATURE] Server service containerization

This commit is contained in:
Dunemask 2023-12-19 11:39:01 -07:00
parent 22bf905415
commit 12d198456c
9 changed files with 165 additions and 91 deletions

View file

@ -47,11 +47,13 @@ export async function getInstances() {
const serverInstances = serverDeployments.map((s) => {
name = s.metadata.annotations["minecluster.dunemask.net/server-name"];
metrics = null;
started = !!s.spec.replicas;
started = !!s.spec.template.spec.containers.find((c) =>
c.name.includes(`mcl-${name}-server`),
);
const pod = podMetricsResponse.items.find(({ metadata: md }) => {
return md.labels && md.labels.app && md.labels.app === `mcl-${name}-app`;
});
if (pod) {
if (started && pod) {
const podCpus = pod.containers.map(
({ usage }) => parseInt(usage.cpu) / 1_000_000,
);