Documentation
¶
Index ¶
- Constants
- Variables
- type PortAllocator
- func (s *PortAllocator) AssignClusterLevelHostPort(podName string) (int, error)
- func (s *PortAllocator) AssignHostPort(nodeName string) (int, error)
- func (s *PortAllocator) GetLeaderIP() string
- func (s *PortAllocator) ReleaseClusterLevelHostPort(podName string, port int, immediateRelease bool) error
- func (s *PortAllocator) ReleaseHostPort(nodeName string, podName string, port int, immediateRelease bool) error
- func (s *PortAllocator) SetupWithManager(ctx context.Context, mgr manager.Manager) <-chan struct{}
Constants ¶
View Source
const RELEASE_PORT_RETRY_INTERVAL = 10 * time.Second
Variables ¶
View Source
var RETRY_CONFIG = wait.Backoff{ Steps: 100, Duration: RELEASE_PORT_RETRY_INTERVAL, Factor: 1.1, Jitter: 0.1, }
Functions ¶
This section is empty.
Types ¶
type PortAllocator ¶
type PortAllocator struct { PortRangeStartNode int PortRangeEndNode int PortRangeStartCluster int PortRangeEndCluster int IsLeader bool BitmapPerNode map[string][]uint64 BitmapCluster []uint64 Client client.Client // contains filtered or unexported fields }
Offer API for host port allocation, range from user configured port range Use label: `tensor-fusion.ai/host-port: auto` to assigned port at cluster level vGPU worker's hostPort will be managed by operator
func NewPortAllocator ¶
func (*PortAllocator) AssignClusterLevelHostPort ¶
func (s *PortAllocator) AssignClusterLevelHostPort(podName string) (int, error)
func (*PortAllocator) AssignHostPort ¶
func (s *PortAllocator) AssignHostPort(nodeName string) (int, error)
AssignHostPort always called by operator itself, thus no Leader-Follower inconsistency issue
func (*PortAllocator) GetLeaderIP ¶
func (s *PortAllocator) GetLeaderIP() string
func (*PortAllocator) ReleaseClusterLevelHostPort ¶
func (s *PortAllocator) ReleaseClusterLevelHostPort(podName string, port int, immediateRelease bool) error
func (*PortAllocator) ReleaseHostPort ¶
func (*PortAllocator) SetupWithManager ¶
func (s *PortAllocator) SetupWithManager(ctx context.Context, mgr manager.Manager) <-chan struct{}
Click to show internal directories.
Click to hide internal directories.