standardperceptor

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuxiliaryConfig

type AuxiliaryConfig struct {
	Namespace string

	// true -> openshift; false -> kubernetes
	IsOpenshift bool

	// AUTH CONFIGS
	// TODO Lets try to have this injected on serviceaccount
	// at pod startup, eventually Service accounts.
	PrivateDockerRegistries []model.RegistryAuth

	PodPerceiverServiceAccountName   string
	ImagePerceiverServiceAccountName string
	ImageFacadeServiceAccountName    string
}

func ReadAuxiliaryConfig

func ReadAuxiliaryConfig(auxConfigPath string) *AuxiliaryConfig

type Config

type Config struct {
	// general protoform config
	MasterURL      string
	KubeConfigPath string

	Hub struct {
		Host     string
		User     string
		Password string
		Port     int32
	}

	Perceptor struct {
		HubClientTimeoutMilliseconds int
		ConcurrentScanLimit          int
		TotalScanLimit               int
		ServiceName                  string
		Port                         int32
		UseMockMode                  bool
	}

	// Perceivers config
	ImagePerceiver struct {
		Port                      int32
		AnnotationIntervalSeconds int
		DumpIntervalMinutes       int
	}

	PodPerceiver struct {
		Port                      int32
		ReplicationCount          int
		AnnotationIntervalSeconds int
		DumpIntervalMinutes       int
	}

	ScannerPod struct {
		Name             string
		ReplicationCount int32
		ImageDirectory   string
	}

	Scanner struct {
		Port                   int32
		Memory                 string
		JavaInitialHeapSizeMBs int
		JavaMaxHeapSizeMBs     int
	}

	ImageFacade struct {
		Port int32
	}

	Skyfire struct {
		Port int32
	}

	// Secret config
	HubPasswordSecretName string
	HubPasswordSecretKey  string

	LogLevel string

	AuxConfig *AuxiliaryConfig
}

func ReadConfig

func ReadConfig(configPath string) *Config

func (*Config) ImagePerceiverConfig

func (pc *Config) ImagePerceiverConfig() model.ImagePerceiverConfigMap

func (*Config) ImagefacadeConfig

func (pc *Config) ImagefacadeConfig() model.ImagefacadeConfigMap

func (*Config) PerceptorConfig

func (pc *Config) PerceptorConfig() model.PerceptorConfigMap

func (*Config) PodPerceiverConfig

func (pc *Config) PodPerceiverConfig() model.PodPerceiverConfigMap

func (*Config) ScannerConfig

func (pc *Config) ScannerConfig() model.ScannerConfigMap

func (*Config) SkyfireConfig

func (pc *Config) SkyfireConfig() model.SkyfireConfigMap

type Kube

type Kube struct {
	Config *Config
	// model objects
	Perceptor    *model.Perceptor
	PodPerceiver *model.PodPerceiver
	Scanner      *model.Scanner
	ImageFacade  *model.Imagefacade
	ScannerPod   *model.ScannerPod
	Prometheus   *model.Prometheus
	Skyfire      *model.Skyfire
	// kubernetes resources
	ReplicationControllers []*v1.ReplicationController
	ConfigMaps             []*v1.ConfigMap
	Services               []*v1.Service
	Secrets                []*v1.Secret
	Deployments            []*v1beta1.Deployment
}

func NewKube

func NewKube(config *Config) *Kube

func (*Kube) GetConfigMaps

func (kube *Kube) GetConfigMaps() []*v1.ConfigMap

func (*Kube) GetDeployments

func (kube *Kube) GetDeployments() []*v1beta1.Deployment

func (*Kube) GetReplicationControllers

func (kube *Kube) GetReplicationControllers() []*v1.ReplicationController

func (*Kube) GetSecrets

func (kube *Kube) GetSecrets() []*v1.Secret

func (*Kube) GetServices

func (kube *Kube) GetServices() []*v1.Service

type Openshift

type Openshift struct {
	Config *Config
	// that this struct uses a Kube is an implementation detail
	Kube *Kube
	// kubernetes resources
	ReplicationControllers []*v1.ReplicationController
	ConfigMaps             []*v1.ConfigMap
	Services               []*v1.Service
	Secrets                []*v1.Secret
	Deployments            []*v1beta1.Deployment
}

func NewOpenshift

func NewOpenshift(config *Config) *Openshift

func (*Openshift) GetConfigMaps

func (os *Openshift) GetConfigMaps() []*v1.ConfigMap

func (*Openshift) GetDeployments

func (os *Openshift) GetDeployments() []*v1beta1.Deployment

func (*Openshift) GetReplicationControllers

func (os *Openshift) GetReplicationControllers() []*v1.ReplicationController

func (*Openshift) GetSecrets

func (os *Openshift) GetSecrets() []*v1.Secret

func (*Openshift) GetServices

func (os *Openshift) GetServices() []*v1.Service

Jump to

Keyboard shortcuts

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