Documentation ¶
Index ¶
- Constants
- Variables
- func AddLabelsToNode(ctx context.Context, client crclient.Client, node *corev1.Node, ...) error
- func AdminKubeConfigPath(dc provisioningv1.DPUCluster) string
- func ComputeMD5(filePath string) (string, error)
- func DPUCondition(condType provisioningv1.DPUConditionType, reason, message string) *metav1.Condition
- func DeleteObject(client crclient.Client, obj crclient.Object) error
- func GenerateBFBCFGFilePath(filename string) string
- func GenerateBFBFilePath(filename string) string
- func GenerateBFBTMPFilePath(uid string) string
- func GenerateBFBTaskName(bfb provisioningv1.BFB) string
- func GenerateBFBVersionFromURL(bfbURL string) string
- func GenerateBFCFGFileName(dpuName string) string
- func GenerateCACertName(dpuNamespace string) string
- func GenerateCASecretName(dpuNamespace string) string
- func GenerateDMSPodName(dpuName string) string
- func GenerateDMSServerCertName(dpuName string) string
- func GenerateDMSServerSecretName(dpuName string) string
- func GenerateHostnetworkPodName(dpuName string) string
- func GenerateNodeName(dpu *provisioningv1.DPU) string
- func GeneratePodToleration(nodeEffect provisioningv1.NodeEffect) []corev1.Toleration
- func GetClientset(ctx context.Context, client crclient.Client, dc *provisioningv1.DPUCluster) (*kubernetes.Clientset, []byte, error)
- func GetDPUCondition(status *provisioningv1.DPUStatus, conditionType string) (int, *metav1.Condition)
- func GetNamespacedName(obj metav1.Object) types.NamespacedName
- func GetObjects(client crclient.Client, objects []crclient.Object) (existObjects []crclient.Object, err error)
- func GetPCIAddrFromLabel(labels map[string]string, removePrefix bool) (string, error)
- func IsClusterCreated(conditions []metav1.Condition) bool
- func IsNodeReady(node *corev1.Node) bool
- func NeedUpdateLabels(label1 map[string]string, label2 map[string]string) bool
- func NewCondition(condType string, err error, reason, message string) *metav1.Condition
- func RemoteExec(ns, name, container, cmd string) (string, string, error)
- func ReplaceDaemonSetPodNodeNameNodeAffinity(affinity *corev1.Affinity, nodename string) *corev1.Affinity
- func SetDPUCondition(status *provisioningv1.DPUStatus, condition *metav1.Condition) bool
Constants ¶
const ( // RequeueInterval is the interval to requeue the request. RequeueInterval = 5 * time.Second // CFGExtension is the extension of the BFB configuration file. CFGExtension = ".cfg" // DPUSetNameLabel is the label that indicates the name of the DPUSet. DPUSetNameLabel = "provisioning.dpu.nvidia.com/dpuset-name" // DPUSetNamespaceLabel is the label that indicates the namespace of the DPUSet. DPUSetNamespaceLabel = "provisioning.dpu.nvidia.com/dpuset-namespace" // DPUPCIAddress is the label that indicates the PCI address of the DPU. DPUPCIAddress = "dpu-%d-pci-address" // DPUPFName is the label that indicates the PF name of the DPU. DPUPFName = "dpu-%d-pf0-name" // DPUPCIAddressLabel is the label that indicates the PCI address of the DPU. DPUPCIAddressLabel = "provisioning.dpu.nvidia.com/dpu-pciAddress" // DPUPFNameLabel is the label that indicates the PF name of the DPU. DPUPFNameLabel = "provisioning.dpu.nvidia.com/dpu-pf-name" // DPUHostIPLabel is the label that indicates the host IP of the DPU. DPUHostIPLabel = "provisioning.dpu.nvidia.com/dpu-host-ip" // TolerationNotReadyKey is the key for the NotReady taint. TolerationNotReadyKey = "node.kubernetes.io/not-ready" // TolerationUnreachableyKey is the key for the Unreachable taint. TolerationUnreachableyKey = "node.kubernetes.io/unreachable" // TolerationUnschedulableKey is the key for the Unschedulable taint. TolerationUnschedulableKey = "node.kubernetes.io/unschedulable" // DPUOOBBridgeConfiguredLabel is the label that indicates that the DPU OOB bridge is configured. DPUOOBBridgeConfiguredLabel = "dpu-oob-bridge-configured" // NodeFeatureDiscoveryLabelPrefix is the prefix for all NodeFeatureDiscovery labels. NodeFeatureDiscoveryLabelPrefix = "feature.node.kubernetes.io/" // NodeMaintenanceRequestorID is the requestor ID used for NodeMaintenance CRs NodeMaintenanceRequestorID = "dpu.nvidia.com" // ProvisioningGroupName is the provisioning group, used to identify provisioning as // additional Requestors in NodeMaintenance CR. ProvisioningGroupName = "provisioning.dpu.nvidia.com" )
Variables ¶
var (
// Location of BFB binary files
BFBBaseDir = "bfb"
)
Functions ¶
func AddLabelsToNode ¶
func AdminKubeConfigPath ¶
func AdminKubeConfigPath(dc provisioningv1.DPUCluster) string
func ComputeMD5 ¶
func DPUCondition ¶
func DPUCondition(condType provisioningv1.DPUConditionType, reason, message string) *metav1.Condition
func GenerateBFBCFGFilePath ¶
func GenerateBFBFilePath ¶
func GenerateBFBTMPFilePath ¶
func GenerateBFBTaskName ¶
func GenerateBFBTaskName(bfb provisioningv1.BFB) string
func GenerateBFCFGFileName ¶
func GenerateCACertName ¶
func GenerateCASecretName ¶
func GenerateDMSPodName ¶
func GenerateNodeName ¶
func GenerateNodeName(dpu *provisioningv1.DPU) string
func GeneratePodToleration ¶
func GeneratePodToleration(nodeEffect provisioningv1.NodeEffect) []corev1.Toleration
func GetClientset ¶
func GetClientset(ctx context.Context, client crclient.Client, dc *provisioningv1.DPUCluster) (*kubernetes.Clientset, []byte, error)
func GetDPUCondition ¶
func GetNamespacedName ¶
func GetNamespacedName(obj metav1.Object) types.NamespacedName
func GetObjects ¶
func GetPCIAddrFromLabel ¶
func IsClusterCreated ¶
func IsNodeReady ¶
func NeedUpdateLabels ¶
NeedUpdateLabels compares two labels. If label 2 does not contain all the key-value pairs of label 1, then return true. otherwise return false
func NewCondition ¶
NewCondition creates a new metav1.Condition with the given parameters. todo: merge with DPUCondition()
func ReplaceDaemonSetPodNodeNameNodeAffinity ¶
func ReplaceDaemonSetPodNodeNameNodeAffinity(affinity *corev1.Affinity, nodename string) *corev1.Affinity
ReplaceDaemonSetPodNodeNameNodeAffinity replaces the RequiredDuringSchedulingIgnoredDuringExecution NodeAffinity of the given affinity with a new NodeAffinity that selects the given nodeName. Note that this function assumes that no NodeAffinity conflicts with the selected nodeName.
This method is copied from https://github.com/kubernetes/kubernetes/blob/dbc2b0a5c7acc349ea71a14e49913661eaf708d2/pkg/controller/daemon/util/daemonset_util.go#L176
func SetDPUCondition ¶
func SetDPUCondition(status *provisioningv1.DPUStatus, condition *metav1.Condition) bool
Types ¶
This section is empty.