patcher

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExtenderConfigMapName - the configmap, which contains statuses of kube-scheduler restart
	ExtenderConfigMapName = "extender-readiness"
	// ExtenderConfigMapPath - the path to ExtenderConfigMap
	ExtenderConfigMapPath = "/status"
	// ExtenderConfigMapFile - ExtenderConfigMap data key
	ExtenderConfigMapFile = "nodes.yaml"

	K8sMasterNodeLabelKey = "node-role.kubernetes.io/master"
)

TODO import from csi-baremetal - https://github.com/dell/csi-baremetal/issues/475

View Source
const (

	// OpenshiftSecondarySchedulerLabelValue - Openshift Secondary Scheduler Pod Label Value
	OpenshiftSecondarySchedulerLabelValue = "secondary-scheduler"
	// OpenshiftSecondarySchedulerNamespace - Namespace for Openshift Secondary Scheduler Resources
	OpenshiftSecondarySchedulerNamespace = "openshift-secondary-scheduler-operator"
)

Variables

This section is empty.

Functions

func ChooseKubeSchedulerLabel

func ChooseKubeSchedulerLabel(csi *csibaremetalv1.Deployment) (string, string, error)

ChooseKubeSchedulerLabel creates a label value and key to find kube-scheduler

func IsPatchingEnabled

func IsPatchingEnabled(csi *csibaremetalv1.Deployment) bool

IsPatchingEnabled checks enable flag and platform field Returns true if patcher enabled and platform is allowed, false otherwise

Types

type ExtenderReadinessOptions

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

ExtenderReadinessOptions contains options to deploy ExtenderConfigMap

func NewExtenderReadinessOptions

func NewExtenderReadinessOptions(csi *csibaremetalv1.Deployment,
	useOpenshiftSecondaryScheduler bool) (*ExtenderReadinessOptions, error)

NewExtenderReadinessOptions creates ExtenderReadinessOptions

type ReadinessStatus

type ReadinessStatus struct {
	NodeName      string `yaml:"node_name"`
	KubeScheduler string `yaml:"kube_scheduler"`
	Restarted     bool   `yaml:"restarted"`
}

ReadinessStatus contains restart status of one kube-scheduler

type ReadinessStatusList

type ReadinessStatusList struct {
	Items []ReadinessStatus `yaml:"nodes"`
}

ReadinessStatusList contains statuses of all kube-schedulers in cluster

type SchedulerPatcher

type SchedulerPatcher struct {
	Clientset                 kubernetes.Interface
	Log                       *logrus.Entry
	Client                    client.Client
	PodSecurityPolicyVerifier securityverifier.SecurityVerifier
	// will only set on Openshift
	KubernetesVersion string
	// whether use secondary scheduler on Openshift
	UseOpenshiftSecondaryScheduler bool
	// SelectedSchedulerExtenderIP used for openshift secondary scheduler extender config if applicable
	SelectedSchedulerExtenderIP string
	// The suffix pattern used to check whether the scheduler extender workable on Openshift with 2nd scheduler
	ExtenderPatternChecked string
	// HTTPClient used for openshift secondary scheduler extender config if applicable
	HTTPClient *http.Client
}

SchedulerPatcher performs pacthing procedure depends on platform

func (*SchedulerPatcher) Uninstall

Uninstall unpatch Openshift Scheduler

func (*SchedulerPatcher) Update

Update updates or creates csi-baremetal-se-patcher on RKE and Vanilla patches Kube-Scheduler on Openshift

func (*SchedulerPatcher) UpdateReadinessConfigMap

func (p *SchedulerPatcher) UpdateReadinessConfigMap(ctx context.Context, csi *csibaremetalv1.Deployment,
	scheme *runtime.Scheme, useOpenshiftSecondaryScheduler bool) error

UpdateReadinessConfigMap collects info about ExtenderReadiness statuses and updates configmap

Jump to

Keyboard shortcuts

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