mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
feat(kubernetes): list all kube services screen [EE-1571] (#8524)
* port services from ee * fix external link * post review improvements * remove applications-ports-datatable * minor post review updates * add services help url * post review update * more post review updates * post review updates * rename index to component * fix external ip display and sorting * fix external apps tag * fix ingress screen time format * use uid for row id. Prevent blank link * fix some missing bits ported from EE * match ee * fix display of show system resources * remove icon next to service type
This commit is contained in:
parent
8d6797dc9f
commit
ac47649631
43 changed files with 1121 additions and 456 deletions
|
@ -37,7 +37,15 @@ func (handler *Handler) getKubernetesServices(w http.ResponseWriter, r *http.Req
|
|||
)
|
||||
}
|
||||
|
||||
services, err := cli.GetServices(namespace)
|
||||
lookup, err := request.RetrieveBooleanQueryParameter(r, "lookupapplications", true)
|
||||
if err != nil {
|
||||
return httperror.BadRequest(
|
||||
"Invalid lookupapplications query parameter",
|
||||
err,
|
||||
)
|
||||
}
|
||||
|
||||
services, err := cli.GetServices(namespace, lookup)
|
||||
if err != nil {
|
||||
return httperror.InternalServerError(
|
||||
"Unable to retrieve services",
|
||||
|
|
11
api/http/models/kubernetes/application.go
Normal file
11
api/http/models/kubernetes/application.go
Normal file
|
@ -0,0 +1,11 @@
|
|||
package kubernetes
|
||||
|
||||
type (
|
||||
K8sApplication struct {
|
||||
UID string `json:",omitempty"`
|
||||
Name string `json:""`
|
||||
Namespace string `json:",omitempty"`
|
||||
Kind string `json:",omitempty"`
|
||||
Labels map[string]string `json:",omitempty"`
|
||||
}
|
||||
)
|
|
@ -3,6 +3,7 @@ package kubernetes
|
|||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
type (
|
||||
|
@ -18,15 +19,17 @@ type (
|
|||
K8sIngressControllers []K8sIngressController
|
||||
|
||||
K8sIngressInfo struct {
|
||||
Name string `json:"Name"`
|
||||
UID string `json:"UID"`
|
||||
Type string `json:"Type"`
|
||||
Namespace string `json:"Namespace"`
|
||||
ClassName string `json:"ClassName"`
|
||||
Annotations map[string]string `json:"Annotations"`
|
||||
Hosts []string `json:"Hosts"`
|
||||
Paths []K8sIngressPath `json:"Paths"`
|
||||
TLS []K8sIngressTLS `json:"TLS"`
|
||||
Name string `json:"Name"`
|
||||
UID string `json:"UID"`
|
||||
Type string `json:"Type"`
|
||||
Namespace string `json:"Namespace"`
|
||||
ClassName string `json:"ClassName"`
|
||||
Annotations map[string]string `json:"Annotations"`
|
||||
Hosts []string `json:"Hosts"`
|
||||
Paths []K8sIngressPath `json:"Paths"`
|
||||
TLS []K8sIngressTLS `json:"TLS"`
|
||||
Labels map[string]string `json:"Labels,omitempty"`
|
||||
CreationDate time.Time `json:"CreationDate"`
|
||||
}
|
||||
|
||||
K8sIngressTLS struct {
|
||||
|
|
|
@ -7,17 +7,23 @@ import (
|
|||
|
||||
type (
|
||||
K8sServiceInfo struct {
|
||||
Name string `json:"Name"`
|
||||
UID string `json:"UID"`
|
||||
Type string `json:"Type"`
|
||||
Namespace string `json:"Namespace"`
|
||||
Annotations map[string]string `json:"Annotations"`
|
||||
CreationTimestamp string `json:"CreationTimestamp"`
|
||||
Labels map[string]string `json:"Labels"`
|
||||
AllocateLoadBalancerNodePorts *bool `json:"AllocateLoadBalancerNodePorts,omitempty"`
|
||||
Ports []K8sServicePort `json:"Ports"`
|
||||
Selector map[string]string `json:"Selector"`
|
||||
IngressStatus []K8sServiceIngress `json:"IngressStatus"`
|
||||
Name string
|
||||
UID string
|
||||
Type string
|
||||
Namespace string
|
||||
Annotations map[string]string
|
||||
CreationTimestamp string
|
||||
Labels map[string]string
|
||||
AllocateLoadBalancerNodePorts *bool `json:",omitempty"`
|
||||
Ports []K8sServicePort
|
||||
Selector map[string]string
|
||||
IngressStatus []K8sServiceIngress `json:",omitempty"`
|
||||
|
||||
// serviceList screen
|
||||
Applications []K8sApplication `json:",omitempty"`
|
||||
ClusterIPs []string `json:",omitempty"`
|
||||
ExternalName string `json:",omitempty"`
|
||||
ExternalIPs []string `json:",omitempty"`
|
||||
}
|
||||
|
||||
K8sServicePort struct {
|
||||
|
@ -25,7 +31,7 @@ type (
|
|||
NodePort int `json:"NodePort"`
|
||||
Port int `json:"Port"`
|
||||
Protocol string `json:"Protocol"`
|
||||
TargetPort int `json:"TargetPort"`
|
||||
TargetPort string `json:"TargetPort"`
|
||||
}
|
||||
|
||||
K8sServiceIngress struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue