mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
feat(node): Show which IP address / port the cluster API is listening on (#4134)
* feat(cluster): add kubernetes endpoint resource * feat(cluster): add kubernetes endpoint service * feat(node): Show which IP address / port the cluster API is listening on * fix(cluster): support multi-master clusters * fix(cluster): support multi-master clusters * feat(k8s/cluster): minor UI update * refactor(k8s/cluster): rename variable * refactor(k8s/endpoints): refactor KubernetesEndpointsFactory Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
This commit is contained in:
parent
6756b04b67
commit
148ccd1bc4
9 changed files with 110 additions and 8 deletions
|
@ -1,4 +1,4 @@
|
|||
import { KubernetesEndpoint, KubernetesEndpointAnnotationLeader } from 'Kubernetes/endpoint/models';
|
||||
import { KubernetesEndpoint, KubernetesEndpointAnnotationLeader, KubernetesEndpointSubset } from 'Kubernetes/endpoint/models';
|
||||
import _ from 'lodash-es';
|
||||
|
||||
class KubernetesEndpointConverter {
|
||||
|
@ -13,6 +13,16 @@ class KubernetesEndpointConverter {
|
|||
const split = _.split(parsedJson.holderIdentity, '_');
|
||||
res.HolderIdentity = split[0];
|
||||
}
|
||||
|
||||
if (data.subsets) {
|
||||
res.Subsets = _.map(data.subsets, (item) => {
|
||||
const subset = new KubernetesEndpointSubset();
|
||||
subset.Ips = _.map(item.addresses, 'ip');
|
||||
const port = _.find(item.ports, { name: 'https' });
|
||||
subset.Port = port ? port.port : undefined;
|
||||
return subset;
|
||||
});
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue