k8s

package
v0.8.12 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProvider

func NewProvider(db *database.Database, log *zap.Logger) (provider.Interface, error)

Types

type Config

type Config struct {
	KubeConfig string `mapstructure:"domain"`
	Resources  []struct {
		Name  string
		Other map[string]interface{} `mapstructure:",remain"`
	}
}

type Pod

type Pod struct {
	ID          uint   `gorm:"primarykey"`
	ClusterName string `neo:"unique"`
	Name        string `neo:"unique"`
	Namespace   string `neo:"unique"`

	SpecVolumes                       []*PodVolume             `gorm:"constraint:OnDelete:CASCADE;"`
	SpecContainers                    []*PodContainer          `gorm:"constraint:OnDelete:CASCADE;"`
	SpecEphemeralContainers           []*PodEphemeralContainer `gorm:"constraint:OnDelete:CASCADE;"`
	SpecRestartPolicy                 string
	SpecTerminationGracePeriodSeconds *int64
	SpecActiveDeadlineSeconds         *int64
	SpecDNSPolicy                     string
	SpecServiceAccountName            string
	SpecAutomountServiceAccountToken  *bool
	SpecNodeName                      string
	SpecHostNetwork                   bool
	SpecHostPID                       bool
	SpecHostIPC                       bool
	SpecShareProcessNamespace         *bool

	SpecSecurityContextSELinuxOptionsUser  string
	SpecSecurityContextSELinuxOptionsRole  string
	SpecSecurityContextSELinuxOptionsType  string
	SpecSecurityContextSELinuxOptionsLevel string

	SpecSecurityContextWindowsOptionsGMSACredentialSpecName *string
	SpecSecurityContextWindowsOptionsGMSACredentialSpec     *string
	SpecSecurityContextWindowsOptionsRunAsUserName          *string
	SpecSecurityContextRunAsUser                            *int64
	SpecSecurityContextRunAsGroup                           *int64
	SpecSecurityContextRunAsNonRoot                         *bool
	SpecSecurityContextFSGroup                              *int64
	SpecSecurityContextSysctls                              []*PodSysctl `gorm:"constraint:OnDelete:CASCADE;"`
	SpecSecurityContextFSGroupChangePolicy                  *v1.PodFSGroupChangePolicy

	SpecSecurityContextSeccompProfileType             string
	SpecSecurityContextSeccompProfileLocalhostProfile *string
	SpecHostname                                      string
	SpecSubdomain                                     string

	SpecSchedulerName     string
	SpecTolerations       []*PodToleration `gorm:"constraint:OnDelete:CASCADE;"`
	SpecHostAliases       []*PodHostAlias  `gorm:"constraint:OnDelete:CASCADE;"`
	SpecPriorityClassName string
	SpecPriority          *int32

	SpecDNSConfigNameservers []*PodDNSConfigNameservers `gorm:"constraint:OnDelete:CASCADE;"`
	SpecDNSConfigSearches    []*PodDNSConfigSearches    `gorm:"constraint:OnDelete:CASCADE;"`
	SpecDNSConfigOptions     []*PodDNSConfigOption      `gorm:"constraint:OnDelete:CASCADE;"`
	SpecReadinessGates       []*PodReadinessGate        `gorm:"constraint:OnDelete:CASCADE;"`
	SpecRuntimeClassName     *string
	SpecEnableServiceLinks   *bool
	SpecPreemptionPolicy     *v1.PreemptionPolicy
	SpecSetHostnameAsFQDN    *bool

	StatusPhase             string
	StatusConditions        []*PodCondition `gorm:"constraint:OnDelete:CASCADE;"`
	StatusMessage           string
	StatusReason            string
	StatusNominatedNodeName string
	StatusHostIP            string
	StatusPodIP             string
	StatusPodIPs            []*PodIP `gorm:"constraint:OnDelete:CASCADE;"`

	StatusContainerStatuses []*PodContainerStatus `gorm:"constraint:OnDelete:CASCADE;"`
	StatusQOSClass          string
}

func (Pod) TableName

func (Pod) TableName() string

type PodAffinityTermNamespaces

type PodAffinityTermNamespaces struct {
	ID                uint   `gorm:"primarykey"`
	PodAffinityTermID uint   `neo:"ignore"`
	ClusterName       string `gorm:"-"`
	Value             string
}

func (PodAffinityTermNamespaces) TableName added in v0.7.0

func (PodAffinityTermNamespaces) TableName() string

type PodCapabilitiesAdd

type PodCapabilitiesAdd struct {
	ID             uint   `gorm:"primarykey"`
	PodContainerID uint   `neo:"ignore"`
	ClusterName    string `gorm:"-"`
	Value          string
}

func (PodCapabilitiesAdd) TableName

func (PodCapabilitiesAdd) TableName() string

type PodCapabilitiesDrop

type PodCapabilitiesDrop struct {
	ID             uint   `gorm:"primarykey"`
	PodContainerID uint   `neo:"ignore"`
	ClusterName    string `gorm:"-"`
	Value          string
}

func (PodCapabilitiesDrop) TableName

func (PodCapabilitiesDrop) TableName() string

type PodCondition

type PodCondition struct {
	ID          uint   `gorm:"primarykey"`
	PodID       uint   `neo:"ignore"`
	ClusterName string `gorm:"-"`
	Type        string
	Status      string

	Reason  string
	Message string
}

func (PodCondition) TableName

func (PodCondition) TableName() string

type PodConfig

type PodConfig struct {
	Filter string
}

type PodContainer

type PodContainer struct {
	ID          uint   `gorm:"primarykey"`
	PodID       uint   `neo:"ignore"`
	ClusterName string `gorm:"-"`
	Name        string
	Image       string
	Command     []*PodContainerCommand `gorm:"constraint:OnDelete:CASCADE;"`
	Args        []*PodContainerArgs    `gorm:"constraint:OnDelete:CASCADE;"`
	WorkingDir  string
	Ports       []*PodContainerPort `gorm:"constraint:OnDelete:CASCADE;"`
	EnvFrom     []*PodEnvFromSource `gorm:"constraint:OnDelete:CASCADE;"`
	Env         []*PodEnvVar        `gorm:"constraint:OnDelete:CASCADE;"`

	VolumeMounts  []*PodVolumeMount  `gorm:"constraint:OnDelete:CASCADE;"`
	VolumeDevices []*PodVolumeDevice `gorm:"constraint:OnDelete:CASCADE;"`

	LivenessProbeInitialDelaySeconds int32
	LivenessProbeTimeoutSeconds      int32
	LivenessProbePeriodSeconds       int32
	LivenessProbeSuccessThreshold    int32
	LivenessProbeFailureThreshold    int32

	ReadinessProbeInitialDelaySeconds int32
	ReadinessProbeTimeoutSeconds      int32
	ReadinessProbePeriodSeconds       int32
	ReadinessProbeSuccessThreshold    int32
	ReadinessProbeFailureThreshold    int32

	StartupProbeInitialDelaySeconds int32
	StartupProbeTimeoutSeconds      int32
	StartupProbePeriodSeconds       int32
	StartupProbeSuccessThreshold    int32
	StartupProbeFailureThreshold    int32

	LifecyclePostStartHTTPGetPath   string
	LifecyclePostStartHTTPGetPort   string
	LifecyclePostStartHTTPGetHost   string
	LifecyclePostStartHTTPGetScheme string

	LifecyclePostStartTCPSocketPort string
	LifecyclePostStartTCPSocketHost string

	LifecyclePreStopHTTPGetPath   string
	LifecyclePreStopHTTPGetPort   string
	LifecyclePreStopHTTPGetHost   string
	LifecyclePreStopHTTPGetScheme string

	LifecyclePreStopTCPSocketPort string
	LifecyclePreStopTCPSocketHost string
	TerminationMessagePath        string
	TerminationMessagePolicy      string
	ImagePullPolicy               string

	SecurityContextCapabilitiesAdd  []*PodCapabilitiesAdd  `gorm:"constraint:OnDelete:CASCADE;"`
	SecurityContextCapabilitiesDrop []*PodCapabilitiesDrop `gorm:"constraint:OnDelete:CASCADE;"`
	SecurityContextPrivileged       *bool

	SecurityContextSELinuxOptionsUser  string
	SecurityContextSELinuxOptionsRole  string
	SecurityContextSELinuxOptionsType  string
	SecurityContextSELinuxOptionsLevel string

	SecurityContextWindowsOptionsGMSACredentialSpecName *string
	SecurityContextWindowsOptionsGMSACredentialSpec     *string
	SecurityContextWindowsOptionsRunAsUserName          *string
	SecurityContextRunAsUser                            *int64
	SecurityContextRunAsGroup                           *int64
	SecurityContextRunAsNonRoot                         *bool
	SecurityContextReadOnlyRootFilesystem               *bool
	SecurityContextAllowPrivilegeEscalation             *bool
	SecurityContextProcMount                            *v1.ProcMountType

	SecurityContextSeccompProfileType             string
	SecurityContextSeccompProfileLocalhostProfile *string
	Stdin                                         bool
	StdinOnce                                     bool
	TTY                                           bool
}

func (PodContainer) TableName

func (PodContainer) TableName() string

type PodContainerArgs

type PodContainerArgs struct {
	ID             uint   `gorm:"primarykey"`
	PodContainerID uint   `neo:"ignore"`
	ClusterName    string `gorm:"-"`
	Value          string
}

func (PodContainerArgs) TableName

func (PodContainerArgs) TableName() string

type PodContainerCommand

type PodContainerCommand struct {
	ID             uint   `gorm:"primarykey"`
	PodContainerID uint   `neo:"ignore"`
	ClusterName    string `gorm:"-"`
	Value          string
}

func (PodContainerCommand) TableName

func (PodContainerCommand) TableName() string

type PodContainerPort

type PodContainerPort struct {
	ID             uint   `gorm:"primarykey"`
	PodContainerID uint   `neo:"ignore"`
	ClusterName    string `gorm:"-"`
	Name           string
	HostPort       int32
	ContainerPort  int32
	Protocol       string
	HostIP         string
}

func (PodContainerPort) TableName

func (PodContainerPort) TableName() string

type PodContainerStatus

type PodContainerStatus struct {
	ID          uint   `gorm:"primarykey"`
	PodID       uint   `neo:"ignore"`
	ClusterName string `gorm:"-"`
	Name        string

	StateWaitingReason  string
	StateWaitingMessage string

	StateTerminatedExitCode int32
	StateTerminatedSignal   int32
	StateTerminatedReason   string
	StateTerminatedMessage  string

	StateTerminatedContainerID string

	LastTerminationStateWaitingReason  string
	LastTerminationStateWaitingMessage string

	LastTerminationStateTerminatedExitCode int32
	LastTerminationStateTerminatedSignal   int32
	LastTerminationStateTerminatedReason   string
	LastTerminationStateTerminatedMessage  string

	LastTerminationStateTerminatedContainerID string
	Ready                                     bool
	RestartCount                              int32
	Image                                     string
	ImageID                                   string
	ContainerID                               string
	Started                                   *bool
}

func (PodContainerStatus) TableName

func (PodContainerStatus) TableName() string

type PodDNSConfigNameservers

type PodDNSConfigNameservers struct {
	ID          uint   `gorm:"primarykey"`
	PodID       uint   `neo:"ignore"`
	ClusterName string `gorm:"-"`
	Value       string
}

func (PodDNSConfigNameservers) TableName

func (PodDNSConfigNameservers) TableName() string

type PodDNSConfigOption

type PodDNSConfigOption struct {
	ID          uint   `gorm:"primarykey"`
	PodID       uint   `neo:"ignore"`
	ClusterName string `gorm:"-"`
	Name        string
	Value       *string
}

func (PodDNSConfigOption) TableName

func (PodDNSConfigOption) TableName() string

type PodDNSConfigSearches

type PodDNSConfigSearches struct {
	ID          uint   `gorm:"primarykey"`
	PodID       uint   `neo:"ignore"`
	ClusterName string `gorm:"-"`
	Value       string
}

func (PodDNSConfigSearches) TableName

func (PodDNSConfigSearches) TableName() string

type PodEnvFromSource

type PodEnvFromSource struct {
	ID             uint   `gorm:"primarykey"`
	PodContainerID uint   `neo:"ignore"`
	ClusterName    string `gorm:"-"`
	Prefix         string

	ConfigMapRefOptional *bool

	SecretRefOptional *bool
}

func (PodEnvFromSource) TableName

func (PodEnvFromSource) TableName() string

type PodEnvVar

type PodEnvVar struct {
	ID             uint   `gorm:"primarykey"`
	PodContainerID uint   `neo:"ignore"`
	ClusterName    string `gorm:"-"`
	Name           string
	Value          string

	ValueFromFieldRefAPIVersion string
	ValueFromFieldRefFieldPath  string

	ValueFromResourceFieldRefContainerName string
	ValueFromResourceFieldRefResource      string

	ValueFromResourceFieldRefDivisorivalue int64
	ValueFromResourceFieldRefDivisoriscale int32

	ValueFromResourceFieldRefDivisors string

	ValueFromConfigMapKeyRefKey      string
	ValueFromConfigMapKeyRefOptional *bool

	ValueFromSecretKeyRefKey      string
	ValueFromSecretKeyRefOptional *bool
}

func (PodEnvVar) TableName

func (PodEnvVar) TableName() string

type PodEphemeralContainer

type PodEphemeralContainer struct {
	ID                  uint   `gorm:"primarykey"`
	PodID               uint   `neo:"ignore"`
	ClusterName         string `gorm:"-"`
	TargetContainerName string
}

func (PodEphemeralContainer) TableName

func (PodEphemeralContainer) TableName() string

type PodExecActionCommand

type PodExecActionCommand struct {
	ID              uint   `gorm:"primarykey"`
	PodExecActionID uint   `neo:"ignore"`
	ClusterName     string `gorm:"-"`
	Value           string
}

func (PodExecActionCommand) TableName

func (PodExecActionCommand) TableName() string

type PodHTTPHeader

type PodHTTPHeader struct {
	ID                 uint   `gorm:"primarykey"`
	PodHTTPGetActionID uint   `neo:"ignore"`
	ClusterName        string `gorm:"-"`
	Name               string
	Value              string
}

func (PodHTTPHeader) TableName

func (PodHTTPHeader) TableName() string

type PodHostAlias

type PodHostAlias struct {
	ID          uint   `gorm:"primarykey"`
	PodID       uint   `neo:"ignore"`
	ClusterName string `gorm:"-"`
	IP          string
	Hostnames   []*PodHostAliasHostnames `gorm:"constraint:OnDelete:CASCADE;"`
}

func (PodHostAlias) TableName

func (PodHostAlias) TableName() string

type PodHostAliasHostnames

type PodHostAliasHostnames struct {
	ID             uint   `gorm:"primarykey"`
	PodHostAliasID uint   `neo:"ignore"`
	ClusterName    string `gorm:"-"`
	Value          string
}

func (PodHostAliasHostnames) TableName

func (PodHostAliasHostnames) TableName() string

type PodIP

type PodIP struct {
	ID          uint   `gorm:"primarykey"`
	PodID       uint   `neo:"ignore"`
	ClusterName string `gorm:"-"`
	IP          string
}

func (PodIP) TableName

func (PodIP) TableName() string

type PodReadinessGate

type PodReadinessGate struct {
	ID            uint   `gorm:"primarykey"`
	PodID         uint   `neo:"ignore"`
	ClusterName   string `gorm:"-"`
	ConditionType string
}

func (PodReadinessGate) TableName

func (PodReadinessGate) TableName() string

type PodSysctl

type PodSysctl struct {
	ID          uint   `gorm:"primarykey"`
	PodID       uint   `neo:"ignore"`
	ClusterName string `gorm:"-"`
	Name        string
	Value       string
}

func (PodSysctl) TableName

func (PodSysctl) TableName() string

type PodToleration

type PodToleration struct {
	ID                uint   `gorm:"primarykey"`
	PodID             uint   `neo:"ignore"`
	ClusterName       string `gorm:"-"`
	Key               string
	Operator          string
	Value             string
	Effect            string
	TolerationSeconds *int64
}

func (PodToleration) TableName

func (PodToleration) TableName() string

type PodVolume

type PodVolume struct {
	ID          uint   `gorm:"primarykey"`
	PodID       uint   `neo:"ignore"`
	ClusterName string `gorm:"-"`
	Name        string
}

func (PodVolume) TableName

func (PodVolume) TableName() string

type PodVolumeDevice

type PodVolumeDevice struct {
	ID             uint   `gorm:"primarykey"`
	PodContainerID uint   `neo:"ignore"`
	ClusterName    string `gorm:"-"`
	Name           string
	DevicePath     string
}

func (PodVolumeDevice) TableName

func (PodVolumeDevice) TableName() string

type PodVolumeMount

type PodVolumeMount struct {
	ID               uint   `gorm:"primarykey"`
	PodContainerID   uint   `neo:"ignore"`
	ClusterName      string `gorm:"-"`
	Name             string
	ReadOnly         bool
	MountPath        string
	SubPath          string
	MountPropagation *v1.MountPropagationMode
	SubPathExpr      string
}

func (PodVolumeMount) TableName

func (PodVolumeMount) TableName() string

type Provider

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

func (*Provider) Run

func (p *Provider) Run(config interface{}) error

type Service

type Service struct {
	ID          uint   `gorm:"primarykey"`
	ClusterName string `neo:"unique"`

	Name                         string                 `neo:"unique"`
	Namespace                    string                 `neo:"unique"`
	SpecPorts                    []*ServicePort         `gorm:"constraint:OnDelete:CASCADE;"`
	SpecSelector                 []*ServiceSpecSelector `gorm:"constraint:OnDelete:CASCADE;"`
	SpecClusterIP                string
	SpecType                     string
	SpecExternalIPs              []*ServiceSpecExternalIPs `gorm:"constraint:OnDelete:CASCADE;"`
	SpecSessionAffinity          string
	SpecLoadBalancerIP           string
	SpecLoadBalancerSourceRanges []*ServiceSpecLoadBalancerSourceRanges `gorm:"constraint:OnDelete:CASCADE;"`
	SpecExternalName             string
	SpecExternalTrafficPolicy    string
	SpecHealthCheckNodePort      int32
	SpecPublishNotReadyAddresses bool

	SpecSessionAffinityConfigClientIPTimeoutSeconds *int32
	SpecIPFamily                                    *v1.IPFamily
	SpecTopologyKeys                                []*ServiceSpecTopologyKeys `gorm:"constraint:OnDelete:CASCADE;"`

	StatusLoadBalancerIngress []*ServiceLoadBalancerIngress `gorm:"constraint:OnDelete:CASCADE;"`
}

func (Service) TableName

func (Service) TableName() string

type ServiceConfig

type ServiceConfig struct {
	Filter string
}

type ServiceLoadBalancerIngress

type ServiceLoadBalancerIngress struct {
	ID          uint   `gorm:"primarykey"`
	ServiceID   uint   `neo:"ignore"`
	ClusterName string `gorm:"-"`

	IP       string
	Hostname string
}

func (ServiceLoadBalancerIngress) TableName

func (ServiceLoadBalancerIngress) TableName() string

type ServicePort

type ServicePort struct {
	ID          uint   `gorm:"primarykey"`
	ServiceID   uint   `neo:"ignore"`
	ClusterName string `gorm:"-"`

	Name        string
	Protocol    string
	AppProtocol *string
	Port        int32
	TargetPort  string
	NodePort    int32
}

func (ServicePort) TableName

func (ServicePort) TableName() string

type ServiceSpecExternalIPs

type ServiceSpecExternalIPs struct {
	ID          uint   `gorm:"primarykey"`
	ServiceID   uint   `neo:"ignore"`
	ClusterName string `gorm:"-"`

	Value string
}

func (ServiceSpecExternalIPs) TableName

func (ServiceSpecExternalIPs) TableName() string

type ServiceSpecLoadBalancerSourceRanges

type ServiceSpecLoadBalancerSourceRanges struct {
	ID          uint   `gorm:"primarykey"`
	ServiceID   uint   `neo:"ignore"`
	ClusterName string `gorm:"-"`

	Value string
}

func (ServiceSpecLoadBalancerSourceRanges) TableName

type ServiceSpecSelector

type ServiceSpecSelector struct {
	ID          uint   `gorm:"primarykey"`
	ServiceID   uint   `neo:"ignore"`
	ClusterName string `gorm:"-"`

	Key   string
	Value string
}

func (ServiceSpecSelector) TableName

func (ServiceSpecSelector) TableName() string

type ServiceSpecTopologyKeys

type ServiceSpecTopologyKeys struct {
	ID          uint   `gorm:"primarykey"`
	ServiceID   uint   `neo:"ignore"`
	ClusterName string `gorm:"-"`

	Value string
}

func (ServiceSpecTopologyKeys) TableName

func (ServiceSpecTopologyKeys) TableName() string

Jump to

Keyboard shortcuts

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