builder

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SuperuserPasswordPath = "superuser-passwd"
	TestStorageClassName  = "test-storage-class"
)
View Source
const (
	SvcTypeLabel              = "vertica.com/svc-type"
	SubclusterNameLabel       = "vertica.com/subcluster-name"
	SubclusterLegacyNameLabel = "vertica.com/subcluster"
	SubclusterTypeLabel       = "vertica.com/subcluster-type"
	SubclusterSvcNameLabel    = "vertica.com/subcluster-svc"
	SubclusterTransientLabel  = "vertica.com/subcluster-transient"

	// ClientRoutingLabel is a label that must exist on the pod in
	// order for Service objects to route to the pod.  This label isn't part of
	// the template in the StatefulSet.  This label is added after the pod is
	// scheduled.  There are a couple of uses for it:
	// - after an add node, we only add the labels once the node has at least
	// one shard subscription.  This saves routing to a pod that cannot fulfill
	// a query request.
	// - before we remove a node.  It allows us to drain out pods that are going
	// to be removed by a pending node removal.
	ClientRoutingLabel = "vertica.com/client-routing"
	ClientRoutingVal   = "true"

	VDBInstanceLabel     = "app.kubernetes.io/instance"
	OperatorVersionLabel = "app.kubernetes.io/version"
	ManagedByLabel       = "app.kubernetes.io/managed-by"
	OperatorName         = "verticadb-operator" // The name of the operator

	CurOperatorVersion = "1.8.0" // The version number of the operator
	OperatorVersion100 = "1.0.0"
	OperatorVersion110 = "1.1.0"
	OperatorVersion120 = "1.2.0"
	OperatorVersion130 = "1.3.0"
	OperatorVersion131 = "1.3.1"
	OperatorVersion140 = "1.4.0"
	OperatorVersion150 = "1.5.0"
	OperatorVersion160 = "1.6.0"
	OperatorVersion170 = "1.7.0"
	OperatorVersion180 = CurOperatorVersion

	// Annotations that we set in each of the pod.  These are set by the
	// AnnotateAndLabelPodReconciler.  They are available in the pod with the
	// downwardAPI so they can be picked up by the Vertica data collector (DC).
	KubernetesVersionAnnotation   = "kubernetes.io/version"   // Version of the k8s server
	KubernetesGitCommitAnnotation = "kubernetes.io/gitcommit" // Git commit of the k8s server
	KubernetesBuildDateAnnotation = "kubernetes.io/buildDate" // Build date of the k8s server
)
View Source
const (
	// The name of the key in the superuser password secret that holds the password
	SuperuserPasswordKey = "password"
)

Variables

This section is empty.

Functions

func BuildAzureAccountKeyCommunalCredSecret

func BuildAzureAccountKeyCommunalCredSecret(vdb *vapi.VerticaDB, accountName, accountKey string) *corev1.Secret

BuildAzureAccountKeyCommunalCredSecret builds a secret that is setup for Azure using an account key.

func BuildAzureSASCommunalCredSecret

func BuildAzureSASCommunalCredSecret(vdb *vapi.VerticaDB, blobEndpoint, sas string) *corev1.Secret

BuildAzureSASCommunalCredSecret builds a secret that is setup for Azure using shared access signature.

func BuildExtSvc

func BuildExtSvc(nm types.NamespacedName, vdb *vapi.VerticaDB, sc *vapi.Subcluster,
	selectorLabelCreator func(*vapi.VerticaDB, *vapi.Subcluster) map[string]string) *corev1.Service

BuildExtSvc creates desired spec for the external service.

func BuildHlSvc

func BuildHlSvc(nm types.NamespacedName, vdb *vapi.VerticaDB) *corev1.Service

BuildHlSvc creates the desired spec for the headless service.

func BuildKerberosSecretBase

func BuildKerberosSecretBase(vdb *vapi.VerticaDB) *corev1.Secret

BuildKerberosSecretBase is a test helper that creates the skeleton of a Kerberos secret. The caller's responsibility to add the necessary data.

func BuildPV added in v1.7.0

func BuildPV(vdb *vapi.VerticaDB, sc *vapi.Subcluster, podIndex int32) *corev1.PersistentVolume

BuildPV will build a PV for test purposes

func BuildPVC added in v1.7.0

func BuildPVC(vdb *vapi.VerticaDB, sc *vapi.Subcluster, podIndex int32) *corev1.PersistentVolumeClaim

BuildPVC will build a PVC for test purposes

func BuildPod

func BuildPod(vdb *vapi.VerticaDB, sc *vapi.Subcluster, podIndex int32) *corev1.Pod

buildPod will construct a spec for a pod. This is only here for testing purposes when we need to construct the pods ourselves. This bit is typically handled by the statefulset controller.

func BuildS3CommunalCredSecret

func BuildS3CommunalCredSecret(vdb *vapi.VerticaDB, accessKey, secretKey string) *corev1.Secret

BuildS3CommunalCredSecret is a test helper to build up the Secret spec to store communal credentials

func BuildSecretBase

func BuildSecretBase(nm types.NamespacedName) *corev1.Secret

BuildSecretBase is a test helper that creates a Secret base with a specific name. The caller is responsible to add data elemets and create it.

func BuildStorageClass added in v1.7.0

func BuildStorageClass(allowVolumeExpansion bool) *storagev1.StorageClass

BuildStorageClass will construct a storageClass for test purposes

func BuildStsSpec

func BuildStsSpec(nm types.NamespacedName, vdb *vapi.VerticaDB, sc *vapi.Subcluster, deployNames *DeploymentNames) *appsv1.StatefulSet

BuildStsSpec builds manifest for a subclusters statefulset

func GetK8sAffinity

func GetK8sAffinity(a vapi.Affinity) *corev1.Affinity

GetK8sAffinity returns a K8s Affinity object from a vapi.Affinity object

func GetK8sLocalObjectReferenceArray

func GetK8sLocalObjectReferenceArray(lors []vapi.LocalObjectReference) []corev1.LocalObjectReference

GetK8sLocalObjectReferenceArray returns a k8s LocalObjecReference array from a vapi.LocalObjectReference array

func MakeAnnotationsForObject

func MakeAnnotationsForObject(vdb *vapi.VerticaDB) map[string]string

MakeAnnotationsForObjects builds the list of annotations that are to be included on new objects.

func MakeAnnotationsForSubclusterService

func MakeAnnotationsForSubclusterService(vdb *vapi.VerticaDB, sc *vapi.Subcluster) map[string]string

MakeAnnotationsForSubclusterService returns a map of annotations for Subcluster sc's service under VerticaDB vdb.

func MakeBaseSvcSelectorLabels

func MakeBaseSvcSelectorLabels(vdb *vapi.VerticaDB) map[string]string

MakeSvcSelectorLabels returns the labels that are used for selectors in service objects.

func MakeCommonLabels

func MakeCommonLabels(vdb *vapi.VerticaDB, sc *vapi.Subcluster, forPod bool) map[string]string

MakeCommonLabels returns the labels that are common to all objects.

func MakeLabelsForPodObject added in v1.7.0

func MakeLabelsForPodObject(vdb *vapi.VerticaDB, sc *vapi.Subcluster) map[string]string

MakeLabelsForPodObject constructs the labels that are common for all pods

func MakeLabelsForStsObject added in v1.7.0

func MakeLabelsForStsObject(vdb *vapi.VerticaDB, sc *vapi.Subcluster) map[string]string

MakeLabelsForStsObject constructs the labels that are common for all statefulsets.

func MakeLabelsForSvcObject

func MakeLabelsForSvcObject(vdb *vapi.VerticaDB, sc *vapi.Subcluster, svcType string) map[string]string

MakeLabelsForSvcObject will create the set of labels for use with service objects

func MakeOperatorLabels

func MakeOperatorLabels(vdb *vapi.VerticaDB) map[string]string

MakeOperatorLabels returns the labels that all objects created by this operator will have

func MakeStsSelectorLabels

func MakeStsSelectorLabels(vdb *vapi.VerticaDB, sc *vapi.Subcluster) map[string]string

MakeStsSelectorLabels will create the selector labels for use within a StatefulSet

func MakeSubclusterLabels

func MakeSubclusterLabels(sc *vapi.Subcluster) map[string]string

MakeSubclusterLabels returns the labels added for the subcluster

func MakeSvcSelectorLabelsForServiceNameRouting

func MakeSvcSelectorLabelsForServiceNameRouting(vdb *vapi.VerticaDB, sc *vapi.Subcluster) map[string]string

MakeSvcSelectorLabelsForServiceNameRouting will create the labels for when we want a service object to pick the pods based on the service name. This allows us to combine multiple subcluster under a single service object.

func MakeSvcSelectorLabelsForSubclusterNameRouting

func MakeSvcSelectorLabelsForSubclusterNameRouting(vdb *vapi.VerticaDB, sc *vapi.Subcluster) map[string]string

MakeSvcSelectorLabelsForSubclusterNameRouting will create the labels for when we want a service object to pick the pods based on the subcluster name.

Types

type DeploymentNames added in v1.7.0

type DeploymentNames struct {
	ServiceAccountName string // Name of the service account to use for vertica pods
	PrefixName         string // The common prefix for all objects created when deploying the operator
}

DeploymentNames gives context about the names used in deploying the operator

func DefaultDeploymentNames added in v1.7.0

func DefaultDeploymentNames() *DeploymentNames

DefaultDeploymentNames generates a DeploymentNames based on the defaults. This is for test purposes.

Jump to

Keyboard shortcuts

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