actionsgithubcom

package
v0.27.6 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// "immediate": (default) The controller will immediately apply the change causing the
	// recreation of the listener and ephemeral runner set. This can lead to an
	// overprovisioning of runners, if there are pending / running jobs. This should not
	// be a problem at a small scale, but it could lead to a significant increase of
	// resources if you have a lot of jobs running concurrently.
	UpdateStrategyImmediate = UpdateStrategy("immediate")
	// "eventual": The controller will remove the listener and ephemeral runner set
	// immediately, but will not recreate them (to apply changes) until all
	// pending / running jobs have completed.
	// This can lead to a longer time to apply the change but it will ensure
	// that you don't have any overprovisioning of runners.
	UpdateStrategyEventual = UpdateStrategy("eventual")
)

Defines how the controller should handle upgrades while having running jobs.

View Source
const (
	LabelKeyRunnerTemplateHash = "runner-template-hash"
	LabelKeyPodTemplateHash    = "pod-template-hash"
)
View Source
const (
	EnvVarRunnerJITConfig      = "ACTIONS_RUNNER_INPUT_JITCONFIG"
	EnvVarRunnerExtraUserAgent = "GITHUB_ACTIONS_RUNNER_EXTRA_USER_AGENT"
)
View Source
const (
	EnvVarHTTPProxy  = "http_proxy"
	EnvVarHTTPSProxy = "https_proxy"
	EnvVarNoProxy    = "no_proxy"
)

Environment variable names used to set proxy variables for containers

View Source
const (
	// Kubernetes labels
	LabelKeyKubernetesPartOf    = "app.kubernetes.io/part-of"
	LabelKeyKubernetesComponent = "app.kubernetes.io/component"
	LabelKeyKubernetesVersion   = "app.kubernetes.io/version"

	// Github labels
	LabelKeyGitHubScaleSetName      = "actions.github.com/scale-set-name"
	LabelKeyGitHubScaleSetNamespace = "actions.github.com/scale-set-namespace"
	LabelKeyGitHubEnterprise        = "actions.github.com/enterprise"
	LabelKeyGitHubOrganization      = "actions.github.com/organization"
	LabelKeyGitHubRepository        = "actions.github.com/repository"
)

Labels applied to resources

View Source
const (
	AnnotationKeyManagerRoleBindingName           = "actions.github.com/cleanup-manager-role-binding"
	AnnotationKeyManagerRoleName                  = "actions.github.com/cleanup-manager-role-name"
	AnnotationKeyKubernetesModeRoleName           = "actions.github.com/cleanup-kubernetes-mode-role-name"
	AnnotationKeyKubernetesModeRoleBindingName    = "actions.github.com/cleanup-kubernetes-mode-role-binding-name"
	AnnotationKeyKubernetesModeServiceAccountName = "actions.github.com/cleanup-kubernetes-mode-service-account-name"
	AnnotationKeyGitHubSecretName                 = "actions.github.com/cleanup-github-secret-name"
	AnnotationKeyNoPermissionServiceAccountName   = "actions.github.com/cleanup-no-permission-service-account-name"
)

Annotations applied for later cleanup of resources

View Source
const AnnotationKeyGitHubRunnerGroupName = "actions.github.com/runner-group-name"
View Source
const AutoscalingRunnerSetCleanupFinalizerName = "actions.github.com/cleanup-protection"

Finalizer used to protect resources from deletion while AutoscalingRunnerSet is running

View Source
const DefaultScaleSetListenerImagePullPolicy = corev1.PullIfNotPresent

DefaultScaleSetListenerImagePullPolicy is the default pull policy applied to the listener when ImagePullPolicy is not specified

View Source
const DefaultScaleSetListenerLogFormat = string(logging.LogFormatText)

DefaultScaleSetListenerLogFormat is the default log format applied

View Source
const DefaultScaleSetListenerLogLevel = string(logging.LogLevelDebug)

DefaultScaleSetListenerLogLevel is the default log level applied

View Source
const (
	// EphemeralRunnerContainerName is the name of the runner container.
	// It represents the name of the container running the self-hosted runner image.
	EphemeralRunnerContainerName = "runner"
)

Variables

This section is empty.

Functions

func FilterLabels

func FilterLabels(labels map[string]string, filter string) map[string]string

func RandStringRunes

func RandStringRunes(n int) string

func SetListenerImagePullPolicy added in v0.27.3

func SetListenerImagePullPolicy(pullPolicy string) bool

func SetListenerLoggingParameters added in v0.27.5

func SetListenerLoggingParameters(level string, format string) bool

Types

type AutoscalingListenerReconciler

type AutoscalingListenerReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
	// ListenerMetricsAddr is address that the metrics endpoint binds to.
	// If it is set to "0", the metrics server is not started.
	ListenerMetricsAddr     string
	ListenerMetricsEndpoint string
	// contains filtered or unexported fields
}

AutoscalingListenerReconciler reconciles a AutoscalingListener object

func (*AutoscalingListenerReconciler) Reconcile

Reconcile a AutoscalingListener resource to meet its desired spec.

func (*AutoscalingListenerReconciler) SetupWithManager

func (r *AutoscalingListenerReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type AutoscalingRunnerSetReconciler

type AutoscalingRunnerSetReconciler struct {
	client.Client
	Log                                           logr.Logger
	Scheme                                        *runtime.Scheme
	ControllerNamespace                           string
	DefaultRunnerScaleSetListenerImage            string
	DefaultRunnerScaleSetListenerImagePullSecrets []string
	UpdateStrategy                                UpdateStrategy
	ActionsClient                                 actions.MultiClient
	// contains filtered or unexported fields
}

AutoscalingRunnerSetReconciler reconciles a AutoscalingRunnerSet object

func (*AutoscalingRunnerSetReconciler) Reconcile

Reconcile a AutoscalingRunnerSet resource to meet its desired spec.

func (*AutoscalingRunnerSetReconciler) SetupWithManager

func (r *AutoscalingRunnerSetReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type EphemeralRunnerReconciler

type EphemeralRunnerReconciler struct {
	client.Client
	Log           logr.Logger
	Scheme        *runtime.Scheme
	ActionsClient actions.MultiClient
	// contains filtered or unexported fields
}

EphemeralRunnerReconciler reconciles a EphemeralRunner object

func (*EphemeralRunnerReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.6.4/pkg/reconcile

func (*EphemeralRunnerReconciler) SetupWithManager

func (r *EphemeralRunnerReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type EphemeralRunnerSetReconciler

type EphemeralRunnerSetReconciler struct {
	client.Client
	Log           logr.Logger
	Scheme        *runtime.Scheme
	ActionsClient actions.MultiClient

	PublishMetrics bool
	// contains filtered or unexported fields
}

EphemeralRunnerSetReconciler reconciles a EphemeralRunnerSet object

func (*EphemeralRunnerSetReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

The responsibility of this controller is to bring the state to the desired one, but it should avoid patching itself, because of the frequent patches that the listener is doing. The safe point where we can patch the resource is when we are reacting on finalizer. Then, the listener should be deleted first, to allow controller clean up resources without interruptions

The resource should be created with finalizer. To leave it to this controller to add it, we would risk the same issue of patching the status. Responsibility of this controller should only be to bring the count of EphemeralRunners to the desired one, not to patch this resource until it is safe to do so

func (*EphemeralRunnerSetReconciler) SetupWithManager

func (r *EphemeralRunnerSetReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type EphemeralRunnerSets

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

NOTE: if this is logic should be used for other resources, consider using generics

type UpdateStrategy added in v0.27.5

type UpdateStrategy string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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