kubehelper

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: Apache-2.0 Imports: 45 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlagsForControllerConfig added in v0.3.0

func FlagsForControllerConfig(name, prefix string, l *log.Config, c *ControllerConfig) *pflag.FlagSet

func FlagsForKubeClient added in v0.3.0

func FlagsForKubeClient(prefix string, c *KubeClientConfig) *pflag.FlagSet

func FlagsForLeaderElection added in v0.3.0

func FlagsForLeaderElection(name, prefix string, c *LeaderElectionConfig) *pflag.FlagSet

func FlagsForLeaderElectionLease added in v0.3.0

func FlagsForLeaderElectionLease(prefix string, c *LeaderElectionLeaseConfig) *pflag.FlagSet

func FlagsForLeaderElectionLock added in v0.3.0

func FlagsForLeaderElectionLock(name, prefix string, c *LeaderElectionLockConfig) *pflag.FlagSet

Types

type CSIDriverClient

type CSIDriverClient struct {
	V1Client   v1.CSIDriverInterface
	V1b1Client v1beta1.CSIDriverInterface
}

func CreateCSIDriverClient

func CreateCSIDriverClient(apiResources []*metav1.APIResourceList, kubeClient kubernetes.Interface) *CSIDriverClient

func (*CSIDriverClient) Create

func (*CSIDriverClient) Delete

func (c *CSIDriverClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error

func (*CSIDriverClient) DeleteCollection

func (c *CSIDriverClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error

func (*CSIDriverClient) Get

func (*CSIDriverClient) List

func (*CSIDriverClient) Patch

func (c *CSIDriverClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subResources ...string) (*storage.CSIDriver, error)

func (*CSIDriverClient) Update

func (*CSIDriverClient) Watch

type CSIDriverLister

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

func CreateCSIDriverLister

func CreateCSIDriverLister(indexer cache.Indexer) *CSIDriverLister

func (*CSIDriverLister) Get

func (l *CSIDriverLister) Get(name string) (*storage.CSIDriver, error)

Get retrieves the CSIDriver from the index for a given name.

func (*CSIDriverLister) List

func (l *CSIDriverLister) List(selector labels.Selector) ([]*storage.CSIDriver, error)

List lists all CSIDrivers in the indexer.

type CertificateSigningRequestClient

type CertificateSigningRequestClient struct {
	//V1Client   v1.CertificateSigningRequestInterface
	V1b1Client v1beta1.CertificateSigningRequestInterface
}

func CreateCertificateSigningRequestClient

func CreateCertificateSigningRequestClient(apiResources []*metav1.APIResourceList, kubeClient kubernetes.Interface) *CertificateSigningRequestClient

func (*CertificateSigningRequestClient) Delete

func (*CertificateSigningRequestClient) DeleteCollection

func (*CertificateSigningRequestClient) Get

func (*CertificateSigningRequestClient) List

func (*CertificateSigningRequestClient) Patch

func (*CertificateSigningRequestClient) Watch

type ControllerConfig added in v0.3.0

type ControllerConfig struct {
	Log            log.ConfigSet            `json:"log" yaml:"log"`
	KubeClient     KubeClientConfig         `json:"kubeClient" yaml:"kubeClient"`
	Metrics        perfhelper.MetricsConfig `json:"metrics" yaml:"metrics"`
	Tracing        perfhelper.TracingConfig `json:"tracing" yaml:"tracing"`
	LeaderElection LeaderElectionConfig     `json:"leaderElection" yaml:"leaderElection"`
	PProf          perfhelper.PProfConfig   `json:"pprof" yaml:"pprof"`
}

type KubeClientConfig added in v0.3.0

type KubeClientConfig struct {
	// Fake to create a fake client instead of creating real kubernetes client
	Fake           bool                      `json:"fake" yaml:"fake"`
	KubeconfigPath string                    `json:"kubeconfig" yaml:"kubeconfig"`
	RateLimit      KubeClientRateLimitConfig `json:"rateLimit" yaml:"rateLimit"`
}

func (*KubeClientConfig) NewKubeClient added in v0.3.0

func (c *KubeClientConfig) NewKubeClient(
	kubeconfig *rest.Config,
	applyRateLimitConfig bool,
) (client kubernetes.Interface, _ *rest.Config, err error)

NewKubeClient creates a kubernetes client with/without existing kubeconfig if nil kubeconfig was provided, then will retrieve kubeconfig from configured path and will fallback to in cluster kubeconfig you can choose whether rate limit config is applied, if not, will use default rate limit config

type KubeClientRateLimitConfig added in v0.3.0

type KubeClientRateLimitConfig struct {
	Enabled bool    `json:"enabled" yaml:"enabled"`
	QPS     float32 `json:"qps" yaml:"qps"`
	Burst   int     `json:"burst" yaml:"burst"`
}

type KubeInformerReconciler added in v0.3.0

type KubeInformerReconciler struct {
	*reconcile.Core
	// contains filtered or unexported fields
}

func NewKubeInformerReconciler added in v0.3.0

func NewKubeInformerReconciler(
	ctx context.Context,
	informer kubecache.SharedInformer,
	options reconcile.Options,
) *KubeInformerReconciler

func (*KubeInformerReconciler) GetKey added in v0.3.0

func (r *KubeInformerReconciler) GetKey(obj interface{}) string

type LeaderElectionConfig added in v0.3.0

type LeaderElectionConfig struct {
	Identity string                    `json:"identity" yaml:"identity"`
	Lock     LeaderElectionLockConfig  `json:"lock" yaml:"lock"`
	Lease    LeaderElectionLeaseConfig `json:"lease" yaml:"lease"`
}

func (*LeaderElectionConfig) CreateElector added in v0.3.0

func (c *LeaderElectionConfig) CreateElector(
	name string,
	kubeClient kubernetes.Interface,
	eventRecorder record.EventRecorder,
	onElected func(context.Context),
	onEjected func(),
	onNewLeader func(identity string),
) (*leaderelection.LeaderElector, error)

type LeaderElectionLeaseConfig added in v0.3.0

type LeaderElectionLeaseConfig struct {
	Expiration       time.Duration `json:"expiration" yaml:"expiration"`
	RenewDeadline    time.Duration `json:"renewDeadline" yaml:"renewDeadline"`
	RenewInterval    time.Duration `json:"renewInterval" yaml:"renewInterval"`
	ExpiryToleration time.Duration `json:"expiryToleration" yaml:"expiryToleration"`
}

type LeaderElectionLockConfig added in v0.3.0

type LeaderElectionLockConfig struct {
	Name      string `json:"name" yaml:"name"`
	Namespace string `json:"namespace" yaml:"namespace"`
	Type      string `json:"type" yaml:"type"`
}

type LeaseClient

type LeaseClient struct {
	V1Client   v1.LeaseInterface
	V1b1Client v1beta1.LeaseInterface
}

func CreateLeaseClient

func CreateLeaseClient(apiResources []*metav1.APIResourceList, kubeClient kubernetes.Interface, namespace string) *LeaseClient

func (*LeaseClient) Create

func (*LeaseClient) Delete

func (c *LeaseClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error

func (*LeaseClient) DeleteCollection

func (c *LeaseClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error

func (*LeaseClient) Get

func (*LeaseClient) List

func (*LeaseClient) Patch

func (c *LeaseClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subResources ...string) (*coordination.Lease, error)

func (*LeaseClient) Update

func (*LeaseClient) Watch

Jump to

Keyboard shortcuts

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