bucket

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package bucket provides helper functions for Autoscaler buckets. The buckets are used in Leader Election to support multiple Autoscaler pods.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoscalerBucketName

func AutoscalerBucketName(ordinal, total uint32) string

AutoscalerBucketName returns the name of the Autoscaler bucket with given `ordinal` and `total` bucket count.

func AutoscalerBucketSet

func AutoscalerBucketSet(total uint32) *hash.BucketSet

AutoscalerBucketSet returns a hash.BucketSet consisting of Autoscaler buckets with the given `total` count.

func ExtractPodNameAndIP

func ExtractPodNameAndIP(id string) (string, string, error)

ExtractPodNameAndIP extracts the pod name and IP from the given Lease holder identity.

func Identity

func Identity() (string, error)

Identity returns an identity for this Autoscaler pod used as the Lease holder identity. It's in the format of <POD-NAME>_<POD-IP> whose information is ready from environment variables.

func IsBucketHost

func IsBucketHost(host string) bool

IsBucketHost returns true if the given host is a host of a K8S Service of a bucket.

func PodIP

func PodIP() (string, error)

PodIP returns the IP address of the current pod, or an error if it wasn't properly projected.

Types

This section is empty.

Jump to

Keyboard shortcuts

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