resource

package
v0.0.0-...-1ae172a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2023 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReleaseStatusRunning      = "Running"
	ReleaseStatusNotReady     = "NotReady"
	ReleaseStatusRunningFault = "RunningFault"
)

Variables

View Source
var (
	NetworkIngressGVR = &schema.GroupVersionResource{
		Group:    "networking.k8s.io",
		Version:  "v1",
		Resource: "ingresses",
	}

	ExtensionIngressGVR = &schema.GroupVersionResource{
		Group:    "extensions",
		Version:  "v1beta1",
		Resource: "ingresses",
	}
)
View Source
var (
	RoleGVR = &schema.GroupVersionResource{
		Group:    "rbac.authorization.k8s.io",
		Version:  "v1",
		Resource: "roles",
	}
	RoleV1Beta1GVR = &schema.GroupVersionResource{
		Group:    "rbac.authorization.k8s.io",
		Version:  "v1beta1",
		Resource: "roles",
	}

	ClusterRoleGVR = &schema.GroupVersionResource{
		Group:    "rbac.authorization.k8s.io",
		Version:  "v1",
		Resource: "clusterroles",
	}
	ClusterRoleV1Beta1GVR = &schema.GroupVersionResource{
		Group:    "rbac.authorization.k8s.io",
		Version:  "v1beta1",
		Resource: "clusterroles",
	}
)
View Source
var (
	RoleBindingGVR = &schema.GroupVersionResource{
		Group:    "rbac.authorization.k8s.io",
		Version:  "v1",
		Resource: "rolebindings",
	}
	RoleBindingV1Beta1GVR = &schema.GroupVersionResource{
		Group:    "rbac.authorization.k8s.io",
		Version:  "v1beta1",
		Resource: "rolebindings",
	}

	ClusterRoleBindingGVR = &schema.GroupVersionResource{
		Group:    "rbac.authorization.k8s.io",
		Version:  "v1",
		Resource: "clusterrolebindings",
	}
	ClusterRoleBindingV1Beta1GVR = &schema.GroupVersionResource{
		Group:    "rbac.authorization.k8s.io",
		Version:  "v1beta1",
		Resource: "clusterrolebindings",
	}
)
View Source
var ConfigmapGVR = &schema.GroupVersionResource{
	Group:    "",
	Version:  "v1",
	Resource: "configmaps",
}
View Source
var CronJobGVR = &schema.GroupVersionResource{
	Group:    "batch",
	Version:  "v1beta1",
	Resource: "cronjobs",
}
View Source
var CronJobV1GVR = &schema.GroupVersionResource{
	Group:    "batch",
	Version:  "v1",
	Resource: "cronjobs",
}
View Source
var CustomResourceDefinitionGVR = &schema.GroupVersionResource{
	Group:    "apiextensions.k8s.io",
	Version:  "v1",
	Resource: "customresourcedefinitions",
}
View Source
var CustomResourceDefinitionV1beta1GVR = &schema.GroupVersionResource{
	Group:    "apiextensions.k8s.io",
	Version:  "v1beta1",
	Resource: "customresourcedefinitions",
}
View Source
var DaemonSetGVR = &schema.GroupVersionResource{
	Group:    "apps",
	Version:  "v1",
	Resource: "daemonsets",
}
View Source
var DeploymentGVR = &schema.GroupVersionResource{
	Group:    "apps",
	Version:  "v1",
	Resource: "deployments",
}
View Source
var EndpointsGVR = &schema.GroupVersionResource{
	Group:    "",
	Version:  "v1",
	Resource: "endpoints",
}
View Source
var EventGVR = &schema.GroupVersionResource{
	Group:    "",
	Version:  "v1",
	Resource: "namespaces",
}
View Source
var HorizontalPodAutoscalerGVR = &schema.GroupVersionResource{
	Group:    "autoscaling",
	Version:  "v2beta1",
	Resource: "horizontalpodautoscalers",
}
View Source
var HorizontalPodAutoscalerV1GVR = &schema.GroupVersionResource{
	Group:    "autoscaling",
	Version:  "v1",
	Resource: "horizontalpodautoscalers",
}
View Source
var JobGVR = &schema.GroupVersionResource{
	Group:    "batch",
	Version:  "v1",
	Resource: "jobs",
}
View Source
var NamespaceGVR = &schema.GroupVersionResource{
	Group:    "",
	Version:  "v1",
	Resource: "namespaces",
}
View Source
var NetworkPolicyGVR = &schema.GroupVersionResource{
	Group:    "networking.k8s.io",
	Version:  "v1",
	Resource: "networkpolicies",
}
View Source
var NodeGVR = &schema.GroupVersionResource{
	Group:    "",
	Version:  "v1",
	Resource: "nodes",
}
View Source
var PersistentVolumeClaimGVR = &schema.GroupVersionResource{
	Group:    "",
	Version:  "v1",
	Resource: "persistentvolumeclaims",
}
View Source
var PersistentVolumeGVR = &schema.GroupVersionResource{
	Group:    "",
	Version:  "v1",
	Resource: "persistentvolumes",
}
View Source
var PodGVR = &schema.GroupVersionResource{
	Group:    "",
	Version:  "v1",
	Resource: "pods",
}
View Source
var SecretGVR = &schema.GroupVersionResource{
	Group:    "",
	Version:  "v1",
	Resource: "secrets",
}
View Source
var ServiceAccountGVR = &schema.GroupVersionResource{
	Group:    "",
	Version:  "v1",
	Resource: "serviceaccounts",
}
View Source
var ServiceGVR = &schema.GroupVersionResource{
	Group:    "",
	Version:  "v1",
	Resource: "services",
}
View Source
var StatefulSetGVR = &schema.GroupVersionResource{
	Group:    "apps",
	Version:  "v1",
	Resource: "statefulsets",
}
View Source
var StorageClassGVR = &schema.GroupVersionResource{
	Group:    "storage.k8s.io",
	Version:  "v1",
	Resource: "storageclasses",
}
View Source
var StorageClassV1Beta1GVR = &schema.GroupVersionResource{
	Group:    "storage.k8s.io",
	Version:  "v1beta1",
	Resource: "storageclasses",
}
View Source
var WorkloadGVRMap = map[string]*schema.GroupVersionResource{
	"Deployment":  DeploymentGVR,
	"StatefulSet": StatefulSetGVR,
	"DaemonSet":   DaemonSetGVR,
	"Job":         JobGVR,
	"CronJob":     CronJobGVR,
}

Functions

This section is empty.

Types

type ActionHandle

type ActionHandle func(params interface{}) *utils.Response

type ApplyParams

type ApplyParams struct {
	Create  bool   `json:"create"`
	YamlStr string `json:"yaml"`
}

type ApplyResource

type ApplyResource struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	Kind      string `json:"kind"`
}

type BuildCluster

type BuildCluster struct {
	ClusterVersion    string `json:"cluster_version"`
	ClusterCpu        string `json:"cluster_cpu"`
	ClusterMemory     string `json:"cluster_memory"`
	NodeNum           int    `json:"node_num"`
	NamespaceNum      int    `json:"namespace_num"`
	EventNum          int    `json:"event_num"`
	CrdNum            int    `json:"crd_num"`
	ServiceaccountNum int    `json:"serviceaccount_num"`
	PodNum            int    `json:"pod_num"`
	PodRunningNum     int    `json:"pod_running_num"`
	PodSucceededNum   int    `json:"pod_succeeded_num"`
	PodPendingNum     int    `json:"pod_pending_num"`
	PodFailedNum      int    `json:"pod_failed_num"`
	DeploymentNum     int    `json:"deployment_num"`
	StatefulSetNum    int    `json:"statefulset_num"`
	DaemonSetNum      int    `json:"daemonset_num"`
	JobNum            int    `json:"job_num"`
	CronjobNum        int    `json:"cronjob_num"`
	ServiceNum        int    `json:"service_num"`
	IngressNum        int    `json:"ingress_num"`
	StorageClassNum   int    `json:"storageclass_num"`
	PVNum             int    `json:"pv_num"`
	PVAvailableNum    int    `json:"pv_available_num"`
	PVReleasedNum     int    `json:"pv_released_num"`
	PVBoundNum        int    `json:"pv_bound_num"`
	PVFailedNum       int    `json:"pv_failed_num"`
	PVCNum            int    `json:"pvc_num"`
	ConfigMapNum      int    `json:"config_map_num"`
	SecretNum         int    `json:"secret_num"`
}

type BuildConfigMap

type BuildConfigMap struct {
	Name       string            `json:"name"`
	NameSpace  string            `json:"namespace"`
	Keys       []string          `json:"keys"`
	Labels     map[string]string `json:"labels"`
	CreateTime metav1.Time       `json:"create_time"`
	Data       map[string]string `json:"data"`
}

type BuildContainer

type BuildContainer struct {
	Name     string `json:"name"`
	Status   string `json:"status"`
	Restarts int32  `json:"restarts"`
	Ready    bool   `json:"ready"`
}

type BuildCronJob

type BuildCronJob struct {
	UID               string                   `json:"uid"`
	Name              string                   `json:"name"`
	Namespace         string                   `json:"namespace"`
	Active            []corev1.ObjectReference `json:"active"`
	LastScheduleTime  *metav1.Time             `json:"last_schedule_time"`
	Schedule          string                   `json:"schedule"`
	ConcurrencyPolicy string                   `json:"concurrency_policy"`
	ResourceVersion   string                   `json:"resource_version"`
	Suspend           string                   `json:"suspend"`
	Created           metav1.Time              `json:"created"`
}

type BuildDaemonSet

type BuildDaemonSet struct {
	UID                    string            `json:"uid"`
	Name                   string            `json:"name"`
	Namespace              string            `json:"namespace"`
	DesiredNumberScheduled int32             `json:"desired_number_scheduled"`
	NumberReady            int32             `json:"number_ready"`
	ResourceVersion        string            `json:"resource_version"`
	Strategy               string            `json:"strategy"`
	Conditions             []string          `json:"conditions"`
	NodeSelector           map[string]string `json:"node_selector"`
	Created                metav1.Time       `json:"created"`
}

type BuildDeployment

type BuildDeployment struct {
	UID                 string      `json:"uid"`
	Name                string      `json:"name"`
	Namespace           string      `json:"namespace"`
	Replicas            int32       `json:"replicas"`
	StatusReplicas      int32       `json:"status_replicas"`
	ReadyReplicas       int32       `json:"ready_replicas"`
	UpdatedReplicas     int32       `json:"updated_replicas"`
	UnavailableReplicas int32       `json:"unavailable_replicas"`
	AvailableReplicas   int32       `json:"available_replicas"`
	ResourceVersion     string      `json:"resource_version"`
	Strategy            string      `json:"strategy"`
	Conditions          []string    `json:"conditions"`
	Created             metav1.Time `json:"created"`
}

type BuildEndpoints

type BuildEndpoints struct {
	UID             string                  `json:"uid"`
	Name            string                  `json:"name"`
	Namespace       string                  `json:"namespace"`
	Subsets         []corev1.EndpointSubset `json:"subsets"`
	Created         metav1.Time             `json:"created"`
	ResourceVersion string                  `json:"resource_version"`
}

type BuildEvent

type BuildEvent struct {
	UID             string                  `json:"uid"`
	Namespace       string                  `json:"namespace"`
	Reason          string                  `json:"reason"`
	Message         string                  `json:"message"`
	Type            string                  `json:"type"`
	Object          *corev1.ObjectReference `json:"object"`
	Source          *corev1.EventSource     `json:"source"`
	EventTime       metav1.Time             `json:"event_time"`
	Count           int32                   `json:"count"`
	ResourceVersion string                  `json:"resource_version"`
}

type BuildHorizontalPodAutoscaler

type BuildHorizontalPodAutoscaler struct {
	Name      string `json:"name"`
	NameSpace string `json:"namespace"`
	MinPods   *int32 `json:"min_pods"`
	MaxPods   int32  `json:"max_pods"`
	Replicas  int32  `json:"replicas"`
	//Status        autoscalingv2beta1.HorizontalPodAutoscalerStatus `json:"status"`
	CreateTime    metav1.Time `json:"create_time"`
	TargetCpuPer  *int32      `json:"target_cpu_per"`
	CurrentCpuPer *int32      `json:"current_cpu_per"`
}

type BuildIngress

type BuildIngress struct {
	UID             string                      `json:"uid"`
	Name            string                      `json:"name"`
	Namespace       string                      `json:"namespace"`
	Backend         *extv1betav1.IngressBackend `json:"backend"`
	TLS             []extv1betav1.IngressTLS    `json:"tls"`
	Rules           []extv1betav1.IngressRule   `json:"rules"`
	Created         metav1.Time                 `json:"created"`
	ResourceVersion string                      `json:"resource_version"`
}

type BuildJob

type BuildJob struct {
	UID             string            `json:"uid"`
	Name            string            `json:"name"`
	Namespace       string            `json:"namespace"`
	Completions     *int32            `json:"completions"`
	Active          int32             `json:"active"`
	Succeeded       int32             `json:"succeeded"`
	Failed          int32             `json:"failed"`
	ResourceVersion string            `json:"resource_version"`
	Conditions      []string          `json:"conditions"`
	NodeSelector    map[string]string `json:"node_selector"`
	Created         metav1.Time       `json:"created"`
}

type BuildNamespace

type BuildNamespace struct {
	UID             string            `json:"uid"`
	Name            string            `json:"name"`
	Created         metav1.Time       `json:"created"`
	Status          string            `json:"status"`
	Labels          map[string]string `json:"labels"`
	ResourceVersion string            `json:"resource_version"`
}

type BuildNetworkPolicy

type BuildNetworkPolicy struct {
	UID             string                 `json:"uid"`
	Name            string                 `json:"name"`
	Namespace       string                 `json:"namespace"`
	PolicyTypes     []networkv1.PolicyType `json:"policy_types"`
	Created         metav1.Time            `json:"created"`
	ResourceVersion string                 `json:"resource_version"`
}

type BuildNewIngress

type BuildNewIngress struct {
	UID             string                       `json:"uid"`
	Name            string                       `json:"name"`
	Namespace       string                       `json:"namespace"`
	Backend         *networkingv1.IngressBackend `json:"backend"`
	TLS             []networkingv1.IngressTLS    `json:"tls"`
	Rules           []networkingv1.IngressRule   `json:"rules"`
	Created         metav1.Time                  `json:"created"`
	ResourceVersion string                       `json:"resource_version"`
}

type BuildNode

type BuildNode struct {
	UID              string            `json:"uid"`
	Name             string            `json:"name"`
	Taints           int               `json:"taints"`
	Roles            string            `json:"roles"`
	Version          string            `json:"version"`
	Age              string            `json:"age"`
	Status           string            `json:"status"`
	OS               string            `json:"os"`
	OSImage          string            `json:"os_image"`
	KernelVersion    string            `json:"kernel_version"`
	ContainerRuntime string            `json:"container_runtime"`
	Labels           map[string]string `json:"labels"`
	TotalCPU         string            `json:"total_cpu"`
	AllocatableCpu   string            `json:"allocatable_cpu"`
	TotalMem         string            `json:"total_mem"`
	AllocatableMem   string            `json:"allocatable_mem"`
	InternalIP       string            `json:"internal_ip"`
	Created          metav1.Time       `json:"created"`
}

type BuildPersistentVolume

type BuildPersistentVolume struct {
	UID            string                               `json:"uid"`
	Name           string                               `json:"name"`
	Status         string                               `json:"status"`
	Claim          string                               `json:"claim"`
	ClaimNamespace string                               `json:"claim_namespace"`
	StorageClass   string                               `json:"storage_class"`
	Capacity       string                               `json:"capacity"`
	AccessModes    []corev1.PersistentVolumeAccessMode  `json:"access_modes"`
	CreateTime     metav1.Time                          `json:"create_time"`
	ReclaimPolicy  corev1.PersistentVolumeReclaimPolicy `json:"reclaim_policy"`
}

type BuildPersistentVolumeClaim

type BuildPersistentVolumeClaim struct {
	UID           string                               `json:"uid"`
	Name          string                               `json:"name"`
	Namespace     string                               `json:"namespace"`
	Status        string                               `json:"status"`
	StorageClass  *string                              `json:"storage_class"`
	Capacity      string                               `json:"capacity"`
	AccessModes   []corev1.PersistentVolumeAccessMode  `json:"access_modes"`
	CreateTime    metav1.Time                          `json:"create_time"`
	ReclaimPolicy corev1.PersistentVolumeReclaimPolicy `json:"reclaim_policy"`
}

type BuildPod

type BuildPod struct {
	UID             string            `json:"uid"`
	Labels          map[string]string `json:"labels"`
	Name            string            `json:"name"`
	Namespace       string            `json:"namespace"`
	Containers      []*BuildContainer `json:"containers"`
	InitContainers  []*BuildContainer `json:"init_containers"`
	Controlled      string            `json:"controlled"`
	ControlledName  string            `json:"controlled_name"`
	Qos             string            `json:"qos"`
	Created         metav1.Time       `json:"created"`
	Status          string            `json:"status"`
	Ip              string            `json:"ip"`
	NodeName        string            `json:"node_name"`
	ResourceVersion string            `json:"resource_version"`
	ContainerNum    int               `json:"containerNum"`
	Restarts        int32             `json:"restarts"`
}

type BuildRole

type BuildRole struct {
	UID             string      `json:"uid"`
	Kind            string      `json:"kind"`
	Name            string      `json:"name"`
	Namespace       string      `json:"namespace"`
	ResourceVersion string      `json:"resource_version"`
	Created         metav1.Time `json:"created"`
}

type BuildRoleBinding

type BuildRoleBinding struct {
	UID             string           `json:"uid"`
	Kind            string           `json:"kind"`
	Name            string           `json:"name"`
	Namespace       string           `json:"namespace"`
	Subjects        []rbacv1.Subject `json:"subjects"`
	Role            rbacv1.RoleRef   `json:"role"`
	ResourceVersion string           `json:"resource_version"`
	Created         metav1.Time      `json:"created"`
}

type BuildSecret

type BuildSecret struct {
	Name       string            `json:"name"`
	NameSpace  string            `json:"namespace"`
	Keys       []string          `json:"keys"`
	Labels     map[string]string `json:"labels"`
	CreateTime metav1.Time       `json:"create_time"`
	Type       corev1.SecretType `json:"type"`
	Data       map[string][]byte `json:"data"`
}

type BuildService

type BuildService struct {
	UID             string               `json:"uid"`
	Name            string               `json:"name"`
	Namespace       string               `json:"namespace"`
	Type            string               `json:"type"`
	ClusterIP       string               `json:"cluster_ip"`
	Ports           []corev1.ServicePort `json:"ports"`
	ExternalIP      []string             `json:"external_ip"`
	Selector        map[string]string    `json:"selector"`
	ResourceVersion string               `json:"resource_version"`
	Created         metav1.Time          `json:"created"`
}

type BuildServiceAccount

type BuildServiceAccount struct {
	UID             string                   `json:"uid"`
	Name            string                   `json:"name"`
	Namespace       string                   `json:"namespace"`
	ResourceVersion string                   `json:"resource_version"`
	Secrets         []corev1.ObjectReference `json:"secrets"`
	Created         metav1.Time              `json:"created"`
}

type BuildStatefulSet

type BuildStatefulSet struct {
	UID             string      `json:"uid"`
	Name            string      `json:"name"`
	Namespace       string      `json:"namespace"`
	Replicas        int32       `json:"replicas"`
	StatusReplicas  int32       `json:"status_replicas"`
	ReadyReplicas   int32       `json:"ready_replicas"`
	UpdatedReplicas int32       `json:"updated_replicas"`
	ResourceVersion string      `json:"resource_version"`
	Strategy        string      `json:"strategy"`
	Conditions      []string    `json:"conditions"`
	Created         metav1.Time `json:"created"`
}

type BuildStorageClass

type BuildStorageClass struct {
	UID               string                                `json:"uid"`
	Name              string                                `json:"name"`
	CreateTime        metav1.Time                           `json:"create_time"`
	Provisioner       string                                `json:"provisioner"`
	ReclaimPolicy     *corev1.PersistentVolumeReclaimPolicy `json:"reclaim_policy"`
	VolumeBindingMode string                                `json:"binding_mode"`
	ResourceVersion   string                                `json:"resource_version"`
}

type Cluster

type Cluster struct {
	*Resource
}

func NewCluster

func NewCluster(config *config.KubeConfig) *Cluster

func (*Cluster) Get

func (c *Cluster) Get(params interface{}) *utils.Response

func (*Cluster) WorkspaceOverview

func (c *Cluster) WorkspaceOverview(queryParams *ClusterQueryParams) *utils.Response

type ClusterQueryParams

type ClusterQueryParams struct {
	Workspace   uint   `json:"workspace"`
	Namespace   string `json:"namespace"`
	OnlyVersion bool   `json:"only_version"`
}

type ClusterRole

type ClusterRole struct {
	*Resource
}

func NewClusterRole

func NewClusterRole(config *config.KubeConfig) *ClusterRole

func (*ClusterRole) ToBuildClusterRole

func (s *ClusterRole) ToBuildClusterRole(role *rbacv1.ClusterRole) *BuildRole

type ClusterRoleBinding

type ClusterRoleBinding struct {
	*Resource
}

func NewClusterRoleBinding

func NewClusterRoleBinding(config *config.KubeConfig) *ClusterRoleBinding

func (*ClusterRoleBinding) ToBuildClusterRoleBinding

func (s *ClusterRoleBinding) ToBuildClusterRoleBinding(roleBinding *rbacv1.ClusterRoleBinding) *BuildRoleBinding

type Configmap

type Configmap struct {
	*Resource
}

func NewConfigmap

func NewConfigmap(config *config.KubeConfig) *Configmap

func (*Configmap) ToBuildConfigMap

func (c *Configmap) ToBuildConfigMap(cm *corev1.ConfigMap) *BuildConfigMap

type CronJob

type CronJob struct {
	*Resource
}

func NewCronJob

func NewCronJob(config *config.KubeConfig) *CronJob

func (*CronJob) ToBuildCronJob

func (c *CronJob) ToBuildCronJob(cronjob *batchv1.CronJob) *BuildCronJob

type CustomResource

type CustomResource struct {
	*Resource
}

func NewCustomResource

func NewCustomResource(config *config.KubeConfig) *CustomResource

func (*CustomResource) Delete

func (c *CustomResource) Delete(params interface{}) *utils.Response

func (*CustomResource) Get

func (c *CustomResource) Get(params interface{}) *utils.Response

func (*CustomResource) List

func (c *CustomResource) List(params interface{}) *utils.Response

func (*CustomResource) Update

func (c *CustomResource) Update(params interface{}) *utils.Response

type CustomResourceDefinition

type CustomResourceDefinition struct {
	*Resource
}

func NewCustomResourceDefinition

func NewCustomResourceDefinition(config *config.KubeConfig) *CustomResourceDefinition

type CustomResourceDeleteParams

type CustomResourceDeleteParams struct {
	CustomResourceParam
	Resources []*DeleteCustomResource `json:"resources"`
}

type CustomResourceParam

type CustomResourceParam struct {
	Group    string `json:"group" form:"group"`
	Resource string `json:"resource" form:"resource"`
	Version  string `json:"version" form:"version"`
}

type CustomResourceQueryParams

type CustomResourceQueryParams struct {
	CustomResourceParam
	Namespace string `json:"namespace" form:"namespace"`
	Name      string `json:"name" form:"name"`
	Output    string `json:"output" form:"output"`
}

type DaemonSet

type DaemonSet struct {
	*Resource
}

func NewDaemonSet

func NewDaemonSet(config *config.KubeConfig) *DaemonSet

func (*DaemonSet) ToBuildDaemonSet

func (d *DaemonSet) ToBuildDaemonSet(ds *appsv1.DaemonSet) *BuildDaemonSet

type DeleteCustomResource

type DeleteCustomResource struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

type DeleteParamResource

type DeleteParamResource struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

type DeleteParams

type DeleteParams struct {
	Namespace     string                 `json:"namespace"`
	Resources     []*DeleteParamResource `json:"resources"`
	LabelSelector *metav1.LabelSelector  `json:"label_selector" form:"label_selector"`
}

type Deployment

type Deployment struct {
	*Resource
}

func NewDeployment

func NewDeployment(config *config.KubeConfig) *Deployment

func (*Deployment) ToBuildDeployment

func (d *Deployment) ToBuildDeployment(dp *appsv1.Deployment) *BuildDeployment

type Endpoints

type Endpoints struct {
	*Resource
}

func NewEndpoints

func NewEndpoints(config *config.KubeConfig) *Endpoints

func (*Endpoints) ToBuildEndpoints

func (e *Endpoints) ToBuildEndpoints(endpoints *corev1.Endpoints) *BuildEndpoints

type Event

type Event struct {
	*Resource
}

func NewEvent

func NewEvent(config *config.KubeConfig) *Event

func (*Event) List

func (e *Event) List(params interface{}) *utils.Response

func (*Event) ToBuildEvent

func (e *Event) ToBuildEvent(event *corev1.Event) *BuildEvent

type Helm

type Helm struct {
	*Resource
}

func NewHelm

func NewHelm(conf *config.KubeConfig) *Helm

func (*Helm) Create

func (h *Helm) Create(requestParams interface{}) *utils.Response

func (*Helm) Delete

func (h *Helm) Delete(requestParams interface{}) *utils.Response

func (*Helm) Get

func (h *Helm) Get(params interface{}) *utils.Response

func (*Helm) GetReleaseObjects

func (h *Helm) GetReleaseObjects(release *release.Release) []*unstructured.Unstructured

func (*Helm) GetReleaseRuntimeState

func (h *Helm) GetReleaseRuntimeState(rel *release.Release, withResource bool) (*ReleaseRuntimeState, error)

func (*Helm) List

func (h *Helm) List(params interface{}) *utils.Response

func (*Helm) Update

func (h *Helm) Update(requestParams interface{}) *utils.Response

type HelmGetParams

type HelmGetParams struct {
	Name         string `json:"name"`
	Namespace    string `json:"namespace"`
	WithResource bool   `json:"with_resource"`
}

type HelmListParams

type HelmListParams struct {
	Name       string   `json:"name"`
	Names      []string `json:"names"`
	Namespace  string   `json:"namespace"`
	WithStatus bool     `json:"with_status"`
}

type HelmObjectParams

type HelmObjectParams struct {
	Name       string `json:"name"`
	Namespace  string `json:"namespace"`
	Values     string `json:"values"`
	ChartBytes []byte `json:"chart_bytes"`
}

type HorizontalPodAutoscaler

type HorizontalPodAutoscaler struct {
	*Resource
}

func NewHorizontalPodAutoscaler

func NewHorizontalPodAutoscaler(config *config.KubeConfig) *HorizontalPodAutoscaler

func (*HorizontalPodAutoscaler) ToBuildHorizontalPodAutoscaler

func (*HorizontalPodAutoscaler) ToBuildV1HorizontalPodAutoscaler

type Ingress

type Ingress struct {
	*Resource
}

func NewIngress

func NewIngress(config *config.KubeConfig) *Ingress

func (*Ingress) List

func (i *Ingress) List(params interface{}) *utils.Response

func (*Ingress) ToBuildIngress

func (i *Ingress) ToBuildIngress(ingress *extv1betav1.Ingress) *BuildIngress

func (*Ingress) ToBuildNewIngress

func (i *Ingress) ToBuildNewIngress(ingress *networkingv1.Ingress) *BuildNewIngress

type Job

type Job struct {
	*Resource
}

func NewJob

func NewJob(config *config.KubeConfig) *Job

func (*Job) ToBuildJob

func (j *Job) ToBuildJob(job *batchv1.Job) *BuildJob

type Namespace

type Namespace struct {
	*Resource
}

func NewNamespace

func NewNamespace(config *config.KubeConfig) *Namespace

func (*Namespace) ToBuildNamespace

func (n *Namespace) ToBuildNamespace(ns *corev1.Namespace) *BuildNamespace

type NetworkPolicy

type NetworkPolicy struct {
	*Resource
}

func NewNetworkPolicy

func NewNetworkPolicy(config *config.KubeConfig) *NetworkPolicy

func (*NetworkPolicy) ToBuildNetworkPolicy

func (n *NetworkPolicy) ToBuildNetworkPolicy(networkpolicy *networkv1.NetworkPolicy) *BuildNetworkPolicy

type Node

type Node struct {
	*Resource
}

func NewNode

func NewNode(config *config.KubeConfig) *Node

func (*Node) ToBuildNode

func (n *Node) ToBuildNode(node *corev1.Node) *BuildNode

type OutWriter

type OutWriter interface {
	Write(interface{}) error
	StopCh() <-chan struct{}
	Close()
}

type PatchParams

type PatchParams struct {
	Name      string      `json:"name"`
	Namespace string      `json:"namespace"`
	Data      interface{} `json:"data"`
}

type PersistentVolume

type PersistentVolume struct {
	*Resource
}

func NewPersistentVolume

func NewPersistentVolume(config *config.KubeConfig) *PersistentVolume

func (*PersistentVolume) ToBuildPersistentVolume

func (p *PersistentVolume) ToBuildPersistentVolume(pv *corev1.PersistentVolume) *BuildPersistentVolume

type PersistentVolumeClaim

type PersistentVolumeClaim struct {
	*Resource
}

func NewPersistentVolumeClaim

func NewPersistentVolumeClaim(config *config.KubeConfig) *PersistentVolumeClaim

func (*PersistentVolumeClaim) ToBuildPersistentVolumeClaim

func (p *PersistentVolumeClaim) ToBuildPersistentVolumeClaim(pvc *corev1.PersistentVolumeClaim) *BuildPersistentVolumeClaim

type Pod

type Pod struct {
	*Resource
	// contains filtered or unexported fields
}

func NewPod

func NewPod(config *config.KubeConfig) *Pod

func (*Pod) Exec

func (p *Pod) Exec(params interface{}, writer OutWriter) *utils.Response

Exec Todo 添加注释

func (*Pod) ExecStdIn

func (p *Pod) ExecStdIn(params interface{}) *utils.Response

ExecStdIn todo 添加注释

func (*Pod) Log

func (p *Pod) Log(params interface{}, writer OutWriter) *utils.Response

func (*Pod) ToBuildContainer

func (p *Pod) ToBuildContainer(statuses []corev1.ContainerStatus, container *corev1.Container) *BuildContainer

func (*Pod) ToBuildPod

func (p *Pod) ToBuildPod(pod *corev1.Pod) *BuildPod

type PodExecParams

type PodExecParams struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	Container string `json:"container"`
	SessionId string `json:"session_id"`
	Rows      string `json:"rows"`
	Cols      string `json:"cols"`
}

type PodLogParams

type PodLogParams struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	Container string `json:"container"`
}

type QueryParams

type QueryParams struct {
	Kind               string                `json:"kind" form:"kind"`
	Name               string                `json:"name" form:"name"`
	Namespace          string                `json:"namespace" form:"namespace"`
	Output             string                `json:"output" form:"output"`
	LabelSelector      *metav1.LabelSelector `json:"label_selector" form:"label_selector"`
	Names              []string              `json:"names" form:"names"`
	ResourceVersion    string                `json:"resourceVersion" form:"resource_version"`
	OwnerReferenceKind string                `json:"owner_reference_kind" form:"owner_reference_kind"`
	OwnerReferenceName string                `json:"owner_reference_name" form:"owner_reference_name"`
	Process            *bool                 `json:"process" form:"process"` // 是否对查询结果进行处理
}

type ReleaseRuntimeState

type ReleaseRuntimeState struct {
	Name         string                       `json:"name"`
	Namespace    string                       `json:"namespace"`
	Status       string                       `json:"status"`
	Resources    []*unstructured.Unstructured `json:"resources"`
	PodsNum      int                          `json:"pods_num"`
	ReadyPodsNum int                          `json:"ready_pods_num"`
}

type Resource

type Resource struct {
	// contains filtered or unexported fields
}

func NewResource

func NewResource(
	config *config.KubeConfig,
	resType string,
	gvr *schema.GroupVersionResource,
	listObjectProcess listObjectProcess) *Resource

func (*Resource) Apply

func (r *Resource) Apply(params interface{}) *utils.Response

func (*Resource) Delete

func (r *Resource) Delete(params interface{}) *utils.Response

func (*Resource) Get

func (r *Resource) Get(params interface{}) *utils.Response

func (*Resource) Handle

func (r *Resource) Handle(action string, params interface{}) *utils.Response

func (*Resource) List

func (r *Resource) List(params interface{}) *utils.Response

func (*Resource) Patch

func (r *Resource) Patch(params interface{}) *utils.Response

func (*Resource) Update

func (r *Resource) Update(params interface{}) *utils.Response

func (*Resource) Watch

func (r *Resource) Watch(params interface{}, writer OutWriter) *utils.Response

type Role

type Role struct {
	*Resource
}

func NewRole

func NewRole(config *config.KubeConfig) *Role

func (*Role) ToBuildRole

func (s *Role) ToBuildRole(role *rbacv1.Role) *BuildRole

type RoleBinding

type RoleBinding struct {
	*Resource
}

func NewRoleBinding

func NewRoleBinding(config *config.KubeConfig) *RoleBinding

func (*RoleBinding) ToBuildRoleBinding

func (s *RoleBinding) ToBuildRoleBinding(roleBinding *rbacv1.RoleBinding) *BuildRoleBinding

type Secret

type Secret struct {
	*Resource
}

func NewSecret

func NewSecret(config *config.KubeConfig) *Secret

func (*Secret) ToBuildSecret

func (s *Secret) ToBuildSecret(se *corev1.Secret) *BuildSecret

type Service

type Service struct {
	*Resource
}

func NewService

func NewService(config *config.KubeConfig) *Service

func (*Service) ToBuildService

func (s *Service) ToBuildService(service *corev1.Service) *BuildService

type ServiceAccount

type ServiceAccount struct {
	*Resource
}

func NewServiceAccount

func NewServiceAccount(config *config.KubeConfig) *ServiceAccount

func (*ServiceAccount) ToBuildServiceAccount

func (s *ServiceAccount) ToBuildServiceAccount(serviceAccount *corev1.ServiceAccount) *BuildServiceAccount

type StatefulSet

type StatefulSet struct {
	*Resource
}

func NewStatefulSet

func NewStatefulSet(config *config.KubeConfig) *StatefulSet

func (*StatefulSet) ToBuildStatefulSet

func (s *StatefulSet) ToBuildStatefulSet(ss *appsv1.StatefulSet) *BuildStatefulSet

type StdInParams

type StdInParams struct {
	SessionId string `json:"session_id"`
	Input     string `json:"input"`
	Width     uint16 `json:"width"`
	Height    uint16 `json:"height"`
}

type StorageClass

type StorageClass struct {
	*Resource
}

func NewStorageClass

func NewStorageClass(config *config.KubeConfig) *StorageClass

func (*StorageClass) ToBuildStorageClass

func (s *StorageClass) ToBuildStorageClass(sc *storagev1.StorageClass) *BuildStorageClass

type UpdateCustomResourceParams

type UpdateCustomResourceParams struct {
	CustomResourceParam
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	YamlStr   string `json:"yaml"`
}

type UpdateParams

type UpdateParams struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	YamlStr   string `json:"yaml"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL