bucket

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Apache-2.0 Imports: 6 Imported by: 4

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 added in v0.19.0

func AutoscalerBucketName(ordinal, total uint32) string

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

func AutoscalerBucketSet added in v0.19.0

func AutoscalerBucketSet(total uint32) *hash.BucketSet

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

func ExtractPodNameAndIP added in v0.19.0

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

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

func Identity added in v0.19.0

func Identity() (string, error)

Identity returns a identify 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 added in v0.20.0

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