mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 05:45:22 +02:00
feat(kubernetes): add ingress details (#4013)
* feat(kubernetes): add ingress details * fix(kubernetes): fix broken ingress generated links + ignore IP retrieval/display info on missing LB ingress ip * refactor(kubernetes): each ingress rule in apps port mappings has now its own row * feat(kubernetes): remove protocol column and concat it to container port * feat(kubernetes): edit display of ingress rules in application details * feat(kubernetes): minor UI update Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
This commit is contained in:
parent
b09b1b1691
commit
1b3e2c8f69
19 changed files with 450 additions and 137 deletions
19
app/kubernetes/ingress/converter.js
Normal file
19
app/kubernetes/ingress/converter.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
import * as _ from 'lodash-es';
|
||||
import { KubernetesIngressRule } from './models';
|
||||
|
||||
export class KubernetesIngressConverter {
|
||||
static apiToModel(data) {
|
||||
const rules = _.flatMap(data.spec.rules, (rule) => {
|
||||
return _.map(rule.http.paths, (path) => {
|
||||
const ingRule = new KubernetesIngressRule();
|
||||
ingRule.ServiceName = path.backend.serviceName;
|
||||
ingRule.Host = rule.host;
|
||||
ingRule.IP = data.status.loadBalancer.ingress ? data.status.loadBalancer.ingress[0].ip : undefined;
|
||||
ingRule.Port = path.backend.servicePort;
|
||||
ingRule.Path = path.path;
|
||||
return ingRule;
|
||||
});
|
||||
});
|
||||
return rules;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue