utils

package
v0.0.0-...-910823d Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCoordinatorInformerFactory

func BuildCoordinatorInformerFactory(kubeClient kubernetes.Interface) informers.SharedInformerFactory

BuildCoordinatorInformerFactory builds informer factory for objects related to coordinators.

func BuildRSSWithDefaultValue

func BuildRSSWithDefaultValue() *unifflev1alpha1.RemoteShuffleService

BuildRSSWithDefaultValue builds a rss object with required or default values for testing.

func BuildShuffleServerInformerFactory

func BuildShuffleServerInformerFactory(kubeClient kubernetes.Interface) informers.SharedInformerFactory

BuildShuffleServerInformerFactory builds an informer factory for shuffle servers.

func BuildShuffleServerKey

func BuildShuffleServerKey(pod *corev1.Pod) string

BuildShuffleServerKey returns shuffler server key used in rss object's status.

func ConvertShuffleServerKeysToNodes

func ConvertShuffleServerKeysToNodes(keys sets.String) sets.String

ConvertShuffleServerKeysToNodes converts shuffle server keys to nodes.

func GenerateCoordinatorName

func GenerateCoordinatorName(rss *unifflev1alpha1.RemoteShuffleService) string

GenerateCoordinatorName returns service account or configMap name of coordinators.

func GenerateShuffleServerLabels

func GenerateShuffleServerLabels(rss *unifflev1alpha1.RemoteShuffleService) map[string]string

GenerateShuffleServerLabels returns labels used by statefulSets or pods of shuffle servers.

func GenerateShuffleServerName

func GenerateShuffleServerName(rss *unifflev1alpha1.RemoteShuffleService) string

GenerateShuffleServerName returns workload or nodePort service name of shuffle servers.

func GetCurrentNamespace

func GetCurrentNamespace() string

GetCurrentNamespace returns current namespace.

func GetExcludeNodesConfigMapKey

func GetExcludeNodesConfigMapKey(rss *unifflev1alpha1.RemoteShuffleService) string

GetExcludeNodesConfigMapKey returns configMap key of excluded nodes.

func GetExcludeNodesMountPath

func GetExcludeNodesMountPath(rss *unifflev1alpha1.RemoteShuffleService) string

GetExcludeNodesMountPath returns excluded nodes file's directory which is used as configMap volume mouth path.

func GetMetricsServerPort

func GetMetricsServerPort(pod *corev1.Pod) string

GetMetricsServerPort returns metrics server port by pod.

func GetRevisionFromPod

func GetRevisionFromPod(pod *corev1.Pod) string

GetRevisionFromPod returns revision of the pod belongs to a statefulSet.

func GetRssNameByPod

func GetRssNameByPod(pod *corev1.Pod) string

GetRssNameByPod returns rss object name from a pod.

func GetShuffleServerNode

func GetShuffleServerNode(pod *corev1.Pod) string

GetShuffleServerNode returns shuffle server node name by pod.

func GetShuffleServerPort

func GetShuffleServerPort(pod *corev1.Pod) string

GetShuffleServerPort returns shuffle server port by pod.

func GetSortedList

func GetSortedList(values sets.String) []string

GetSortedList returns sorted slice.

func ParseShuffleServerKey

func ParseShuffleServerKey(key string) (revision, podName, node string)

ParseShuffleServerKey parses shuffler server key used in rss object's status.

func SetUpCaCert

func SetUpCaCert(commonName string, pemCAKey []byte) ([]byte, error)

SetUpCaCert sets up a new ca certification.

func SetUpCaKey

func SetUpCaKey() ([]byte, error)

SetUpCaKey sets up a new ca private key

func SetUpSignedCertAndKey

func SetUpSignedCertAndKey(domains []string, ips []net.IP, commonName string,
	pemCAKey, pemCACert []byte, usage []x509.ExtKeyUsage) (
	[]byte, []byte, error)

SetUpSignedCertAndKey uses the ca certificate and ca private key to generate certificates.

func SetupServerCert

func SetupServerCert(domain, commonName string) ([]byte, []byte, []byte, error)

SetupServerCert sets up the server certificate and private key.

func UniqueName

func UniqueName(object metav1.Object) string

UniqueName returns unique name of an object.

func UpdateSecret

func UpdateSecret(kubeClient kubernetes.Interface, namespace, secretName string,
	updateFunc func(secret *corev1.Secret)) error

UpdateSecret updates Secret and retries when conflicts are encountered.

Types

type GenericConfig

type GenericConfig struct {
	KubeConfig string
	RESTConfig *rest.Config
	KubeClient kubernetes.Interface
	RSSClient  versioned.Interface
	RunCtx     context.Context
}

GenericConfig stores the basic configuration of admission webhook server.

func (*GenericConfig) AddFlags

func (c *GenericConfig) AddFlags()

AddFlags adds all configurations to the global flags.

func (*GenericConfig) Complete

func (c *GenericConfig) Complete()

Complete is called before the component runs.

Jump to

Keyboard shortcuts

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