cm

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: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigFileName        = "zoo.cfg"
	ConfigVolumeName      = "zookeeper-internal-config"
	ConfigVolumeMountPath = "/mnt/zookeeper/zookeeper-config"

	DynamicConfigFileVolumeName      = "zookeeper-internal-dynamic-config"
	DynamicConfigFileVolumeMountPath = "/mnt/zookeeper/dynamic-config"
	DynamicConfigFile                = "zoo_replicated1.cfg.dynamic"

	DataVolumeName = "zookeeper-data"
	DataMountPath  = "/data"

	LogsVolumeName = "zookeeper-logs"
	LogsMountPath  = "/logs"

	ScriptsVolumeName      = "zookeeper-internal-scripts"
	ScriptsVolumeMountPath = "/mnt/zookeeper/scripts"

	AgentVolumeName      = "zookeeper-agent-config"
	AgentVolumeMountPath = "/mnt/zookeeper/agent"
)
View Source
const (
	AgentConfigKey = "config.json"
)
View Source
const (
	PrepareFsScriptConfigKey = "prepare-fs.sh"
)

Variables

View Source
var (
	ConfigVolume = SharedVolume{
		Name:                   "zookeeper-internal-config-local",
		InitContainerMountPath: "/mnt/zookeeper/zookeeper-config-local",
		ContainerMountPath:     volume.ConfigVolumeMountPath,
	}

	PluginVolumes = SharedVolumeArray{
		Array: []SharedVolume{
			ConfigVolume,
		},
	}
)

Functions

func GenConfigMap

func GenConfigMap(listArray []*ZkConfigMap, namespace string, labels map[string]string) []*corev1.ConfigMap

func GenZkAgentConfig

func GenZkAgentConfig() string

func GenZkConfig

func GenZkConfig() string

func PodName

func PodName(ssetName string, ordinal int32) string

PodName returns the name of the pod with the given ordinal for this StatefulSet.

func RenderPrepareFsScript

func RenderPrepareFsScript() (string, error)

func RenderScriptTemplate

func RenderScriptTemplate(params TemplateParams) (string, error)

RenderScriptTemplate renders scriptTemplate using the given TemplateParams

Types

type CM

type CM struct {
	Workload  *cachev1alpha1.Workload
	Labels    map[string]string
	ExpectSts *appsv1.StatefulSet
	ActualSts *appsv1.StatefulSet
}

func NewCM

func NewCM(workload *cachev1alpha1.Workload, labels map[string]string, expectSTS, actualSTS *appsv1.StatefulSet) *CM

func (*CM) GenerateConfigMap

func (c *CM) GenerateConfigMap() ([]*corev1.ConfigMap, error)

type LinkedFile

type LinkedFile struct {
	Source string
	Target string
}

LinkedFile describes a symbolic link with source and target.

type LinkedFilesArray

type LinkedFilesArray struct {
	Array []LinkedFile
}

LinkedFilesArray contains all files to be linked in the init container.

type SharedVolume

type SharedVolume struct {
	Name                   string // Volume name
	InitContainerMountPath string // Mount path in the init container
	ContainerMountPath     string // Mount path in the zookeeper container
}

SharedVolume between the init container and the ZK container.

type SharedVolumeArray

type SharedVolumeArray struct {
	Array []SharedVolume
}

SharedVolumes represents a list of SharedVolume

func (SharedVolumeArray) Volumes

func (v SharedVolumeArray) Volumes() []corev1.Volume

type TemplateParams

type TemplateParams struct {
	// SharedVolumes are directories to persist in shared volumes
	PluginVolumes SharedVolumeArray
	// LinkedFiles are files to link individually
	LinkedFiles LinkedFilesArray
	// ChownToElasticsearch are paths that need to be chowned to the Elasticsearch user/group.
	ChownToZookeeper []string
}

TemplateParams are the parameters manipulated in the scriptTemplate

type ZkConfigMap

type ZkConfigMap struct {
	Data map[string]string `json:"data"`
	Name string            `json:"name"`
}

Jump to

Keyboard shortcuts

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