k8s

package
v0.0.0-...-413f389 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterInfo

type ClusterInfo struct {
	Version string `json:"version"`
}

ClusterInfo represents basic information about the Kubernetes cluster

type DaemonSetModel

type DaemonSetModel struct {
	Name      string                 `json:"name"`
	Namespace string                 `json:"namespace"`
	Labels    map[string]string      `json:"labels"`
	Selector  *metav1.LabelSelector  `json:"selector"`
	Template  corev1.PodTemplateSpec `json:"template"`
}

DaemonSetModel 是 DaemonSet 资源的模型

type Deployment

type Deployment struct {
	// Name is the name of the Deployment
	Name string `json:"name"`
	// Namespace is the namespace of the Deployment
	Namespace string `json:"namespace"`
	// Replicas is the number of desired replicas for the Deployment
	Replicas int32 `json:"replicas"`
	// DeploymentSpec contains the specification of the desired behavior of the Deployment
	DeploymentSpec v1.DeploymentSpec `json:"deploymentSpec"`
	// DeploymentStatus contains the most recently observed status of the Deployment
	DeploymentStatus v1.DeploymentStatus `json:"deploymentStatus"`
}

Deployment represents a Kubernetes Deployment

type Ingress

type Ingress struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              IngressSpec `json:"spec,omitempty"`
}

Ingress defines the Ingress API object

type IngressSpec

type IngressSpec struct {
	Name      string                   `json:"name"`
	Namespace string                   `json:"namespace"`
	Spec      networkingv1.IngressSpec `json:"spec"`
}

IngressSpec defines the desired state of Ingress

type Namespace

type Namespace struct {
	Name   string            `json:"name"`
	Labels map[string]string `json:"labels"`
	Status v1.NamespacePhase `json:"status"`
}

Namespace represents the Kubernetes Namespace model

func ToNamespaceModel

func ToNamespaceModel(ns *v1.Namespace) *Namespace

ToNamespaceModel converts a Kubernetes Namespace to our Namespace model

type NodeInfo

type NodeInfo struct {
	Name        string            `json:"name"`
	Labels      map[string]string `json:"labels"`
	Annotations map[string]string `json:"annotations"`
	CreatedAt   metav1.Time       `json:"createdAt"`
}

NodeInfo represents basic information about a Kubernetes node

type NodeModel

type NodeModel struct {
	Name             string            `json:"name"`
	Version          string            `json:"version"`
	OS               string            `json:"os"`
	Arch             string            `json:"arch"`
	KernelVersion    string            `json:"kernelVersion"`
	ContainerRuntime string            `json:"containerRuntime"`
	CreationTime     string            `json:"creationTime"`
	Labels           map[string]string `json:"labels"`
	Annotations      map[string]string `json:"annotations"`
	Status           string            `json:"status"`
	CPUUsage         string            `json:"cpuUsage"`
	MemoryUsage      string            `json:"memoryUsage"`
	PodCount         int               `json:"podCount"`
	IPAddresses      []string          `json:"ipAddresses"`
}

NodeModel represents a Kubernetes node with additional details

func NewNodeModel

func NewNodeModel(node *v1.Node) *NodeModel

NewNodeModel creates a new NodeModel from a Kubernetes Node

type PersistentVolume

type PersistentVolume struct {
	v1.PersistentVolume `json:",inline"`
}

type PersistentVolumeClaim

type PersistentVolumeClaim struct {
	v1.PersistentVolumeClaim `json:",inline"`
}

type Pod

type Pod struct {
	Name         string            `json:"name"`
	Namespace    string            `json:"namespace"`
	Labels       map[string]string `json:"labels"`
	Annotations  map[string]string `json:"annotations"`
	Status       corev1.PodStatus  `json:"status"`
	CreationTime metav1.Time       `json:"creationTime"`
}

type ServiceModel

type ServiceModel struct {
	Name      string            `json:"name"`
	Namespace string            `json:"namespace"`
	Labels    map[string]string `json:"labels"`
	Type      v1.ServiceType    `json:"type"`
	Ports     []v1.ServicePort  `json:"ports"`
}

ServiceModel 用于表示 Kubernetes Service 的模型

type StatefulSetModel

type StatefulSetModel struct {
	Name      string                   `json:"name"`
	Namespace string                   `json:"namespace"`
	Labels    map[string]string        `json:"labels,omitempty"`
	Spec      appsv1.StatefulSetSpec   `json:"spec"`
	Status    appsv1.StatefulSetStatus `json:"status,omitempty"`
}

func NewStatefulSetModel

func NewStatefulSetModel(statefulSet *appsv1.StatefulSet) *StatefulSetModel

type StorageClass

type StorageClass struct {
	storagev1.StorageClass `json:",inline"`
}

Jump to

Keyboard shortcuts

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