sts

package
v0.0.0-...-9b96d08 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvPodName and EnvPodIP are injected as env var into the ZK pod at runtime,
	// to be referenced in ZK configuration file
	EnvPodName = "POD_NAME"
	EnvPodIP   = "POD_IP"
)
View Source
const (
	// prepareFilesystemContainerName is the name of the container that prepares the filesystem
	PrepareFilesystemContainerName = "zookeeper-internal-init-filesystem"
)

Variables

View Source
var (
	// PodDownwardEnvVars inject the runtime Pod Name and IP as environment variables.
	PodDownwardEnvVars = []corev1.EnvVar{
		{Name: EnvPodIP, Value: "", ValueFrom: &corev1.EnvVarSource{
			FieldRef: &corev1.ObjectFieldSelector{APIVersion: "v1", FieldPath: "status.podIP"},
		}},
		{Name: EnvPodName, Value: "", ValueFrom: &corev1.EnvVarSource{
			FieldRef: &corev1.ObjectFieldSelector{APIVersion: "v1", FieldPath: "metadata.name"},
		}},
	}
)

Functions

func BuildDefaultVolumes

func BuildDefaultVolumes() []corev1.VolumeMount

func GenJvmHeapSize

func GenJvmHeapSize(mem string) (string, string)

生成jvm大小,如果小于1G,默认1G

func GetDataVolume

func GetDataVolume(rf *cachev1alpha1.Workload) *corev1.Volume

func GetExporterImage

func GetExporterImage(rf *cachev1alpha1.Workload) string

func GetStatefulSet

func GetStatefulSet(c k8s.Client, w *cachev1alpha1.Workload, label map[string]string, scheme *runtime.Scheme,
) (*appsv1.StatefulSet, *appsv1.StatefulSet, error)

func InitContainerVolumeMount

func InitContainerVolumeMount(v cm.SharedVolume) corev1.VolumeMount

func InitContainerVolumeMounts

func InitContainerVolumeMounts(v cm.SharedVolumeArray) []corev1.VolumeMount

func IsUpgradeStsResource

func IsUpgradeStsResource(expectSts *appsv1.StatefulSet, actualSts *appsv1.StatefulSet) bool

func NewPrepareFSInitContainer

func NewPrepareFSInitContainer(imageName string) (corev1.Container, error)

func NewStatefulSet

func NewStatefulSet(name, namespace string) *appsv1.StatefulSet

NewStatefulSet returns a StatefulSet object configured for a name

func PodAffinity

func PodAffinity(af *cachev1alpha1.PodAffinity, labels map[string]string) *corev1.Affinity

PodAffinity returns podAffinity options for the pod

Types

type STS

type STS struct {
	Workload *cachev1alpha1.Workload
	Labels   map[string]string
}

func NewSTS

func NewSTS(workload *cachev1alpha1.Workload, labels map[string]string) *STS

func (*STS) CreateAgentContainer

func (r *STS) CreateAgentContainer(vm corev1.VolumeMount) corev1.Container

func (*STS) CreateExporterContainer

func (r *STS) CreateExporterContainer(rf *cachev1alpha1.Workload) corev1.Container

func (*STS) GenerateStatefulset

func (s *STS) GenerateStatefulset() (*appsv1.StatefulSet, error)

Jump to

Keyboard shortcuts

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