mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
refactor(k8s): namespace core logic (#12142)
Co-authored-by: testA113 <aliharriss1995@gmail.com> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: James Carppe <85850129+jamescarppe@users.noreply.github.com> Co-authored-by: Ali <83188384+testA113@users.noreply.github.com>
This commit is contained in:
parent
da010f3d08
commit
ea228c3d6d
276 changed files with 9241 additions and 3361 deletions
|
@ -1,11 +1,77 @@
|
|||
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"`
|
||||
}
|
||||
import (
|
||||
"time"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
type K8sApplication struct {
|
||||
ID string `json:"Id"`
|
||||
Name string `json:"Name"`
|
||||
Image string `json:"Image"`
|
||||
Containers []interface{} `json:"Containers,omitempty"`
|
||||
Services []corev1.Service `json:"Services"`
|
||||
CreationDate time.Time `json:"CreationDate"`
|
||||
ApplicationOwner string `json:"ApplicationOwner,omitempty"`
|
||||
StackName string `json:"StackName,omitempty"`
|
||||
ResourcePool string `json:"ResourcePool"`
|
||||
ApplicationType string `json:"ApplicationType"`
|
||||
Metadata *Metadata `json:"Metadata,omitempty"`
|
||||
Status string `json:"Status"`
|
||||
TotalPodsCount int `json:"TotalPodsCount"`
|
||||
RunningPodsCount int `json:"RunningPodsCount"`
|
||||
DeploymentType string `json:"DeploymentType"`
|
||||
Pods []Pod `json:"Pods,omitempty"`
|
||||
Configurations []Configuration `json:"Configurations,omitempty"`
|
||||
LoadBalancerIPAddress string `json:"LoadBalancerIPAddress,omitempty"`
|
||||
PublishedPorts []PublishedPort `json:"PublishedPorts,omitempty"`
|
||||
Namespace string `json:"Namespace,omitempty"`
|
||||
UID string `json:"Uid,omitempty"`
|
||||
StackID string `json:"StackId,omitempty"`
|
||||
ServiceID string `json:"ServiceId,omitempty"`
|
||||
ServiceName string `json:"ServiceName,omitempty"`
|
||||
ServiceType string `json:"ServiceType,omitempty"`
|
||||
Kind string `json:"Kind,omitempty"`
|
||||
MatchLabels map[string]string `json:"MatchLabels,omitempty"`
|
||||
Labels map[string]string `json:"Labels,omitempty"`
|
||||
Resource K8sApplicationResource `json:"Resource,omitempty"`
|
||||
}
|
||||
|
||||
type Metadata struct {
|
||||
Labels map[string]string `json:"labels"`
|
||||
}
|
||||
|
||||
type Pod struct {
|
||||
Status string `json:"Status"`
|
||||
}
|
||||
|
||||
type Configuration struct {
|
||||
Data map[string]interface{} `json:"Data,omitempty"`
|
||||
Kind string `json:"Kind"`
|
||||
ConfigurationOwner string `json:"ConfigurationOwner"`
|
||||
}
|
||||
|
||||
type PublishedPort struct {
|
||||
IngressRules []IngressRule `json:"IngressRules"`
|
||||
Port int `json:"Port"`
|
||||
}
|
||||
|
||||
type IngressRule struct {
|
||||
Host string `json:"Host"`
|
||||
IP string `json:"IP"`
|
||||
Path string `json:"Path"`
|
||||
TLS []TLSInfo `json:"TLS"`
|
||||
}
|
||||
|
||||
type TLSInfo struct {
|
||||
Hosts []string `json:"hosts"`
|
||||
}
|
||||
|
||||
// Existing types
|
||||
type K8sApplicationResource struct {
|
||||
CPURequest int64 `json:"CpuRequest"`
|
||||
CPULimit int64 `json:"CpuLimit"`
|
||||
MemoryRequest int64 `json:"MemoryRequest"`
|
||||
MemoryLimit int64 `json:"MemoryLimit"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue