controller

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeploymentName     = "vpc-resource-local-controller"
	Namespace          = "kube-system"
	LeaderLeaseMapName = "cp-vpc-resource-controller"

	PodLabelKey = "app"
	PodLabelVal = "vpc-resource-controller"

	ClusterRoleName = "vpc-resource-controller-role"
)

Variables

This section is empty.

Functions

func ForcefullyKillControllerPods

func ForcefullyKillControllerPods(ctx context.Context, manager Manager, podManager pod.Manager) string

func GetNewPodWithLeaderLease

func GetNewPodWithLeaderLease(ctx context.Context, manager Manager) string

func PatchClusterRole

func PatchClusterRole(rbac rbac.Manager, resourceName string, verbs []string)

PatchClusterRole patches the cluster Role with a given set of verbs and stores the existing state in variable, so the original state can be later recovered

func RestartController

func RestartController(ctx context.Context, manager Manager, depManager deployment.Manager) string

func RevertClusterRoleChanges

func RevertClusterRoleChanges(rbac rbac.Manager)

RevertClusterRoleChanges reverts the RBAC cluster role to the older known state

func ScaleControllerDeployment

func ScaleControllerDeployment(ctx context.Context, deploymentManager deployment.Manager, replica int)

func VerifyLeaseHolderIsSame

func VerifyLeaseHolderIsSame(ctx context.Context, manager Manager,
	previousLeaseHolder string)

Types

type LeaderLease

type LeaderLease struct {
	HolderIdentity string
}

type Manager

type Manager interface {
	WaitTillControllerHasLeaderLease(ctx context.Context) (string, error)
}

func NewManager

func NewManager(k8sClient client.Client) Manager

Jump to

Keyboard shortcuts

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