ray

package
v0.1.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HeadServiceName

func HeadServiceName(name string) string

HeadServiceName returns the name of the service that points to the ray head pod.

func HorizontalPodAutoscalerObjectMeta

func HorizontalPodAutoscalerObjectMeta(rc *dcv1alpha1.RayCluster) metav1.ObjectMeta

HorizontalPodAutoscalerObjectMeta returns the ObjectMeta object used to identify new HPA objects.

func InstanceObjectName

func InstanceObjectName(instance string, comp Component) string

InstanceObjectName returns the name that will be used to create most owned cluster resources.

func MetadataLabels

func MetadataLabels(rc *dcv1alpha1.RayCluster) map[string]string

MetadataLabels returns standard metadata for ray resources.

func MetadataLabelsWithComponent

func MetadataLabelsWithComponent(rc *dcv1alpha1.RayCluster, comp Component) map[string]string

MetadataLabelsWithComponent returns standard component metadata for ray resources.

func NewClusterNetworkPolicy

func NewClusterNetworkPolicy(rc *dcv1alpha1.RayCluster) *networkingv1.NetworkPolicy

NewClusterNetworkPolicy generates a network policy that allows all nodes within a single cluster to communicate on all ports.

func NewDeployment

func NewDeployment(rc *dcv1alpha1.RayCluster, comp Component) (*appsv1.Deployment, error)

NewDeployment generates a Deployment configured to manage Ray cluster nodes. The configuration is based the provided spec and the desired Component workload.

func NewHeadNetworkPolicy

func NewHeadNetworkPolicy(rc *dcv1alpha1.RayCluster) *networkingv1.NetworkPolicy

NewHeadNetworkPolicy generates a network policy that allows client/dashboard port access to any pods that have been appointed with the ClientAccessLabels.

func NewHeadService

func NewHeadService(rc *dcv1alpha1.RayCluster) *corev1.Service

NewHeadService creates a ClusterIP service that points to the head node. Dashboard port is exposed when enabled.

func NewHorizontalPodAutoscaler

func NewHorizontalPodAutoscaler(rc *dcv1alpha1.RayCluster) (*autoscalingv2beta2.HorizontalPodAutoscaler, error)

NewHorizontalPodAutoscaler generates an HPA that targets a RayCluster resource.

The metrics-server needs to be launched separately and the worker deployment requires cpu resource requests in order for this object to have any effect.

func NewPodSecurityPolicyRBAC

func NewPodSecurityPolicyRBAC(rc *dcv1alpha1.RayCluster) (*rbacv1.Role, *rbacv1.RoleBinding)

NewPodSecurityPolicyRBAC generates the role and role binding required to use a pod security policy. The role is bound to the service account used by the ray cluster pods.

func NewServiceAccount

func NewServiceAccount(rc *dcv1alpha1.RayCluster) *corev1.ServiceAccount

NewServiceAccount generates a service account resource without API access.

func SelectorLabels

func SelectorLabels(rc *dcv1alpha1.RayCluster) map[string]string

SelectorLabels returns a resource selector clause for ray resources.

func SelectorLabelsWithComponent

func SelectorLabelsWithComponent(rc *dcv1alpha1.RayCluster, comp Component) map[string]string

SelectorLabelsWithComponent returns a resource component selector clause for ray resources.

Types

type Component

type Component string

Component is used to drive Kubernetes object generation for different ray types.

const (
	// ComponentNone indicates a generic ray resource.
	ComponentNone Component = "none"
	// ComponentHead indicates a ray head resource.
	ComponentHead Component = "head"
	// ComponentWorker indicates a ray worker resource.
	ComponentWorker Component = "worker"
	// ApplicationName defines the static name used to generate ray object metadata.
	ApplicationName = "ray"
)

Jump to

Keyboard shortcuts

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