...

Package features

import "k8s.io/kubernetes/cmd/kubeadm/app/features"
Overview
Index

Overview ▾

Constants

const (
    // PublicKeysECDSA is expected to be alpha in v1.19
    PublicKeysECDSA = "PublicKeysECDSA"
    // RootlessControlPlane is expected to be in alpha in v1.22
    RootlessControlPlane = "RootlessControlPlane"
    // EtcdLearnerMode is expected to be in alpha in v1.27, beta in v1.29
    EtcdLearnerMode = "EtcdLearnerMode"
    // UpgradeAddonsBeforeControlPlane is expected to be in deprecated in v1.28 and will be removed in future release
    UpgradeAddonsBeforeControlPlane = "UpgradeAddonsBeforeControlPlane"
    // WaitForAllControlPlaneComponents is expected to be alpha in v1.30
    WaitForAllControlPlaneComponents = "WaitForAllControlPlaneComponents"
)

Variables

InitFeatureGates are the default feature gates for the init command

var InitFeatureGates = FeatureList{
    PublicKeysECDSA: {
        FeatureSpec: featuregate.FeatureSpec{Default: false, PreRelease: featuregate.Deprecated},
        DeprecationMessage: "The PublicKeysECDSA feature gate is deprecated and will be removed when v1beta3 is removed." +
            " v1beta4 supports a new option 'ClusterConfiguration.EncryptionAlgorithm'.",
    },
    RootlessControlPlane: {FeatureSpec: featuregate.FeatureSpec{Default: false, PreRelease: featuregate.Alpha}},
    EtcdLearnerMode:      {FeatureSpec: featuregate.FeatureSpec{Default: true, PreRelease: featuregate.Beta}},
    UpgradeAddonsBeforeControlPlane: {
        FeatureSpec:        featuregate.FeatureSpec{Default: false, PreRelease: featuregate.Deprecated},
        DeprecationMessage: "The UpgradeAddonsBeforeControlPlane feature gate is deprecated and will be removed in a future release.",
    },
    WaitForAllControlPlaneComponents: {FeatureSpec: featuregate.FeatureSpec{Default: false, PreRelease: featuregate.Alpha}},
}

func CheckDeprecatedFlags

func CheckDeprecatedFlags(f *FeatureList, features map[string]bool) map[string]string

CheckDeprecatedFlags takes a list of existing feature gate flags and validates against the current feature flag set. It used during upgrades for ensuring consistency of feature gates used in an existing cluster, that might be created with a previous version of kubeadm, with the set of features currently supported by kubeadm

func Enabled

func Enabled(featureList map[string]bool, featureName string) bool

Enabled indicates whether a feature name has been enabled

func KnownFeatures

func KnownFeatures(f *FeatureList) []string

KnownFeatures returns a slice of strings describing the FeatureList features.

func NewFeatureGate

func NewFeatureGate(f *FeatureList, value string) (map[string]bool, error)

NewFeatureGate parses a string of the form "key1=value1,key2=value2,..." into a map[string]bool of known keys or returns an error.

func Supports

func Supports(featureList FeatureList, featureName string) bool

Supports indicates whether a feature name is supported on the given feature set

func ValidateVersion

func ValidateVersion(allFeatures FeatureList, requestedFeatures map[string]bool, requestedVersion string) error

ValidateVersion ensures that a feature gate list is compatible with the chosen Kubernetes version

type Feature

Feature represents a feature being gated

type Feature struct {
    featuregate.FeatureSpec
    MinimumVersion     *version.Version
    HiddenInHelpText   bool
    DeprecationMessage string
}

type FeatureList

FeatureList represents a list of feature gates

type FeatureList map[string]Feature