psp

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EMMFailureAnnotation   = "appplatform.vmware.com/emm-failure"
	VolumeHealthAnnotation = "volumehealth.storage.kubernetes.io/health"
	EMMTaintKey            = "node.vmware.com/drain"
)
View Source
const (
	ExtensionIDLabel        string = "appplatform.vmware.com/extension-id"
	InstanceIDLabel         string = "appplatform.vmware.com/instance-id"
	EMMIntegratedAnnotation string = "appplatform.vmware.com/vsphere-emm-integrated"
	ExtensionIDEnv          string = "PSP_EXTENSION_ID"
)
View Source
const (
	HealthLabel             = "vmware.vsphere.health"
	HealthLabelCatalogValue = "catalog"
	HealthLabelHealthValue  = "health"
)

Variables

This section is empty.

Functions

func AddStatefulSetChanges

func AddStatefulSetChanges(dc *api.CassandraDatacenter, statefulSet *appsv1.StatefulSet) *appsv1.StatefulSet

func CheckEMM

func CheckEMM(spi EMMSPI) result.ReconcileResult

func CheckNetworkPolicies

func CheckNetworkPolicies(spi CheckNetworkPoliciesSPI) result.ReconcileResult

VMWare with Kubernetes does not permit network traffic between namespaces by default. This means a NetworkPolicy must be created to allow the operator to make requests to the Management API.

NOTE: The way VMWare implements NetworkPolicy appears to be non-standard. For example, typially setting the namespace selector to an empty value _should_ select all namespaces, but it does not in VMWare with Kubernetes. Consequently, it is important that changes here be verified in that environment.

func CheckPVCHealth

func CheckPVCHealth(spi EMMSPI) result.ReconcileResult

func GetExtensionID

func GetExtensionID() string

The return value here _should_ be the same as `vSphereExtensionKey` in the VCUIPlugin resource:

apiVersion: appplatform.wcp.vmware.com/v1beta1
kind: VCUIPlugin
metadata:
  labels:
    controller-tools.k8s.io: "1.0"
  name: datastax-vulcan
  namespace: {{ .service.namespace }}
spec:
  name: datastax-vulcan
  uiBackendSecret: datastax-vulcan-tls
  uiBackendService: datastax-vulcan
  vSphereUiPluginUrl: plugin.json
  vSphereExtensionKey: com.datastax.vulcan

Types

type Catalog

type Catalog map[string]string

type CheckNetworkPoliciesSPI

type CheckNetworkPoliciesSPI interface {
	GetClient() client.Client
	GetLogger() logr.Logger
	GetContext() context.Context
	GetDatacenter() *api.CassandraDatacenter
	SetDatacenterAsOwner(controlled metav1.Object) error
}

type DAO

type DAO interface {
	GetHealthData() (*Health, error)
	UpsertHealthData(health *Health) error
	UpsertCatalog(catalog Catalog) error
}

func NewDao

func NewDao(client runtimeClient.Client, namespace string) DAO

type DAOImpl

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

func (*DAOImpl) GetHealthData

func (dao *DAOImpl) GetHealthData() (*Health, error)

func (*DAOImpl) UpsertCatalog

func (dao *DAOImpl) UpsertCatalog(catalog Catalog) error

func (*DAOImpl) UpsertHealthData

func (dao *DAOImpl) UpsertHealthData(health *Health) error

type EMMChecks

type EMMChecks interface {
	IsStopped() bool
	IsInitialized() bool
	// contains filtered or unexported methods
}

type EMMFailure

type EMMFailure string
const (
	GenericFailure          EMMFailure = "GenericFailure"
	NotEnoughResources      EMMFailure = "NotEnoughResources"
	TooManyExistingFailures EMMFailure = "TooManyExistingFailures"
)

type EMMOperations

type EMMOperations interface {
	// contains filtered or unexported methods
}

type EMMSPI

type EMMSPI interface {
	GetAllNodesInDC() ([]*corev1.Node, error)
	GetDCPods() []*corev1.Pod
	GetNotReadyPodsBootstrappedInDC() []*corev1.Pod
	GetAllPodsNotReadyInDC() []*corev1.Pod
	GetPodPVCs(pod *corev1.Pod) ([]*corev1.PersistentVolumeClaim, error)
	StartNodeReplace(podName string) error
	GetInProgressNodeReplacements() []string
	RemovePod(pod *corev1.Pod) error
	UpdatePod(pod *corev1.Pod) error
	IsStopped() bool
	IsInitialized() bool
	GetLogger() logr.Logger
	GetAllNodes() ([]*corev1.Node, error)
}

This interface is what, in practice, the ReconciliationContext will need to implement. Its intention is to keep coupling with the reconciliation package low and also to keep this package relatively sheltered from certain thorny details, like determining which pods represent cassandra nodes that have bootstrapped at some point.

type EMMService

type EMMService interface {
	EMMOperations
	EMMChecks
	// contains filtered or unexported methods
}

type EMMServiceImpl

type EMMServiceImpl struct {
	EMMSPI
}

EMMOperations impl

type EMMTaintValue

type EMMTaintValue string
const (
	EvacuateAllData EMMTaintValue = "drain"
	PlannedDowntime               = "planned-downtime"
)

type Health

type Health struct {
	Spec   `json:"spec"`
	Status `json:"status"`
}

type HealthStatus

type HealthStatus string
const (
	HealthGreen  HealthStatus = "green"
	HealthYellow HealthStatus = "yellow"
	HealthRed    HealthStatus = "red"
)

type HealthStatusUpdater

type HealthStatusUpdater interface {
	Update(dc api.CassandraDatacenter) error
}

func NewHealthStatusUpdater

func NewHealthStatusUpdater(client runtimeClient.Client, namespace string) HealthStatusUpdater

type HealthStatusUpdaterImpl

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

func (*HealthStatusUpdaterImpl) Update

type InstanceHealth

type InstanceHealth struct {
	Instance  string       `json:"instance"`
	Namespace string       `json:"namespace"`
	Health    HealthStatus `json:"health"`
}

type NoOpUpdater

type NoOpUpdater struct{}

func (*NoOpUpdater) Update

type Spec

type Spec map[string]interface{}

type Status

type Status struct {
	InstanceHealth []InstanceHealth `json:"instanceHealth"`
}

type VolumeHealth

type VolumeHealth string
const (
	VolumeHealthInaccessible VolumeHealth = "inaccessible"
)

Jump to

Keyboard shortcuts

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