Documentation
¶
Index ¶
- Constants
- func ApplySetID(namespace string, component Component) string
- func ApplySetName(component Component) string
- func InventoryStringFromObjects(objs ...client.Object) string
- func ShouldSkipUpgradeCheck(componentName operatorv1.ComponentName, upgradeFromVersion string) (bool, error)
- type Component
- type DPFProvisioningVariables
- type Edits
- type GroupKindNamespaceName
- type HelmChartSource
- type Networking
- type NodeSRIOVDevicePluginControllerVariables
- type ObjectKind
- type OpenTelemetryCollectorVariables
- type SFCControllerVariables
- type StructuredEdit
- func ArgsForDaemonSetContainerEdit(containerName string, args []string) StructuredEdit
- func EnvForDaemonSetContainerEdit(containerName string, envs []corev1.EnvVar) StructuredEdit
- func ImageForDaemonSetContainerEdit(containerName, imageName string) StructuredEdit
- func ImageForDeploymentContainerEdit(containerName, imageName string) StructuredEdit
- func ImagePullSecretsEditForDaemonSetEdit(pullSecrets ...string) StructuredEdit
- func ImagePullSecretsEditForDeploymentEdit(pullSecrets ...string) StructuredEdit
- func NodeAffinityEdit(nodeAffinity *corev1.NodeAffinity) StructuredEdit
- func ReplicasEditForDeployment(replicas *int32) StructuredEdit
- func ResourcesEditForDaemonSet(containerName string, resources corev1.ResourceRequirements) StructuredEdit
- func ResourcesEditForDeployment(containerName string, resources corev1.ResourceRequirements) StructuredEdit
- func TolerationsEdit(tolerations []corev1.Toleration) StructuredEdit
- type StubComponent
- func (s StubComponent) GenerateManifests(_ context.Context, vars Variables) ([]client.Object, error)
- func (s StubComponent) IsReady(context.Context, client.Client, string) error
- func (s StubComponent) IsReadyForUpgrade(context.Context, client.Client, *operatorv1.DPFOperatorConfig) error
- func (s StubComponent) Name() operatorv1.ComponentName
- func (s StubComponent) Parse() error
- type SystemComponents
- type UnstructuredEdit
- type Variables
Constants ¶
const ( // ApplySetToolingAnnotation is the key of the label that indicates which tool is used to manage this ApplySet. // Tooling should refuse to mutate ApplySets belonging to other tools. // The value must be in the format <toolname>/<semver>. // Example value: "kubectl/v1.27" or "helm/v3" or "kpt/v1.0.0" ApplySetToolingAnnotation = "applyset.kubernetes.io/tooling" // ApplySetToolingAnnotationValue signals that the DPF Operator controls the ApplySet. // TODO: consider having this version be dynamically populated. ApplySetToolingAnnotationValue = "dpf-operator/v0" // ApplySetParentIDLabel is the key of the label that makes object an ApplySet parent object. // Its value MUST use the format specified in v1ApplySetIDFormat below ApplySetParentIDLabel = "applyset.kubernetes.io/id" // ApplySetInventoryAnnotationKey is the key of the label which holds the inventory of the ApplySet in a // sorted list of Group Kind + Namespace Name. ApplySetInventoryAnnotationKey = "applyset.kubernetes.io/inventory" )
Apply set implements the Kubernetes ApplySet spec to handle deletion of objects in the Kubernetes API. See https://github.com/kubernetes/enhancements/blob/master/keps/sig-cli/3659-kubectl-apply-prune/README.md kubectl's applyset file was used here as a reference implementation and some comments and code are directly copied from there. https://github.com/kubernetes/kubernetes/blob/ae945462fb2d12a4e38d074de8fe77267460624b/staging/src/k8s.io/kubectl/pkg/cmd/apply/applyset.go
const (
// DPFProvisioningControllerName is the helm value for the Provisioning Controllers component name.
DPFProvisioningControllerName = "dpf-provisioning-controller-manager"
)
const (
// DPUServiceControllerName is the helm value for the DPUService Controllers component name.
DPUServiceControllerName = "dpuservice-controller-manager"
)
Variables ¶
This section is empty.
Functions ¶
func ApplySetID ¶
ApplySetID is a unique ID for the ApplySet.
func ApplySetName ¶
ApplySetName returns the constant name for an ApplySet given a component.
func InventoryStringFromObjects ¶
InventoryStringFromObjects computes the applyset inventory annotation value from a slice of client.Object.
func ShouldSkipUpgradeCheck ¶
func ShouldSkipUpgradeCheck(componentName operatorv1.ComponentName, upgradeFromVersion string) (bool, error)
ShouldSkipUpgradeCheck determines if a component's upgrade readiness check should be skipped based on whether the component existed in the version being upgraded from.
Types ¶
type Component ¶
type Component interface {
// Name returns the name of the component.
Name() operatorv1.ComponentName
// Parse parses the component data into the relevant fields of the struct and performs some basic validations.
// Returns an error if the data is invalid or if the component cannot be parsed.
Parse() error
// GenerateManifests generates Kubernetes manifests for the component.
// The manifests are generated based on the provided variables.
// Returns a slice of client.Object which can be applied to the cluster.
// If the component is not ready for upgrade, it returns an error.
GenerateManifests(ctx context.Context, variables Variables) ([]client.Object, error)
// IsReadyForUpgrade reports an object and a field in that object which is used to check the ready status of a Component.
// The version contains the version of the DPF Operator that is being upgraded from.
// Returns an error if the object is not ready.
IsReadyForUpgrade(ctx context.Context, c client.Client, config *operatorv1.DPFOperatorConfig) error
// IsReady checks if the component is ready and its version is updated.
// It checks the readiness of the component in the given namespace.
// Returns an error if the component is not ready.
IsReady(ctx context.Context, c client.Client, namespace string) error
}
Component describes the responsibilities of an item in the Inventory.
type DPFProvisioningVariables ¶
type DPFProvisioningVariables struct {
BFBPersistentVolumeClaimName *string
DMSTimeout *int
BFCFGTemplateConfig *string
CustomCASecretName *string
InstallInterface *operatorv1.ProvisioningInstallInterface
MaxDPUParallelInstallations *int32
MultiDPUOperationsSyncWaitTime time.Duration
Registry *operatorv1.RegistryConfiguration
Replicas *int32
OSInstallTimeout *metav1.Duration
NodeEffectRemovalTimeout *metav1.Duration
HostAgentDNSPolicy *corev1.DNSPolicy
DeploymentMode operatorv1.DeploymentMode
}
type Edits ¶
type Edits struct {
// contains filtered or unexported fields
}
Edits facilitates editing kubernetes objects
func (*Edits) AddForAll ¶
func (e *Edits) AddForAll(edits ...UnstructuredEdit) *Edits
AddForAll addds UnstructuredEdits that will be called on all objects during Apply call
func (*Edits) AddForKind ¶
func (e *Edits) AddForKind(kind ObjectKind, edits ...UnstructuredEdit) *Edits
AddForKind adds UnstructuredEdits that will be called on all objects of the specified kind during Apply call
func (*Edits) AddForKindS ¶
func (e *Edits) AddForKindS(kind ObjectKind, edits ...StructuredEdit) *Edits
AddForKindS addds StructuredEdits that will be called on objects with the specified type during Apply call objects are converted to concrete type before calling UnstructuredEdit
func (*Edits) Apply ¶
func (e *Edits) Apply(objs []*unstructured.Unstructured) error
Apply applies in place Edits for objs, returns first error if occurred
type GroupKindNamespaceName ¶
GroupKindNamespaceName contains information required to uniquely identify an object as part of an ApplySet.
func ParseGroupKindNamespaceName ¶
func ParseGroupKindNamespaceName(s string) (GroupKindNamespaceName, error)
ParseGroupKindNamespaceName parses a string to a GroupKindNamespaceName.
func (GroupKindNamespaceName) String ¶
func (g GroupKindNamespaceName) String() string
String is the format for a GroupKindNamespaceName in the value for ApplySetInventoryAnnotationKey.
type HelmChartSource ¶
func ParseHelmChartString ¶
func ParseHelmChartString(repoChartVersion string) (*HelmChartSource, error)
type Networking ¶
type NodeSRIOVDevicePluginControllerVariables ¶
type NodeSRIOVDevicePluginControllerVariables struct {
// DevicePluginImage is the container image for the SRIOV device plugin.
DevicePluginImage string
// DevicePluginInitImage is the container image for the init container.
DevicePluginInitImage string
// DefaultResourcePrefix is the default resource prefix for device plugin resources.
DefaultResourcePrefix string
}
NodeSRIOVDevicePluginControllerVariables holds variables for the NodeSRIOVDevicePlugin controller.
type ObjectKind ¶
type ObjectKind string
ObjectKind represents different Kind of Kubernetes Objects
const ( NamespaceKind ObjectKind = "Namespace" CustomResourceDefinitionKind ObjectKind = "CustomResourceDefinition" ClusterRoleKind ObjectKind = "ClusterRole" RoleBindingKind ObjectKind = "RoleBinding" ClusterRoleBindingKind ObjectKind = "ClusterRoleBinding" MutatingWebhookConfigurationKind ObjectKind = "MutatingWebhookConfiguration" ValidatingWebhookConfigurationKind ObjectKind = "ValidatingWebhookConfiguration" DeploymentKind ObjectKind = "Deployment" StatefulSetKind ObjectKind = "StatefulSet" DaemonSetKind ObjectKind = "DaemonSet" CertificateKind ObjectKind = "Certificate" IssuerKind ObjectKind = "Issuer" RoleKind ObjectKind = "Role" ServiceAccountKind ObjectKind = "ServiceAccount" ServiceKind ObjectKind = "Service" DPUServiceKind ObjectKind = "DPUService" DaemonsetKind ObjectKind = "DaemonSet" )
func (ObjectKind) String ¶
func (o ObjectKind) String() string
type OpenTelemetryCollectorVariables ¶
type OpenTelemetryCollectorVariables struct {
LoggingEndpoint string
}
type SFCControllerVariables ¶
type StructuredEdit ¶
StructuredEdit edits Structured object in place, returns error if occurred
func ArgsForDaemonSetContainerEdit ¶
func ArgsForDaemonSetContainerEdit(containerName string, args []string) StructuredEdit
func EnvForDaemonSetContainerEdit ¶
func EnvForDaemonSetContainerEdit(containerName string, envs []corev1.EnvVar) StructuredEdit
EnvForDaemonSetContainerEdit adds or overrides env vars for a specific container
func ImageForDaemonSetContainerEdit ¶
func ImageForDaemonSetContainerEdit(containerName, imageName string) StructuredEdit
func ImageForDeploymentContainerEdit ¶
func ImageForDeploymentContainerEdit(containerName, imageName string) StructuredEdit
func ImagePullSecretsEditForDaemonSetEdit ¶
func ImagePullSecretsEditForDaemonSetEdit(pullSecrets ...string) StructuredEdit
ImagePullSecretsEditForDaemonSetEdit sets pullSecrets for DaemonSet object
func ImagePullSecretsEditForDeploymentEdit ¶
func ImagePullSecretsEditForDeploymentEdit(pullSecrets ...string) StructuredEdit
ImagePullSecretsEditForDeploymentEdit sets pullSecrets for Deployment object
func NodeAffinityEdit ¶
func NodeAffinityEdit(nodeAffinity *corev1.NodeAffinity) StructuredEdit
NodeAffinityEdit sets NodeAffinity for Deployment objs
func ReplicasEditForDeployment ¶
func ReplicasEditForDeployment(replicas *int32) StructuredEdit
ReplicasEditForDeployment sets the number of replicas for a Deployment
func ResourcesEditForDaemonSet ¶
func ResourcesEditForDaemonSet(containerName string, resources corev1.ResourceRequirements) StructuredEdit
ResourcesEditForDaemonSet sets resource requirements for a specific container in a DaemonSet
func ResourcesEditForDeployment ¶
func ResourcesEditForDeployment(containerName string, resources corev1.ResourceRequirements) StructuredEdit
ResourcesEditForDeployment sets resource requirements for a specific container in a Deployment
func TolerationsEdit ¶
func TolerationsEdit(tolerations []corev1.Toleration) StructuredEdit
TolerationsEdit sets Tolerations for Deployment objs
type StubComponent ¶
type StubComponent struct {
// contains filtered or unexported fields
}
StubComponent is a type for testing GenerateManifests and ApplySet behavior.
func StubComponentWithObjs ¶
func StubComponentWithObjs(name operatorv1.ComponentName, objs []*unstructured.Unstructured) StubComponent
func (StubComponent) GenerateManifests ¶
func (StubComponent) IsReadyForUpgrade ¶
func (s StubComponent) IsReadyForUpgrade(context.Context, client.Client, *operatorv1.DPFOperatorConfig) error
func (StubComponent) Name ¶
func (s StubComponent) Name() operatorv1.ComponentName
func (StubComponent) Parse ¶
func (s StubComponent) Parse() error
type SystemComponents ¶
type SystemComponents struct {
DPUService Component
DPFProvisioning Component
ServiceFunctionChainSet Component
Multus Component
SRIOVDevicePlugin Component
NVIPAM Component
OvsCni Component
Flannel Component
SfcController Component
KamajiClusterManager Component
StaticClusterManager Component
DPUDetector Component
CNIInstaller Component
NodeSRIOVDevicePluginController Component
KubeStateMetrics Component
NodeProblemDetector Component
OpenTelemetryCollector Component
}
SystemComponents holds kubernetes object manifests to be deployed by the operator.
func New ¶
func New() *SystemComponents
New returns a new SystemComponents inventory with data preloaded but parsing not completed.
func (*SystemComponents) AllComponents ¶
func (s *SystemComponents) AllComponents() []Component
AllComponents returns all Components deployed by the DPF Operator.
func (*SystemComponents) EnabledComponents ¶
func (s *SystemComponents) EnabledComponents(vars Variables) []Component
EnabledComponents returns the set of components which is not disabled.
func (*SystemComponents) ParseAll ¶
func (s *SystemComponents) ParseAll() error
ParseAll creates Kubernetes objects for all manifests related to the DPFOperator.
func (*SystemComponents) SystemDPUServices ¶
func (s *SystemComponents) SystemDPUServices() []Component
SystemDPUServices returns DPUService Components deployed by the DPF Operator.
type UnstructuredEdit ¶
type UnstructuredEdit func(un *unstructured.Unstructured) error
UnstructuredEdit edits Unstructured in place, returns error if occurred
func DPUServiceNADMTUEdit ¶
func DPUServiceNADMTUEdit(mtu int) UnstructuredEdit
DPUServiceNADMTUEdit sets the MTU for a given DPUServiceNAD
func LabelsEdit ¶
func LabelsEdit(labelsToAdd map[string]string) UnstructuredEdit
LabelsEdit adds the passed labels to the passed object. Labels passed here overwrite any existing label.
func NamespaceEdit ¶
func NamespaceEdit(namespace string) UnstructuredEdit
NamespaceEdit sets namespace for object
func OwnerReferenceEdit ¶
func OwnerReferenceEdit(owner metav1.Object, scheme *runtime.Scheme) UnstructuredEdit
OwnerReferenceEdit adds the given owner to the ownerReference list of the passed object
type Variables ¶
type Variables struct {
Namespace string
DPUCNIBinPath string
DPUCNIConfPath string
DPUOpenvSwitchRunPath string
DPUOpenvSwitchBinPath string
FlannelSkipCNIConfigInstallation bool
DisableDPUReadyTaints bool
FlannelPodCIDR string
DPUClusters []*dpucluster.Config
DPFProvisioningController DPFProvisioningVariables
SFCController SFCControllerVariables
NodeSRIOVDevicePluginController NodeSRIOVDevicePluginControllerVariables
OpenTelemetryCollector OpenTelemetryCollectorVariables
Networking Networking
DisableSystemComponents map[operatorv1.ComponentName]bool
ImagePullSecrets []string
Images map[string]string
HelmCharts map[operatorv1.ComponentName]string
KubernetesAPIServerVIP *string
KubernetesAPIServerPort *int
Resources map[string]corev1.ResourceRequirements
Replicas map[operatorv1.ComponentName]*int32
ArgoCDNamespace string
}
Variables contains information required to generate manifests from the inventory.
func VariablesFromDPFOperatorConfig ¶
func VariablesFromDPFOperatorConfig(defaults *release.Defaults, config *operatorv1.DPFOperatorConfig, dpuClusters []*dpucluster.Config) Variables
Source Files
¶
- applyset.go
- cluster_manager_manifests.go
- common.go
- component_versions.go
- dpu_detector_manifests.go
- dpu_provisioning_controller_manifests.go
- dpuservice_controller_manifests.go
- dpuservice_per_dpucluster_manifests.go
- edits.go
- edits_common.go
- from_dpu_service_manifests.go
- helm_paths_provider.go
- inventory.go
- nodesriovdeviceplugin_controller_manifests.go
- sfc_controller_manifests.go
- stub_manifests.go
- variables.go