controller

package
v0.0.0-...-30da7b9 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelCrName    = "app.kubernetes.io/name"
	LabelComponent = "app.kubernetes.io/component"
	LabelManagedBy = "app.kubernetes.io/managed-by"
)
View Source
const (
	S3AccessKeyName = "ACCESS_KEY"
	S3SecretKeyName = "SECRET_KEY"

	S3VolumeName = "s3-credentials"
)

Variables

View Source
var (
	MatestoreConfigmapVolumeName = "mount-config" // configmap > volume > mount

	MatestoreLogVolumeName = "log"
	MetastorePortName      = "metastore"

	ContainerPort = []corev1.ContainerPort{
		{
			ContainerPort: 9083,
			Protocol:      corev1.ProtocolTCP,
			Name:          MetastorePortName,
		},
	}
)
View Source
var (
	Krb5ConfigFile = path.Join(constants.KubedoopKerberosDir, "krb5.conf")
)

Functions

func GetRefreenceS3Connection

func GetRefreenceS3Connection(ctx context.Context, client *client.Client, name string) (*v1alpha1.S3Connection, error)

func NewDeploymentReconciler

func NewDeploymentReconciler(
	client *client.Client,
	roleGroupInfo reconciler.RoleGroupInfo,
	clusterConfig *hivev1alpha1.ClusterConfigSpec,
	ports []corev1.ContainerPort,
	image *util.Image,
	replicas *int32,
	stopped bool,
	overrides *commonsv1alpha1.OverridesSpec,
	roleGroupConfig *commonsv1alpha1.RoleGroupConfigSpec,
	options ...builder.Option,
) (*reconciler.Deployment, error)

Types

type ClusterReconciler

type ClusterReconciler struct {
	reconciler.BaseCluster[*hivev1alpha1.HiveMetastoreSpec]
	ClusterConfig *hivev1alpha1.ClusterConfigSpec
}

func NewClusterReconciler

func NewClusterReconciler(
	client *client.Client,
	clusterInfo reconciler.ClusterInfo,
	spec *hivev1alpha1.HiveMetastoreSpec,
) *ClusterReconciler

func (*ClusterReconciler) GetImage

func (r *ClusterReconciler) GetImage() *util.Image

func (*ClusterReconciler) RegisterResource

func (r *ClusterReconciler) RegisterResource(ctx context.Context) error

type ConfigMapBuilder

type ConfigMapBuilder struct {
	builder.ConfigMapBuilder

	ClusterConfig *hivev1alpha1.ClusterConfigSpec

	RoleGroupConfig *hivev1alpha1.ConfigSpec
}

func NewConfigMapBuilder

func NewConfigMapBuilder(
	client *client.Client,
	name string,
	clusterConfig *hivev1alpha1.ClusterConfigSpec,
	roleGroupConfig *hivev1alpha1.ConfigSpec,
	options ...builder.Option,
) *ConfigMapBuilder

func (*ConfigMapBuilder) Build

type DeploymentBUilderOption

type DeploymentBUilderOption struct {
	ClusterName   string
	RoleName      string
	RoleGroupName string
	Labels        map[string]string
	Annotations   map[string]string
}

type DeploymentBuilder

type DeploymentBuilder struct {
	builder.Deployment
	ClusterConfig *hivev1alpha1.ClusterConfigSpec
}

func NewDeploymentBuilder

func NewDeploymentBuilder(
	client *client.Client,
	name string,
	clusterConfig *hivev1alpha1.ClusterConfigSpec,
	replicas *int32,
	image *util.Image,
	overrides *commonsv1alpha1.OverridesSpec,
	roleGroupConfig *commonsv1alpha1.RoleGroupConfigSpec,
	options ...builder.Option,
) *DeploymentBuilder

func (*DeploymentBuilder) Build

type HiveMetastoreReconciler

type HiveMetastoreReconciler struct {
	ctrlclient.Client
	Scheme *runtime.Scheme
}

HiveMetastoreReconciler reconciles a HiveMetastore object

func (*HiveMetastoreReconciler) Reconcile

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

func (*HiveMetastoreReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type KerberosConfig

type KerberosConfig struct {
	Namespace   string
	ClusterName string
	RoleName    string

	KerberosSecretClass string
	HdfsEnabled         bool
}

func NewKerberosConfig

func NewKerberosConfig(
	namespace string,
	clustername string,
	rolename string,
	krb5SecretClass string,
) *KerberosConfig

func (*KerberosConfig) GetContainerCommandArgs

func (c *KerberosConfig) GetContainerCommandArgs() string

func (*KerberosConfig) GetCoreSite

func (c *KerberosConfig) GetCoreSite() map[string]string

func (*KerberosConfig) GetEnv

func (c *KerberosConfig) GetEnv() []corev1.EnvVar

func (*KerberosConfig) GetHiveSite

func (c *KerberosConfig) GetHiveSite() map[string]string

func (*KerberosConfig) GetVolumeMounts

func (c *KerberosConfig) GetVolumeMounts() []corev1.VolumeMount

func (*KerberosConfig) GetVolumes

func (c *KerberosConfig) GetVolumes() []corev1.Volume

type RoleLabels

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

func (*RoleLabels) GetLabels

func (r *RoleLabels) GetLabels() map[string]string

type RoleReconciler

type RoleReconciler struct {
	reconciler.BaseRoleReconciler[*hivev1alpha1.RoleSpec]
	ClusterConfig *hivev1alpha1.ClusterConfigSpec
	Image         *util.Image
}

func NewNodeRoleReconciler

func NewNodeRoleReconciler(
	client *client.Client,
	clusterStopped bool,
	clusterConfig *hivev1alpha1.ClusterConfigSpec,
	roleInfo reconciler.RoleInfo,
	image *util.Image,
	spec *hivev1alpha1.RoleSpec,
) *RoleReconciler

func (*RoleReconciler) GetImageResourceWithRoleGroup

func (r *RoleReconciler) GetImageResourceWithRoleGroup(
	ctx context.Context,
	info reconciler.RoleGroupInfo,
	config *hivev1alpha1.ConfigSpec,
	overrides *commonsv1alpha1.OverridesSpec,
	replicas *int32,
) ([]reconciler.Reconciler, error)

func (*RoleReconciler) RegisterResources

func (r *RoleReconciler) RegisterResources(ctx context.Context) error

type S3Config

type S3Config struct {
	S3Connection *S3Connection
}

func NewS3Config

func NewS3Config(
	s3Connection *S3Connection,
) *S3Config

func (*S3Config) GetContainerCommandArgs

func (s *S3Config) GetContainerCommandArgs() string

func (*S3Config) GetEndpoint

func (s *S3Config) GetEndpoint() string

func (*S3Config) GetHiveSite

func (s *S3Config) GetHiveSite() map[string]string

func (*S3Config) GetMountPath

func (s *S3Config) GetMountPath() string

func (*S3Config) GetVolumeMounts

func (s *S3Config) GetVolumeMounts() []corev1.VolumeMount

func (*S3Config) GetVolumeName

func (s *S3Config) GetVolumeName() string

func (*S3Config) GetVolumes

func (s *S3Config) GetVolumes() []corev1.Volume

type S3Connection

type S3Connection struct {
	Endpoint  url.URL
	PathStyle bool
	// contains filtered or unexported fields
}

TODO: Add the tls verification

func GetS3Connect

func GetS3Connect(ctx context.Context, client *client.Client, s3 *hivev1alpha1.S3Spec) (*S3Connection, error)

Jump to

Keyboard shortcuts

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