controllers

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Key names in the communal credentials for Azure blob storage endpoints.
	AzureAccountName           = "accountName"
	AzureBlobEndpoint          = "blobEndpoint"
	AzureAccountKey            = "accountKey"
	AzureSharedAccessSignature = "sharedAccessSignature"
	AzureDefaultProtocol       = "HTTPS"
)
View Source
const (
	AWSRegionParm    = "awsregion"
	GCloudRegionParm = "GCSRegion"
)
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"
	VDBInstanceLabel          = "app.kubernetes.io/instance"
	OperatorVersionLabel      = "app.kubernetes.io/version"
	OperatorName              = "verticadb-operator" // The name of the operator

	CurOperatorVersion = "1.3.0" // The version number of the operator
	OperatorVersion100 = "1.0.0"
	OperatorVersion110 = "1.1.0"
	OperatorVersion120 = "1.2.0"
	OperatorVersion130 = CurOperatorVersion
)
View Source
const (
	ServerContainer      = "server"
	ServerContainerIndex = 0
)
View Source
const (
	ClusterShutdownOfflineMsgIndex = iota
	ReschedulePodsOfflineMsgIndex
	ClusterRestartOfflineMsgIndex
)
View Source
const (
	// Amount of time to wait after a restart failover before doing another requeue.
	RequeueWaitTimeInSeconds = 10
	// The name of the IP map file that is used by re_ip.  re_ip is only ever used if the entire cluster is down.
	AdminToolsMapFile = "/opt/vertica/config/ipMap.txt"
	// Constant for an up node, this is taken from the STATE colume in NODES table
	StateUp = "UP"
)
View Source
const (
	// The name of the key in the communal credential secret that holds the access key
	CommunalAccessKeyName = "accesskey"
	// The name of the key in the communal credential secret that holds the secret key
	CommunalSecretKeyName = "secretkey"
)
View Source
const (
	// This is a file that we run with the create_db to run custome SQL. This is
	// passed with the --sql parameter when running create_db.
	PostDBCreateSQLFile = "/home/dbadmin/post-db-create.sql"
)
View Source
const (
	// The name of the key in the superuser password secret that holds the password
	SuperuserPasswordKey = "password"
)
View Source
const (
	SuperuserPasswordPath = "superuser-passwd"
)

Variables

View Source
var OfflineUpgradeStatusMsgs = []string{
	"Shutting down cluster",
	"Rescheduling pods with new image",
	"Restarting cluster with new image",
}

Functions

This section is empty.

Types

type AzureCredential added in v1.2.0

type AzureCredential struct {
	// At least one of the next two need to be set
	AccountName  string `json:"accountName,omitempty"`
	BlobEndpoint string `json:"blobEndpoint,omitempty"` // host name with optional port (host:port)

	// Only one of the two will be set
	AccountKey            string `json:"accountKey,omitempty"`            // Access key for the account or endpoint
	SharedAccessSignature string `json:"sharedAccessSignature,omitempty"` // Access token for finer-grained access control
}

AzureCredential stores the credentials to connect to azb:// This structure must be kept in sync with the Vertica server format. You cannot add fields here unless there is a corresponding change in the engine.

type AzureEndpointConfig added in v1.2.0

type AzureEndpointConfig struct {
	AccountName            string `json:"accountName,omitempty"`
	BlobEndpoint           string `json:"blobEndpoint,omitempty"`
	Protocol               string `json:"protocol,omitempty"`
	IsMultiAccountEndpoint bool   `json:"isMultiAccountEndpoint,omitempty"`
}

AzureEndpointConfig contains config elements for a single azure endpoint. This structure must be kept insync with the Vertica server format.

type CreateDBReconciler

type CreateDBReconciler struct {
	VRec    *VerticaDBReconciler
	Log     logr.Logger
	Vdb     *vapi.VerticaDB // Vdb is the CRD we are acting on.
	PRunner cmds.PodRunner
	PFacts  *PodFacts
}

CreateDBReconciler will create a database if one wasn't created yet.

func (*CreateDBReconciler) Reconcile

func (c *CreateDBReconciler) Reconcile(ctx context.Context, req *ctrl.Request) (ctrl.Result, error)

Reconcile will ensure a DB exists and create one if it doesn't

type DBAddNodeReconciler

type DBAddNodeReconciler struct {
	VRec    *VerticaDBReconciler
	Log     logr.Logger
	Vdb     *vapi.VerticaDB // Vdb is the CRD we are acting on.
	PRunner cmds.PodRunner
	PFacts  *PodFacts
}

DBAddNodeReconciler will ensure each pod is added to the database.

func (*DBAddNodeReconciler) Reconcile

func (d *DBAddNodeReconciler) Reconcile(ctx context.Context, req *ctrl.Request) (ctrl.Result, error)

Reconcile will ensure a DB exists and create one if it doesn't

type DBAddSubclusterReconciler

type DBAddSubclusterReconciler struct {
	VRec    *VerticaDBReconciler
	Log     logr.Logger
	Vdb     *vapi.VerticaDB // Vdb is the CRD we are acting on.
	PRunner cmds.PodRunner
	PFacts  *PodFacts
	ATPod   *PodFact // The pod that we run admintools from
}

DBAddSubclusterReconciler will create a new subcluster if necessary

func (*DBAddSubclusterReconciler) Reconcile

Reconcile will ensure a subcluster exists for each one defined in the vdb.

type DBRemoveNodeReconciler

type DBRemoveNodeReconciler struct {
	VRec    *VerticaDBReconciler
	Log     logr.Logger
	Vdb     *vapi.VerticaDB // Vdb is the CRD we are acting on.
	PRunner cmds.PodRunner
	PFacts  *PodFacts
}

DBRemoveNodeReconciler will handle removing a node from the database during scale down.

func (*DBRemoveNodeReconciler) CollectPFacts

func (d *DBRemoveNodeReconciler) CollectPFacts(ctx context.Context) error

func (*DBRemoveNodeReconciler) GetClient

func (d *DBRemoveNodeReconciler) GetClient() client.Client

func (*DBRemoveNodeReconciler) GetVDB

func (d *DBRemoveNodeReconciler) GetVDB() *vapi.VerticaDB

func (*DBRemoveNodeReconciler) Reconcile

func (d *DBRemoveNodeReconciler) Reconcile(ctx context.Context, req *ctrl.Request) (ctrl.Result, error)

Reconcile will handle calling admintools -t db_remove_node when scale down is detected.

This reconcile function is meant to be called before we create/delete any kubernetes objects. It allows us to look at the state before applying everything in Vdb. We will know if we are scaling down by comparing the expected subcluster size with the current.

type DBRemoveSubclusterReconciler

type DBRemoveSubclusterReconciler struct {
	VRec    *VerticaDBReconciler
	Log     logr.Logger
	Vdb     *vapi.VerticaDB // Vdb is the CRD we are acting on.
	PRunner cmds.PodRunner
	PFacts  *PodFacts
	ATPod   *PodFact // The pod that we run admintools from
}

DBRemoveSubclusterReconciler will remove subclusters from the database

func (*DBRemoveSubclusterReconciler) Reconcile

Reconcile will remove any subcluster that no longer exists in the vdb.

type DatabaseInitializer

type DatabaseInitializer interface {
	// contains filtered or unexported methods
}

type FindFlags

type FindFlags uint8
const (
	// Find subclusters that appear in the vdb.
	FindInVdb FindFlags = 1 << iota
	// Find subclusters that don't appear in the vdb.  This can be for
	// subclusters that are being deleted.
	FindNotInVdb
	// Find subclusters that currently exist.  This includes subclusters that
	// are already present in the vdb as well as ones that are scheduled for
	// deletion.  This option is mutually exclusive with the other options.
	FindExisting
	// Find will return a list of objects that are sorted by their name
	FindSorted
	// Find all subclusters, both in the vdb and not in the vdb.
	FindAll = FindInVdb | FindNotInVdb
)

type GenericDatabaseInitializer

type GenericDatabaseInitializer struct {
	VRec    *VerticaDBReconciler
	Log     logr.Logger
	Vdb     *vapi.VerticaDB
	PRunner cmds.PodRunner
	PFacts  *PodFacts
	// contains filtered or unexported fields
}

func (*GenericDatabaseInitializer) ConstructAuthParms

func (g *GenericDatabaseInitializer) ConstructAuthParms(ctx context.Context, atPod types.NamespacedName) (ctrl.Result, error)

ConstructAuthParms builds the authentication parms and ensure it exists in the pod

func (*GenericDatabaseInitializer) DestroyAuthParms

func (g *GenericDatabaseInitializer) DestroyAuthParms(ctx context.Context, atPod types.NamespacedName) error

DestroyAuthParms will remove the auth parms file that was created in the pod

type InstallReconciler

type InstallReconciler struct {
	VRec     *VerticaDBReconciler
	Log      logr.Logger
	Vdb      *vapi.VerticaDB // Vdb is the CRD we are acting on.
	PRunner  cmds.PodRunner
	PFacts   *PodFacts
	ATWriter atconf.Writer
}

InstallReconciler will handle reconcile for install of vertica

func (*InstallReconciler) Reconcile

func (d *InstallReconciler) Reconcile(ctx context.Context, req *ctrl.Request) (ctrl.Result, error)

Reconcile will ensure Vertica is installed and running in the pods.

type ObjReconciler

type ObjReconciler struct {
	VRec              *VerticaDBReconciler
	Log               logr.Logger
	Vdb               *vapi.VerticaDB // Vdb is the CRD we are acting on.
	PFacts            *PodFacts
	PatchImageAllowed bool // a patch can only change the image when this is set to true
}

ObjReconciler will reconcile for all dependent Kubernetes objects. This is used for a single reconcile iteration.

func (*ObjReconciler) Reconcile

func (o *ObjReconciler) Reconcile(ctx context.Context, req *ctrl.Request) (ctrl.Result, error)

Reconcile is the main driver for reconciliation of Kubernetes objects. This will ensure the desired svc and sts objects exist and are in the correct state.

type OfflineUpgradeReconciler added in v1.3.0

type OfflineUpgradeReconciler struct {
	VRec    *VerticaDBReconciler
	Log     logr.Logger
	Vdb     *vapi.VerticaDB // Vdb is the CRD we are acting on.
	PRunner cmds.PodRunner
	PFacts  *PodFacts
	Finder  SubclusterFinder
	Manager UpgradeManager
}

OfflineUpgradeReconciler will handle the process of doing an offline upgrade of the Vertica server.

func (*OfflineUpgradeReconciler) Reconcile added in v1.3.0

func (o *OfflineUpgradeReconciler) Reconcile(ctx context.Context, req *ctrl.Request) (ctrl.Result, error)

Reconcile will handle the process of the vertica image changing. For example, this can automate the process for an upgrade.

type OnlineUpgradeReconciler added in v1.3.0

type OnlineUpgradeReconciler struct {
	VRec          *VerticaDBReconciler
	Log           logr.Logger
	Vdb           *vapi.VerticaDB // Vdb is the CRD we are acting on.
	PRunner       cmds.PodRunner
	PFacts        *PodFacts
	Finder        SubclusterFinder
	Manager       UpgradeManager
	PrimaryImages []string // Known images in the primaries.  Should be of length 1 or 2.
	StatusMsgs    []string // Precomputed status messages
	MsgIndex      int      // Current index in StatusMsgs
}

OnlineUpgradeReconciler will handle the process when the vertica image changes. It does this while keeping the database online.

func (*OnlineUpgradeReconciler) Reconcile added in v1.3.0

func (o *OnlineUpgradeReconciler) Reconcile(ctx context.Context, req *ctrl.Request) (ctrl.Result, error)

Reconcile will handle the process of the vertica image changing. For example, this can automate the process for an upgrade.

type PodFact

type PodFact struct {
	// contains filtered or unexported fields
}

PodFact keeps track of facts for a specific pod

type PodFactDetail

type PodFactDetail map[types.NamespacedName]*PodFact

type PodFacts

type PodFacts struct {
	client.Client
	PRunner        cmds.PodRunner
	Detail         PodFactDetail
	NeedCollection bool
}

A collection of facts for many pods.

func MakePodFacts

func MakePodFacts(cli client.Client, prunner cmds.PodRunner) PodFacts

MakePodFacts will create a PodFacts object and return it

func (*PodFacts) Collect

func (p *PodFacts) Collect(ctx context.Context, vdb *vapi.VerticaDB) error

Collect will gather up the for facts if a collection is needed If the facts are already up to date, this function does nothing.

func (*PodFacts) Invalidate

func (p *PodFacts) Invalidate()

Invalidate will mark the pod facts as requiring a refresh. Next call to Collect will gather up the facts again.

type ReconcileActor

type ReconcileActor interface {
	Reconcile(ctx context.Context, req *ctrl.Request) (ctrl.Result, error)
}

ReconcileActor is an interface that handles one part of the entire reconciliation process.

func MakeCreateDBReconciler

func MakeCreateDBReconciler(vdbrecon *VerticaDBReconciler, log logr.Logger,
	vdb *vapi.VerticaDB, prunner cmds.PodRunner, pfacts *PodFacts) ReconcileActor

MakeCreateDBReconciler will build a CreateDBReconciler object

func MakeDBAddNodeReconciler

func MakeDBAddNodeReconciler(vdbrecon *VerticaDBReconciler, log logr.Logger,
	vdb *vapi.VerticaDB, prunner cmds.PodRunner, pfacts *PodFacts) ReconcileActor

MakeDBAddNodeReconciler will build a DBAddNodeReconciler object

func MakeDBAddSubclusterReconciler

func MakeDBAddSubclusterReconciler(vdbrecon *VerticaDBReconciler, log logr.Logger,
	vdb *vapi.VerticaDB, prunner cmds.PodRunner, pfacts *PodFacts) ReconcileActor

MakeDBAddSubclusterReconciler will build a DBAddSubclusterReconciler object

func MakeDBRemoveNodeReconciler

func MakeDBRemoveNodeReconciler(vdbrecon *VerticaDBReconciler, log logr.Logger,
	vdb *vapi.VerticaDB, prunner cmds.PodRunner, pfacts *PodFacts) ReconcileActor

MakeDBRemoveNodeReconciler will build and return the DBRemoveNodeReconciler object.

func MakeDBRemoveSubclusterReconciler

func MakeDBRemoveSubclusterReconciler(vdbrecon *VerticaDBReconciler, log logr.Logger,
	vdb *vapi.VerticaDB, prunner cmds.PodRunner, pfacts *PodFacts) ReconcileActor

MakeDBRemoveSubclusterReconciler will build a DBRemoveSubclusterReconciler object

func MakeInstallReconciler

func MakeInstallReconciler(vdbrecon *VerticaDBReconciler, log logr.Logger,
	vdb *vapi.VerticaDB, prunner cmds.PodRunner, pfacts *PodFacts) ReconcileActor

MakeInstallReconciler will build and return the InstallReconciler object.

func MakeObjReconciler

func MakeObjReconciler(vdbrecon *VerticaDBReconciler, log logr.Logger, vdb *vapi.VerticaDB, pfacts *PodFacts) ReconcileActor

MakeObjReconciler will build an ObjReconciler object

func MakeOfflineUpgradeReconciler added in v1.3.0

func MakeOfflineUpgradeReconciler(vdbrecon *VerticaDBReconciler, log logr.Logger,
	vdb *vapi.VerticaDB, prunner cmds.PodRunner, pfacts *PodFacts) ReconcileActor

MakeOfflineUpgradeReconciler will build an OfflineUpgradeReconciler object

func MakeOnlineUpgradeReconciler added in v1.3.0

func MakeOnlineUpgradeReconciler(vdbrecon *VerticaDBReconciler, log logr.Logger,
	vdb *vapi.VerticaDB, prunner cmds.PodRunner, pfacts *PodFacts) ReconcileActor

MakeOnlineUpgradeReconciler will build an OnlineUpgradeReconciler object

func MakeRestartReconciler

func MakeRestartReconciler(vdbrecon *VerticaDBReconciler, log logr.Logger,
	vdb *vapi.VerticaDB, prunner cmds.PodRunner, pfacts *PodFacts, restartReadOnly bool) ReconcileActor

MakeRestartReconciler will build a RestartReconciler object

func MakeReviveDBReconciler

func MakeReviveDBReconciler(vdbrecon *VerticaDBReconciler, log logr.Logger,
	vdb *vapi.VerticaDB, prunner cmds.PodRunner, pfacts *PodFacts) ReconcileActor

MakeReviveDBReconciler will build a ReviveDBReconciler object

func MakeStatusReconciler

func MakeStatusReconciler(cli client.Client, scheme *runtime.Scheme, log logr.Logger,
	vdb *vapi.VerticaDB, pfacts *PodFacts) ReconcileActor

MakeStatusReconciler will build a StatusReconciler object

func MakeUninstallReconciler

func MakeUninstallReconciler(vdbrecon *VerticaDBReconciler, log logr.Logger,
	vdb *vapi.VerticaDB, prunner cmds.PodRunner, pfacts *PodFacts) ReconcileActor

MakeUninstallReconciler will build and return the UninstallReconciler object.

func MakeUpgradeOperator120Reconciler added in v1.3.0

func MakeUpgradeOperator120Reconciler(vdbrecon *VerticaDBReconciler, log logr.Logger,
	vdb *vapi.VerticaDB) ReconcileActor

MakeUpgradeOperator120Reconciler will build a UpgradeOperatorFrom120Reconciler object

func MakeVersionReconciler

func MakeVersionReconciler(vdbrecon *VerticaDBReconciler, log logr.Logger,
	vdb *vapi.VerticaDB, prunner cmds.PodRunner, pfacts *PodFacts,
	enforceUpgradePath bool) ReconcileActor

MakeVersionReconciler will build a VersinReconciler object

type RestartReconciler

type RestartReconciler struct {
	VRec            *VerticaDBReconciler
	Log             logr.Logger
	Vdb             *vapi.VerticaDB // Vdb is the CRD we are acting on.
	PRunner         cmds.PodRunner
	PFacts          *PodFacts
	ATPod           types.NamespacedName // The pod that we run admintools from
	RestartReadOnly bool                 // Whether to restart nodes that are in read-only mode
}

RestartReconciler will ensure each pod has a running vertica process

func (*RestartReconciler) Reconcile

func (r *RestartReconciler) Reconcile(ctx context.Context, req *ctrl.Request) (ctrl.Result, error)

Reconcile will ensure each pod is UP in the vertica sense. On success, each node will have a running vertica process.

type ReviveDBReconciler

type ReviveDBReconciler struct {
	VRec    *VerticaDBReconciler
	Log     logr.Logger
	Vdb     *vapi.VerticaDB // Vdb is the CRD we are acting on.
	PRunner cmds.PodRunner
	PFacts  *PodFacts
}

ReviveDBReconciler will revive a database if one doesn't exist in the vdb yet.

func (*ReviveDBReconciler) Reconcile

func (r *ReviveDBReconciler) Reconcile(ctx context.Context, req *ctrl.Request) (ctrl.Result, error)

Reconcile will ensure a DB exists and revive one if it doesn't

type ScaledownActor

type ScaledownActor interface {
	GetClient() client.Client
	GetVDB() *vapi.VerticaDB
	CollectPFacts(ctx context.Context) error
}

ScaledownActor is an interface that handles a part of scale down, either db_remove_node or uninstall.

type StatusReconciler

type StatusReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	Log    logr.Logger
	Vdb    *vapi.VerticaDB // Vdb is the CRD we are acting on.
	PFacts *PodFacts
}

StatusReconciler will update the status field of the vdb.

func (*StatusReconciler) Reconcile

func (s *StatusReconciler) Reconcile(ctx context.Context, req *ctrl.Request) (ctrl.Result, error)

Reconcile will update the status of the Vdb based on the pod facts

type SubclusterFinder

type SubclusterFinder struct {
	client.Client
	Vdb         *vapi.VerticaDB
	Subclusters map[string]*vapi.Subcluster
}

func MakeSubclusterFinder

func MakeSubclusterFinder(cli client.Client, vdb *vapi.VerticaDB) SubclusterFinder

func (*SubclusterFinder) FindPods added in v1.1.0

func (m *SubclusterFinder) FindPods(ctx context.Context, flags FindFlags) (*corev1.PodList, error)

FindPods returns pod objects that are are used to run Vertica. It limits the pods that were created by the VerticaDB object.

func (*SubclusterFinder) FindServices

func (m *SubclusterFinder) FindServices(ctx context.Context, flags FindFlags) (*corev1.ServiceList, error)

FindServices returns service objects that are in use for subclusters

func (*SubclusterFinder) FindStatefulSets

func (m *SubclusterFinder) FindStatefulSets(ctx context.Context, flags FindFlags) (*appsv1.StatefulSetList, error)

FindStatefulSets returns the statefulsets that were created by the operator. You can limit it so that it only returns statefulsets that match subclusters in Vdb, ones that don't match or all.

func (*SubclusterFinder) FindSubclusters

func (m *SubclusterFinder) FindSubclusters(ctx context.Context, flags FindFlags) ([]*vapi.Subcluster, error)

FindSubclusters will return a list of subclusters. It accepts a flags field to indicate whether to return subclusters in the vdb, not in the vdb or both.

type SubclustersSet

type SubclustersSet map[string]bool

type UninstallReconciler

type UninstallReconciler struct {
	VRec     *VerticaDBReconciler
	Log      logr.Logger
	Vdb      *vapi.VerticaDB // Vdb is the CRD we are acting on.
	PRunner  cmds.PodRunner
	PFacts   *PodFacts
	ATWriter atconf.Writer
}

UninstallReconciler will handle reconcile looking specifically for scale down events.

func (*UninstallReconciler) CollectPFacts

func (s *UninstallReconciler) CollectPFacts(ctx context.Context) error

func (*UninstallReconciler) GetClient

func (s *UninstallReconciler) GetClient() client.Client

func (*UninstallReconciler) GetVDB

func (s *UninstallReconciler) GetVDB() *vapi.VerticaDB

func (*UninstallReconciler) Reconcile

func (s *UninstallReconciler) Reconcile(ctx context.Context, req *ctrl.Request) (ctrl.Result, error)

Reconcile will handle state where a pod in a subcluster is being scaled down. During a scale down we need to drive uninstall logic for each applicable pod.

This reconcile function is meant to be called before we create/delete any kubernetes objects. It allows us to look at the state before applying everything in Vdb. We will know if we are scaling down by comparing the expected subcluster size with the current.

type UpgradeManager added in v1.3.0

type UpgradeManager struct {
	VRec              *VerticaDBReconciler
	Vdb               *vapi.VerticaDB
	Log               logr.Logger
	Finder            SubclusterFinder
	ContinuingUpgrade bool // true if UpdateInProgress was already set upon entry
	StatusCondition   vapi.VerticaDBConditionType
	// Function that will check if the image policy allows for a type of upgrade (offline or online)
	IsAllowedForUpgradePolicyFunc func(vdb *vapi.VerticaDB) bool
}

func MakeUpgradeManager added in v1.3.0

func MakeUpgradeManager(vdbrecon *VerticaDBReconciler, log logr.Logger, vdb *vapi.VerticaDB,
	statusCondition vapi.VerticaDBConditionType,
	isAllowedForUpgradePolicyFunc func(vdb *vapi.VerticaDB) bool) *UpgradeManager

MakeUpgradeManager will construct a UpgradeManager object

func (*UpgradeManager) IsUpgradeNeeded added in v1.3.0

func (i *UpgradeManager) IsUpgradeNeeded(ctx context.Context) (bool, error)

IsUpgradeNeeded checks whether an upgrade is needed and/or in progress. It will return true for the first parm if an upgrade should proceed.

type UpgradeOperator120Reconciler added in v1.3.0

type UpgradeOperator120Reconciler struct {
	VRec *VerticaDBReconciler
	Log  logr.Logger
	Vdb  *vapi.VerticaDB // Vdb is the CRD we are acting on.
}

UpgradeOperator120Reconciler will handle any upgrade actions for k8s objects created in 1.2.0 or prior.

func (*UpgradeOperator120Reconciler) Reconcile added in v1.3.0

Reconcile will handle any upgrade actions for k8s objects created in 1.2.0 or prior.

type VersionReconciler

type VersionReconciler struct {
	VRec               *VerticaDBReconciler
	Log                logr.Logger
	Vdb                *vapi.VerticaDB // Vdb is the CRD we are acting on.
	PRunner            cmds.PodRunner
	PFacts             *PodFacts
	EnforceUpgradePath bool                    // Fail the reconcile if we find incompatible version
	FindPodFunc        func() (*PodFact, bool) // Function to call to find pod
}

VersionReconciler will set the version as annotations in the vdb.

func (*VersionReconciler) Reconcile

func (v *VersionReconciler) Reconcile(ctx context.Context, req *ctrl.Request) (ctrl.Result, error)

Reconcile will update the annotation in the Vdb with Vertica version info

type VerticaDBReconciler

type VerticaDBReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
	Cfg    *rest.Config
	EVRec  record.EventRecorder
}

VerticaDBReconciler reconciles a VerticaDB object

func (*VerticaDBReconciler) GetSuperuserPassword

func (r *VerticaDBReconciler) GetSuperuserPassword(ctx context.Context, vdb *vapi.VerticaDB, log logr.Logger) (string, error)

GetSuperuserPassword returns the superuser password if it has been provided

func (*VerticaDBReconciler) Reconcile

func (r *VerticaDBReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the VerticaDB object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkgo.dev/sigs.k8s.io/[email protected]/pkg/reconcile

func (*VerticaDBReconciler) SetupWithManager

func (r *VerticaDBReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳