model

package
v0.0.0-...-5d42de7 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeConfigMap

func MakeConfigMap(name string, filename string, contents interface{}) *v1.ConfigMap

Types

type ImagePerceiver

type ImagePerceiver struct {
	PodName string
	Image   string
	CPU     resource.Quantity
	Memory  resource.Quantity

	ConfigMapName  string
	ConfigMapMount string
	ConfigMapPath  string
	Config         ImagePerceiverConfigMap

	ReplicaCount       int32
	ServiceName        string
	ServiceAccountName string
}

func NewImagePerceiver

func NewImagePerceiver(replicaCount int32, serviceAccountName string) *ImagePerceiver

func (*ImagePerceiver) ConfigMap

func (ip *ImagePerceiver) ConfigMap() *v1.ConfigMap

func (*ImagePerceiver) Container

func (ip *ImagePerceiver) Container() *v1.Container

func (*ImagePerceiver) FullConfigMapPath

func (ip *ImagePerceiver) FullConfigMapPath() string

func (*ImagePerceiver) ReplicationController

func (ip *ImagePerceiver) ReplicationController() *v1.ReplicationController

func (*ImagePerceiver) Service

func (ip *ImagePerceiver) Service() *v1.Service

type ImagePerceiverConfigMap

type ImagePerceiverConfigMap struct {
	PerceptorHost             string
	PerceptorPort             int32
	AnnotationIntervalSeconds int
	DumpIntervalMinutes       int
	Port                      int32
}

func NewImagePerceiverConfigMap

func NewImagePerceiverConfigMap(perceptorHost string, perceptorPort int32, annotationIntervalSeconds int, dumpIntervalMinutes int, port int32) *ImagePerceiverConfigMap

type Imagefacade

type Imagefacade struct {
	Image  string
	CPU    resource.Quantity
	Memory resource.Quantity

	ConfigMapName  string
	ConfigMapMount string
	ConfigMapPath  string
	Config         ImagefacadeConfigMap

	ServiceAccountName string
	ServiceName        string

	DockerSocketName string
	DockerSocketPath string

	PodName string

	ImagesMountName string
}

func NewImagefacade

func NewImagefacade(serviceAccountName string, podName string) *Imagefacade

func (*Imagefacade) ConfigMap

func (pif *Imagefacade) ConfigMap() *v1.ConfigMap

func (*Imagefacade) Container

func (pif *Imagefacade) Container() *v1.Container

func (*Imagefacade) FullConfigMapPath

func (pif *Imagefacade) FullConfigMapPath() string

func (*Imagefacade) ReplicationController

func (pif *Imagefacade) ReplicationController() *v1.ReplicationController

func (*Imagefacade) Service

func (pif *Imagefacade) Service() *v1.Service

type ImagefacadeConfigMap

type ImagefacadeConfigMap struct {
	PrivateDockerRegistries []RegistryAuth
	LogLevel                string
	CreateImagesOnly        bool
	Port                    int32
	ImageDirectory          string
}

type MockImagefacade

type MockImagefacade struct {
	Image  string
	CPU    resource.Quantity
	Memory resource.Quantity

	ConfigMapName  string
	ConfigMapMount string
	ConfigMapPath  string
	Config         MockImagefacadeConfigMap

	PodName     string
	ServiceName string

	ImagesMountName string
	ImagesMountPath string
}

func NewMockImagefacade

func NewMockImagefacade() *MockImagefacade

func (*MockImagefacade) ConfigMap

func (mif *MockImagefacade) ConfigMap() *v1.ConfigMap

func (*MockImagefacade) Container

func (mif *MockImagefacade) Container() *v1.Container

func (*MockImagefacade) Service

func (mif *MockImagefacade) Service() *v1.Service

type MockImagefacadeConfigMap

type MockImagefacadeConfigMap struct {
	Port int32
}

func NewMockImagefacadeConfigMap

func NewMockImagefacadeConfigMap(port int32) *MockImagefacadeConfigMap

type Perceptor

type Perceptor struct {
	PodName string
	Image   string
	CPU     resource.Quantity
	Memory  resource.Quantity

	ConfigMapName  string
	ConfigMapMount string
	ConfigMapPath  string
	Config         PerceptorConfigMap

	HubPasswordSecretName string
	HubPasswordSecretKey  string

	ReplicaCount int32
	ServiceName  string
}

func NewPerceptor

func NewPerceptor(serviceName string, hubPasswordSecretName string, hubPasswordSecretKey string) *Perceptor

func (*Perceptor) ConfigMap

func (pc *Perceptor) ConfigMap() *v1.ConfigMap

func (*Perceptor) Container

func (pc *Perceptor) Container() *v1.Container

func (*Perceptor) FullConfigMapPath

func (pc *Perceptor) FullConfigMapPath() string

func (*Perceptor) ReplicationController

func (pc *Perceptor) ReplicationController() *v1.ReplicationController

func (*Perceptor) Service

func (pc *Perceptor) Service() *v1.Service

type PerceptorConfigMap

type PerceptorConfigMap struct {
	Hub                             *PerceptorHubConfig
	Timings                         *PerceptorTimingsConfig
	PruneOrphanedImagesPauseMinutes int
	UseMockMode                     bool
	Port                            int32
	LogLevel                        string
}

type PerceptorHubConfig

type PerceptorHubConfig struct {
	Host                      string
	User                      string
	PasswordEnvVar            string
	ClientTimeoutMilliseconds int
	Port                      int
	ConcurrentScanLimit       int
	TotalScanLimit            int
}

type PerceptorTimingsConfig

type PerceptorTimingsConfig struct {
	CheckForStalledScansPauseHours  int
	StalledScanClientTimeoutHours   int
	ModelMetricsPauseSeconds        int
	UnknownImagePauseMilliseconds   int
	PruneOrphanedImagesPauseMinutes int
}

type PifTester

type PifTester struct {
	PodName string
	Image   string
	CPU     resource.Quantity
	Memory  resource.Quantity

	ConfigMapName  string
	ConfigMapMount string
	ConfigMapPath  string
	Config         PifTesterConfigMap

	ReplicaCount int32
	ServiceName  string
}

func NewPifTester

func NewPifTester() *PifTester

func (*PifTester) ConfigMap

func (pc *PifTester) ConfigMap() *v1.ConfigMap

func (*PifTester) ReplicationController

func (pc *PifTester) ReplicationController() *v1.ReplicationController

func (*PifTester) Service

func (pc *PifTester) Service() *v1.Service

type PifTesterConfigMap

type PifTesterConfigMap struct {
	Port            int32
	ImageFacadePort int32
	LogLevel        string
}

type PodPerceiver

type PodPerceiver struct {
	PodName string
	Image   string
	CPU     resource.Quantity
	Memory  resource.Quantity

	ConfigMapName  string
	ConfigMapMount string
	ConfigMapPath  string
	Config         PodPerceiverConfigMap

	ReplicaCount       int32
	ServiceName        string
	ServiceAccountName string
}

func NewPodPerceiver

func NewPodPerceiver(serviceAccountName string, replicaCount int) *PodPerceiver

func (*PodPerceiver) ConfigMap

func (pp *PodPerceiver) ConfigMap() *v1.ConfigMap

func (*PodPerceiver) FullConfigMapPath

func (pp *PodPerceiver) FullConfigMapPath() string

func (*PodPerceiver) ReplicationController

func (pp *PodPerceiver) ReplicationController() *v1.ReplicationController

func (*PodPerceiver) Service

func (pp *PodPerceiver) Service() *v1.Service

type PodPerceiverConfigMap

type PodPerceiverConfigMap struct {
	PerceptorHost             string
	PerceptorPort             int32
	AnnotationIntervalSeconds int
	DumpIntervalMinutes       int
	Port                      int32
}

func NewPodPerceiverConfigMap

func NewPodPerceiverConfigMap(perceptorHost string, perceptorPort int32, annotationIntervalSeconds int, dumpIntervalMinutes int, port int32) *PodPerceiverConfigMap

type Prometheus

type Prometheus struct {
	Name                string
	PodName             string
	Image               string
	ReplicaCount        int32
	DataVolumeName      string
	DataVolumeMountPath string
	ConfigMapName       string
	ConfigMapSource     string
	ConfigMapMountPath  string
	ServiceName         string
	Port                int32
	Targets             []*PrometheusTarget
}

func NewPrometheus

func NewPrometheus() *Prometheus

func (*Prometheus) AddTarget

func (prom *Prometheus) AddTarget(target *PrometheusTarget)

func (*Prometheus) ConfigMap

func (prom *Prometheus) ConfigMap() *v1.ConfigMap

func (*Prometheus) Deployment

func (prom *Prometheus) Deployment() *v1beta1.Deployment

func (*Prometheus) Service

func (prom *Prometheus) Service() *v1.Service

type PrometheusTarget

type PrometheusTarget struct {
	Host string
	Port int32
}

type RegistryAuth

type RegistryAuth struct {
	Url      string
	User     string
	Password string
}

type Scanner

type Scanner struct {
	Image  string
	Memory resource.Quantity
	CPU    resource.Quantity

	ConfigMapName  string
	ConfigMapMount string
	ConfigMapPath  string
	Config         ScannerConfigMap

	ServiceName string

	PodName string

	HubPasswordSecretName string
	HubPasswordSecretKey  string

	ImagesMountName string
}

func NewScanner

func NewScanner(memoryString string, podName string, hubPasswordSecretName string, hubPasswordSecretKey string) *Scanner

func (*Scanner) ConfigMap

func (psp *Scanner) ConfigMap() *v1.ConfigMap

func (*Scanner) Container

func (psp *Scanner) Container() *v1.Container

func (*Scanner) FullConfigMapPath

func (psp *Scanner) FullConfigMapPath() string

func (*Scanner) Service

func (psp *Scanner) Service() *v1.Service

type ScannerConfigMap

type ScannerConfigMap struct {
	Hub         *ScannerHubConfig
	ImageFacade *ScannerImageFacadeConfig
	Perceptor   *ScannerPerceptorConfig

	JavaInitialHeapSizeMBs int
	JavaMaxHeapSizeMBs     int

	ImageDirectory string

	LogLevel string
	Port     int32
}

type ScannerHubConfig

type ScannerHubConfig struct {
	User                 string
	PasswordEnvVar       string
	Port                 int32
	ClientTimeoutSeconds int
}

type ScannerImageFacadeConfig

type ScannerImageFacadeConfig struct {
	Host string
	Port int32
}

type ScannerPerceptorConfig

type ScannerPerceptorConfig struct {
	Host string
	Port int32
}

type ScannerPod

type ScannerPod struct {
	PodName string

	ReplicaCount int32

	DockerSocketName string
	DockerSocketPath string

	ImagesMountName string

	Scanner     *Scanner
	Imagefacade *Imagefacade
}

func NewScannerPod

func NewScannerPod(scanner *Scanner, imagefacade *Imagefacade) *ScannerPod

func (*ScannerPod) ReplicationController

func (sc *ScannerPod) ReplicationController() *v1.ReplicationController

type ScannerTester

type ScannerTester struct {
	PodName string

	ReplicaCount int32

	ImagesMountName string
	// TODO not sure if ImagesMountPath is still used
	ImagesMountPath string

	Scanner     *Scanner
	Imagefacade *MockImagefacade
}

func NewScannerTester

func NewScannerTester(scanner *Scanner, imagefacade *MockImagefacade) *ScannerTester

func (*ScannerTester) ReplicationController

func (sc *ScannerTester) ReplicationController() *v1.ReplicationController

type Skyfire

type Skyfire struct {
	PodName string
	Image   string
	CPU     resource.Quantity
	Memory  resource.Quantity

	ConfigMapName  string
	ConfigMapMount string
	ConfigMapPath  string
	Config         SkyfireConfigMap

	HubPasswordSecretName string
	HubPasswordSecretKey  string

	ReplicaCount int32
	ServiceName  string
}

func NewSkyfire

func NewSkyfire(hubPasswordSecretName string, hubPasswordSecretKey string) *Skyfire

func (*Skyfire) ConfigMap

func (sf *Skyfire) ConfigMap() *v1.ConfigMap

func (*Skyfire) Container

func (sf *Skyfire) Container() *v1.Container

func (*Skyfire) FullConfigMapPath

func (sf *Skyfire) FullConfigMapPath() string

func (*Skyfire) ReplicationController

func (sf *Skyfire) ReplicationController() *v1.ReplicationController

func (*Skyfire) Service

func (sf *Skyfire) Service() *v1.Service

type SkyfireConfigMap

type SkyfireConfigMap struct {
	UseInClusterConfig bool
	MasterURL          string
	KubeConfigPath     string
	LogLevel           string

	KubeDumpIntervalSeconds      int
	PerceptorDumpIntervalSeconds int
	HubDumpPauseSeconds          int

	Port int32

	HubHost               string
	HubUser               string
	HubUserPasswordEnvVar string

	PerceptorHost string
	PerceptorPort int32
}

func NewSkyfireConfigMap

func NewSkyfireConfigMap(logLevel string, port int32, hubHost string, hubUser string, hubUserPasswordEnvVar string, perceptorHost string, perceptorPort int32) *SkyfireConfigMap

Jump to

Keyboard shortcuts

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