nodepool

package
v0.1.52 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 90 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EC2VolumeDefaultSize int64  = 16
	EC2VolumeDefaultType string = "gp3"

	// QualifiedNameMaxLength is the maximal name length allowed for k8s object
	// https://github.com/kubernetes/kubernetes/blob/957c9538670b5f7ead2c9ba9ceb9de081d66caa4/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L34
	QualifiedNameMaxLength = 63
)
View Source
const (
	PerformanceProfileConfigMapLabel                 = "hypershift.openshift.io/performanceprofile-config"
	NodeTuningGeneratedPerformanceProfileStatusLabel = "hypershift.openshift.io/nto-generated-performance-profile-status"
	ContainerRuntimeConfigConfigMapLabel             = "hypershift.openshift.io/containerruntimeconfig-config"
	KubeletConfigConfigMapLabel                      = "hypershift.openshift.io/kubeletconfig-config"

	// NTOMirroredConfigLabel added to objects that were mirrored from the node pool namespace into the HCP namespace
	NTOMirroredConfigLabel = "hypershift.openshift.io/mirrored-config"
)
View Source
const (
	TokenSecretTokenGenerationTime       = "hypershift.openshift.io/last-token-generation-time"
	TokenSecretReleaseKey                = "release"
	TokenSecretTokenKey                  = "token"
	TokenSecretPullSecretHashKey         = "pull-secret-hash"
	TokenSecretHCConfigurationHashKey    = "hc-configuration-hash"
	TokenSecretAdditionalTrustBundleKey  = "additional-trust-bundle-hash"
	TokenSecretConfigKey                 = "config"
	TokenSecretAnnotation                = "hypershift.openshift.io/ignition-config"
	TokenSecretIgnitionReachedAnnotation = "hypershift.openshift.io/ignition-reached"
	TokenSecretNodePoolUpgradeType       = "hypershift.openshift.io/node-pool-upgrade-type"
)
View Source
const TokenSecretPrefix = "token"
View Source
const UserDataSecrePrefix = "user-data"

Variables

This section is empty.

Functions

func FindStatusCondition

func FindStatusCondition(conditions []hyperv1.NodePoolCondition, conditionType string) *hyperv1.NodePoolCondition

FindStatusCondition finds the conditionType in conditions.

func GetHostedClusterByName

func GetHostedClusterByName(ctx context.Context, c client.Client, namespace, name string) (*hyperv1.HostedCluster, error)

GetHostedClusterByName finds and return a HostedCluster object using the specified params.

func IBMPowerVSImage

func IBMPowerVSImage(namespace, name string) *capipowervs.IBMPowerVSImage

func MachineDeploymentComplete

func MachineDeploymentComplete(deployment *capiv1.MachineDeployment) bool

MachineDeploymentComplete considers a MachineDeployment to be complete once all of its desired replicas are updated and available, and no old machines are running.

func MustAsset

func MustAsset(name string) string

func PerformanceProfileConfigMap added in v0.1.20

func PerformanceProfileConfigMap(namespace, name, nodePoolName string) *corev1.ConfigMap

func SetStatusCondition

func SetStatusCondition(conditions *[]hyperv1.NodePoolCondition, newCondition hyperv1.NodePoolCondition)

SetStatusCondition sets the corresponding condition in conditions to newCondition. conditions must be non-nil.

  1. if the condition of the specified type already exists (all fields of the existing condition are updated to newCondition, LastTransitionTime is set to now if the new status differs from the old status)
  2. if a condition of the specified type does not exist (LastTransitionTime is set to now() if unset, and newCondition is appended)

func TokenSecret

func TokenSecret(namespace, name, payloadInputHash string) *corev1.Secret

func TunedConfigMap added in v0.1.20

func TunedConfigMap(namespace, name string) *corev1.ConfigMap

Types

type CAPI added in v0.1.48

type CAPI struct {
	*Token
	// contains filtered or unexported fields
}

CAPI Knows how to reconcile all the CAPI resources for a unique token. TODO(alberto): consider stronger decoupling from Token by making it an interface and let nodepool, hostedcluster, and client be fields of CAPI / interface methods.

func (*CAPI) Pause added in v0.1.48

func (c *CAPI) Pause(ctx context.Context) error

func (*CAPI) Reconcile added in v0.1.48

func (c *CAPI) Reconcile(ctx context.Context) error

type CPOCapabilities

type CPOCapabilities struct {
	DecompressAndDecodeConfig     bool
	CreateDefaultAWSSecurityGroup bool
}

type ConfigGenerator added in v0.1.48

type ConfigGenerator struct {
	client.Client
	// contains filtered or unexported fields
}

ConfigGenerator knows how to: - Generate a unique hash id for any NodePool API input that requires a NodePool rollout. - Generate a compressed and encoded artefact of the mco RawConfig that can be stored in a Secret and consumed by mco/local-ignition-provider to generate the final ignition config served to Nodes.

func NewConfigGenerator added in v0.1.48

func NewConfigGenerator(ctx context.Context, client client.Client, hostedCluster *hyperv1.HostedCluster, nodePool *hyperv1.NodePool, releaseImage *releaseinfo.ReleaseImage, haproxyRawConfig string) (*ConfigGenerator, error)

NewConfigGenerator is the contract to create a new ConfigGenerator.

func (*ConfigGenerator) Compressed added in v0.1.48

func (cg *ConfigGenerator) Compressed() (*bytes.Buffer, error)

Compressed returns a gzipped artifact of the rawconfig. Prefer CompressedAndEncoded unless the CPO/your decompressor doesn't know how to handle base64 encoded data.

func (*ConfigGenerator) CompressedAndEncoded added in v0.1.48

func (cg *ConfigGenerator) CompressedAndEncoded() (*bytes.Buffer, error)

CompressedAndEncoded returns a gzipped and base-64 encodesd artefact of the raw config.

func (*ConfigGenerator) Hash added in v0.1.48

func (cg *ConfigGenerator) Hash() string

Hash returns a unique hash id for any NodePool API input that requires a NodePool rollout, i.e. the rolloutConfig struct. TODO(alberto): hash the struct directly instead of the string representation field by field. This is kept like this for now to contain the scope of the refactor and avoid backward compatibility issues.

func (*ConfigGenerator) HashWithoutVersion added in v0.1.48

func (cg *ConfigGenerator) HashWithoutVersion() string

HashWithOutVersion is like Hash but doesn't compute the release version. This is only used to signal if a rollout is driven by a new release or by something else. TODO(alberto): This was left unconsistent in https://github.com/openshift/hypershift/pull/3795/files. It should also contain cg.globalConfig. This is kept like this for now to contain the scope of the refactor and avoid backward compatibility issues.

func (*ConfigGenerator) Version added in v0.1.48

func (cg *ConfigGenerator) Version() string

type MirrorConfig added in v0.1.40

type MirrorConfig struct {
	*corev1.ConfigMap
	Labels map[string]string
}

MirrorConfig holds the information needed to mirror a config object to HCP namespace

func BuildMirrorConfigs added in v0.1.48

func BuildMirrorConfigs(ctx context.Context, cg *ConfigGenerator) ([]*MirrorConfig, error)

BuildMirrorConfigs returns a slice of MirrorConfigs for user configs that are supposed to be mirrored to the HCP namespace.

type MissingCoreConfigError added in v0.1.48

type MissingCoreConfigError struct {
	Expected int
	Got      int
}

func (*MissingCoreConfigError) Error added in v0.1.48

func (e *MissingCoreConfigError) Error() string

type NodePoolReconciler

type NodePoolReconciler struct {
	client.Client

	ReleaseProvider releaseinfo.Provider
	upsert.CreateOrUpdateProvider
	HypershiftOperatorImage string
	ImageMetadataProvider   supportutil.ImageMetadataProvider
	KubevirtInfraClients    kvinfra.KubevirtInfraClientMap
	// contains filtered or unexported fields
}

func (*NodePoolReconciler) Reconcile

func (r *NodePoolReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*NodePoolReconciler) SetPerformanceProfileConditions added in v0.1.43

func (r *NodePoolReconciler) SetPerformanceProfileConditions(ctx context.Context, logger logr.Logger, nodePool *hyperv1.NodePool, controlPlaneNamespace string, toDelete bool) error

SetPerformanceProfileConditions checks for performance profile status updates, and reflects them in the nodepool status conditions

func (*NodePoolReconciler) SetupWithManager

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

type NotReadyError

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

type Token added in v0.1.48

type Token struct {
	upsert.CreateOrUpdateProvider

	*ConfigGenerator
	// contains filtered or unexported fields
}

Token knows how to create an UUUID token for a unique configGenerator Hash. It also knows how to manage the lifecycle of a corresponding token secret that it is used by the tokenSecret controller to generate the final ignition payload and a user data secret that points to the ignition server URL using the UUUID as an authenticator header to get that payload.

func NewToken added in v0.1.48

func NewToken(ctx context.Context, configGenerator *ConfigGenerator, cpoCapabilities *CPOCapabilities) (*Token, error)

NewToken is the contract to create a new Token struct.

func (*Token) Reconcile added in v0.1.48

func (t *Token) Reconcile(ctx context.Context) error

func (*Token) TokenSecret added in v0.1.48

func (t *Token) TokenSecret() *corev1.Secret

func (*Token) UserDataSecret added in v0.1.48

func (t *Token) UserDataSecret() *corev1.Secret

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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