Documentation
¶
Index ¶
- Constants
- func CreatePciVendorSelector(vendorID, deviceID string) string
- type CustomCert
- type DeploymentPublic
- type DeploymentStatus
- type EgressRule
- type EnvVar
- type Event
- type HpaPublic
- type IngressPublic
- type IngressRule
- type InitContainer
- type IpBlock
- type JobPublic
- type K8sResource
- type Limits
- type LogLine
- type NamespacePublic
- type NetworkPolicyPublic
- type NodePublic
- type PciHostDevice
- type PermittedHostDevices
- type PodDeleted
- type PodPublic
- type Port
- type PvPublic
- type PvcPublic
- type Requests
- type Resources
- type SecretPublic
- type ServicePublic
- type Target
- type VmPublic
- type VmSnapshotPublic
- type VmStatus
- type VmiStatus
- type Volume
Constants ¶
const ( EventTypeWarning = "warning" EventTypeNormal = "normal" EventReasonMountFailed = "mountFailed" EventReasonCrashLoop = "crashLoop" EventReasonImagePullFailed = "imagePullFailed" EventObjectKindDeployment = "deployment" )
Variables ¶
This section is empty.
Functions ¶
func CreatePciVendorSelector ¶
Types ¶
type CustomCert ¶
type DeploymentPublic ¶
type DeploymentPublic struct { Name string `bson:"name"` Namespace string `bson:"namespace"` Labels map[string]string `bson:"labels"` Image string `bson:"image"` ImagePullSecrets []string `bson:"imagePullSecrets"` EnvVars []EnvVar `bson:"envVars"` Resources Resources `bson:"resources"` Command []string `bson:"command"` Args []string `bson:"args"` InitCommands []string `bson:"initCommands"` InitContainers []InitContainer `bson:"initContainers"` Volumes []Volume `bson:"volumes"` CreatedAt time.Time `bson:"createdAt"` // Disabled is a flag that can be set to true to disable the deployment. // This is useful for deployments that should not be running, but should still exist. // A disabled deployment has replicas set to 0. Disabled bool `bson:"disabled"` }
func CreateDeploymentPublicFromRead ¶
func CreateDeploymentPublicFromRead(deployment *appsv1.Deployment) *DeploymentPublic
CreateDeploymentPublicFromRead creates a DeploymentPublic from a appsv1.Deployment.
func (*DeploymentPublic) Created ¶
func (d *DeploymentPublic) Created() bool
func (*DeploymentPublic) IsPlaceholder ¶
func (d *DeploymentPublic) IsPlaceholder() bool
type DeploymentStatus ¶
type DeploymentStatus struct { Name string Generation int DesiredReplicas int ReadyReplicas int AvailableReplicas int }
func CreateDeploymentStatusFromRead ¶
func CreateDeploymentStatusFromRead(read *appsv1.Deployment) *DeploymentStatus
type EgressRule ¶
type EgressRule struct { // IpBlock defines what is allowed by the network policy IpBlock *IpBlock `bson:"ipBlock,omitempty"` // PodSelector defines what is allowed by the network policy PodSelector map[string]string `bson:"podSelector,omitempty"` // NamespaceSelector defines what is allowed by the network policy NamespaceSelector map[string]string `bson:"namespaceSelector,omitempty"` }
type EnvVar ¶
func EnvVarFromK8s ¶
EnvVarFromK8s converts a v1.EnvVar to an EnvVar.
func (*EnvVar) ToK8sEnvVar ¶
ToK8sEnvVar converts an EnvVar to a v1.EnvVar.
type HpaPublic ¶
type HpaPublic struct { Name string `bson:"name"` Namespace string `bson:"namespace"` MinReplicas int `bson:"minReplicas"` MaxReplicas int `bson:"maxReplicas"` Target Target `bson:"target"` CpuAverageUtilization int `bson:"cpuAverageUtilization"` MemoryAverageUtilization int `bson:"memoryAverageUtilization"` CreatedAt time.Time `bson:"createdAt"` }
func CreateHpaPublicFromRead ¶
func CreateHpaPublicFromRead(hpa *v2.HorizontalPodAutoscaler) *HpaPublic
CreateHpaPublicFromRead creates a HpaPublic from a v2.HorizontalPodAutoscaler.
func (*HpaPublic) IsPlaceholder ¶
type IngressPublic ¶
type IngressPublic struct { Name string `bson:"name"` Namespace string `bson:"namespace"` ServiceName string `bson:"serviceName"` ServicePort int `bson:"servicePort"` IngressClass string `bson:"ingressClassName"` Hosts []string `bson:"host"` Placeholder bool `bson:"placeholder"` CreatedAt time.Time `bson:"createdAt"` CustomCert *CustomCert `bson:"customCert,omitempty"` TlsSecret *string `bson:"tlsSecret,omitempty"` }
func CreateIngressPublicFromRead ¶
func CreateIngressPublicFromRead(ingress *v1.Ingress) *IngressPublic
CreateIngressPublicFromRead creates a IngressPublic from a v1.Ingress.
func (*IngressPublic) Created ¶
func (i *IngressPublic) Created() bool
func (*IngressPublic) IsPlaceholder ¶
func (i *IngressPublic) IsPlaceholder() bool
type IngressRule ¶
type IngressRule struct { // IpBlock defines what is allowed by the network policy IpBlock *IpBlock `bson:"ipBlock,omitempty"` // PodSelector defines what is allowed by the network policy PodSelector map[string]string `bson:"podSelector,omitempty"` // NamespaceSelector defines what is allowed by the network policy NamespaceSelector map[string]string `bson:"namespaceSelector,omitempty"` }
type InitContainer ¶
type JobPublic ¶
type JobPublic struct { Name string `bson:"name"` Namespace string `bson:"namespace"` Image string `bson:"image"` Command []string `bson:"command"` Args []string `bson:"args"` Volumes []Volume `bson:"volumes"` MaxTries *int `bson:"maxTries,omitempty"` CreatedAt time.Time `bson:"createdAt"` }
func CreateJobPublicFromRead ¶
CreateJobPublicFromRead creates a JobPublic from a v1.Job.
func (*JobPublic) IsPlaceholder ¶
type K8sResource ¶
type K8sResource interface {
Created() bool
}
type NamespacePublic ¶
func CreateNamespacePublicFromRead ¶
func CreateNamespacePublicFromRead(namespace *v1.Namespace) *NamespacePublic
CreateNamespacePublicFromRead creates a NamespacePublic from a v1.Namespace.
func (*NamespacePublic) Created ¶
func (n *NamespacePublic) Created() bool
func (*NamespacePublic) IsPlaceholder ¶
func (n *NamespacePublic) IsPlaceholder() bool
type NetworkPolicyPublic ¶
type NetworkPolicyPublic struct { Name string `bson:"name"` Namespace string `bson:"namespace"` EgressRules []EgressRule `bson:"egress,omitempty"` IngressRules []IngressRule `bson:"ingress,omitempty"` Selector map[string]string `bson:"selector,omitempty"` CreatedAt time.Time `bson:"createdAt"` }
func CreateNetworkPolicyPublicFromRead ¶
func CreateNetworkPolicyPublicFromRead(policy *v1.NetworkPolicy) *NetworkPolicyPublic
func (*NetworkPolicyPublic) Created ¶
func (npo *NetworkPolicyPublic) Created() bool
func (*NetworkPolicyPublic) IsPlaceholder ¶
func (npo *NetworkPolicyPublic) IsPlaceholder() bool
type NodePublic ¶
type NodePublic struct { Name string `json:"name"` CPU struct { Total int `json:"total"` } `json:"cpu"` RAM struct { Total int `json:"total"` } `json:"ram"` Schedulable bool `json:"schedulable"` }
func CreateNodePublicFromGet ¶
func CreateNodePublicFromGet(node *corev1.Node) *NodePublic
type PciHostDevice ¶
type PermittedHostDevices ¶
type PermittedHostDevices struct {
PciHostDevices []PciHostDevice
}
type PodDeleted ¶
type PodPublic ¶
func CreatePodPublicFromRead ¶
type PvPublic ¶
type PvPublic struct { Name string `bson:"name"` Capacity string `bson:"capacity"` NfsServer string `bson:"nfsServer"` NfsPath string `bson:"nfsPath"` // Released is true if the volume is released. // This is mainly used to be able to repair the volume. // If it is released, then recreate the volume. Released bool `bson:"released"` CreatedAt time.Time `bson:"createdAt"` }
func CreatePvPublicFromRead ¶
func CreatePvPublicFromRead(pv *v1.PersistentVolume) *PvPublic
CreatePvPublicFromRead creates a PvPublic from a v1.PersistentVolume.
func (*PvPublic) IsPlaceholder ¶
type PvcPublic ¶
type PvcPublic struct { Name string `bson:"name"` Namespace string `bson:"namespace"` Capacity string `bson:"capacity"` PvName string `bson:"pvName"` CreatedAt time.Time `bson:"createdAt"` }
func CreatePvcPublicFromRead ¶
func CreatePvcPublicFromRead(pvc *v1.PersistentVolumeClaim) *PvcPublic
CreatePvcPublicFromRead creates a PvcPublic from a v1.PersistentVolumeClaim.
func (*PvcPublic) IsPlaceholder ¶
type SecretPublic ¶
type SecretPublic struct { Name string `json:"name"` Namespace string `json:"namespace"` Data map[string][]byte `json:"data"` Type string `json:"type"` CreatedAt time.Time `json:"createdAt"` Placeholder bool `json:"placeholder"` }
func CreateSecretPublicFromRead ¶
func CreateSecretPublicFromRead(secret *v1.Secret) *SecretPublic
CreateSecretPublicFromRead creates a SecretPublic from a v1.Secret.
func (*SecretPublic) Created ¶
func (secret *SecretPublic) Created() bool
func (*SecretPublic) IsPlaceholder ¶
func (secret *SecretPublic) IsPlaceholder() bool
type ServicePublic ¶
type ServicePublic struct { Name string `bson:"name"` Namespace string `bson:"namespace"` Ports []Port `bson:"ports"` LoadBalancerIP *string `bson:"loadBalancerIp"` Selector map[string]string `bson:"selector"` CreatedAt time.Time `bson:"createdAt"` }
func CreateServicePublicFromRead ¶
func CreateServicePublicFromRead(service *v1.Service) *ServicePublic
CreateServicePublicFromRead creates a ServicePublic from a v1.Service.
func (*ServicePublic) Created ¶
func (s *ServicePublic) Created() bool
func (*ServicePublic) GetFQDN ¶
func (s *ServicePublic) GetFQDN() string
func (*ServicePublic) IsNodePort ¶
func (s *ServicePublic) IsNodePort() bool
func (*ServicePublic) IsPlaceholder ¶
func (s *ServicePublic) IsPlaceholder() bool
type VmPublic ¶
type VmPublic struct { ID string `bson:"id"` Name string `bson:"name"` Namespace string `bson:"namespace"` Labels map[string]string `bson:"labels"` CpuCores int `bson:"cpuCores"` RAM int `bson:"memory"` DiskSize int `bson:"diskSize"` GPUs []string `bson:"gpus"` CloudInit string `bson:"cloudInit"` // Image is the URL of the image to use for the VM // It may either be an HTTP URL or a Docker image. // // If it is an HTTP URL, it must be in the format: http(s)://<url> // If it is a Docker image, it must be in the format: docker://<image> Image string `bson:"image"` Running bool `bson:"running"` CreatedAt time.Time `bson:"createdAt"` }
func CreateVmPublicFromRead ¶
func CreateVmPublicFromRead(vm *kubevirtv1.VirtualMachine) *VmPublic
func (*VmPublic) IsPlaceholder ¶
type VmSnapshotPublic ¶
type VmSnapshotPublic struct { ID string `json:"id"` Name string `json:"name"` Namespace string `json:"namespace"` VmID string `json:"vmId"` Status string `json:"status"` CreatedAt time.Time `json:"createdAt"` }
func CreateVmSnapshotPublicFromRead ¶
func CreateVmSnapshotPublicFromRead(vmSnapshot *v1alpha1.VirtualMachineSnapshot) *VmSnapshotPublic
func (*VmSnapshotPublic) Created ¶
func (s *VmSnapshotPublic) Created() bool
func (*VmSnapshotPublic) IsPlaceholder ¶
func (s *VmSnapshotPublic) IsPlaceholder() bool
type VmStatus ¶
func CreateVmStatusFromRead ¶
func CreateVmStatusFromRead(vm *kubevirtv1.VirtualMachine) *VmStatus
type VmiStatus ¶
func CreateVmiStatusFromRead ¶
func CreateVmiStatusFromRead(vmi *kubevirtv1.VirtualMachineInstance) *VmiStatus
Source Files
¶
- common.go
- deployment_log.go
- deployment_public.go
- deployment_status.go
- event.go
- hpa_public.go
- ingress_public.go
- job_public.go
- kubevirt.go
- namespace_public.go
- network_policy_public.go
- node_public.go
- pod_public.go
- pv_public.go
- pvc_public.go
- secret_public.go
- service_public.go
- vm.go
- vm_snapshot.go
- vm_status.go