commons

package
v0.0.0-...-e7d8dfb Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLDAPFieldEmail     = "email"
	DefaultLDAPFieldGivenName = "givenName"
	DefaultLDAPFieldGroup     = "memberOf"
	DefaultLDAPFieldSurname   = "sn"
	DefaultLDAPFieldUid       = "uid"
)
View Source
const (
	EnvKeyOidcClientId     = "OIDC_CLIENT_ID"
	EnvKeyOidcClientSecret = "OIDC_CLIENT_SECRET"
)
View Source
const (
	EnvKeyAdminUserName  = "ADMIN_USERNAME"
	ENVKeyAdminFirstName = "ADMIN_FIRSTNAME"
	EnvKeyAdminLastName  = "ADMIN_LASTNAME"
	EnvKeyAdminEmail     = "ADMIN_EMAIL"
	EnvKeyAdminPassword  = "ADMIN_PASSWORD"
)
View Source
const (
	LogVolumeMountName    = "log"
	ConfigVolumeMountName = "config"
)
View Source
const BashLibs = `` /* 542-byte string literal not displayed */
View Source
const (
	DefaultLogLevel = "INFO"
)

Variables

View Source
var (
	AppConfigPath = path.Join(constants.KubedoopRoot, "app", "config")
	AirflowHome   = path.Join(constants.KubedoopRoot, "airflow")

	KubernetesExecutorPodTemplateFileName = "airflow_executor_pod_template.yaml"
	KubernetesExecutorPodTemplatePath     = path.Join(AirflowHome, "template")
)

Functions

func GetAuthProvider

func GetAuthProvider(ctx context.Context, client *client.Client, authclass string) (*authv1alpha1.AuthenticationProvider, error)

func GetExecutorName

func GetExecutorName(executor ExecutorType) string

func NewConfigReconciler

func NewConfigReconciler(
	client *client.Client,
	clusterConfig *airflowv1alpha1.ClusterConfigSpec,
	roleGroupConfig *airflowv1alpha1.ConfigSpec,
	roleGroupInfo reconciler.RoleGroupInfo,
	auth *Authentication,
	options ...builder.Option,
) *reconciler.SimpleResourceReconciler[builder.ConfigBuilder]

func NewStatefulSetReconciler

func NewStatefulSetReconciler(
	client *client.Client,
	roleGroupInfo reconciler.RoleGroupInfo,
	clusterConfig *airflowv1alpha1.ClusterConfigSpec,
	ports []corev1.ContainerPort,
	image *util.Image,
	replicas *int32,
	stopped bool,
	overrides *commonsv1alpha1.OverridesSpec,
	roleGroupConfig *commonsv1alpha1.RoleGroupConfigSpec,
	executor ExecutorType,
	auth *Authentication,
	options ...builder.Option,
) (*reconciler.StatefulSet, error)

Types

type Authentication

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

func NewAuthentication

func NewAuthentication(
	ctx context.Context,
	client *client.Client,
	auths []airflowv1alpha1.AuthenticationSpec,
) (*Authentication, error)

func (*Authentication) GetConfig

func (a *Authentication) GetConfig() (string, error)

func (*Authentication) GetEnvVars

func (a *Authentication) GetEnvVars() []corev1.EnvVar

func (*Authentication) GetVolumeMounts

func (a *Authentication) GetVolumeMounts() []corev1.VolumeMount

func (*Authentication) GetVolumes

func (a *Authentication) GetVolumes() []corev1.Volume

type Authenticator

type Authenticator interface {
	GetEnvVars() []corev1.EnvVar
	GetVolumes() []corev1.Volume
	GetVolumeMounts() []corev1.VolumeMount
	GetConfig() *properties.Properties
	GetCommands() []string
}

type AuthenticatorType

type AuthenticatorType string
const (
	AuthenticatorTypeLDAP AuthenticatorType = "ldap"
	AuthenticatorTypeOIDC AuthenticatorType = "oidc"
)

type ConfigMapBuilder

type ConfigMapBuilder struct {
	builder.ConfigMapBuilder

	ClusterConfig   *airflowv1alpha1.ClusterConfigSpec
	RoleGroupConfig *airflowv1alpha1.ConfigSpec
	Auth            *Authentication
}

ConfigMapBuilder is an implementation of ConfigMapBuilder

func NewConfigMapBuilder

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

NewConfigMapBuilder returns a new ConfigMapBuilder

func (*ConfigMapBuilder) Build

type ExecutorType

type ExecutorType int32
const (
	LocalExecutor ExecutorType = iota
	CeleryExecutor
	KubernetesExecutor
)

type StatefulSetBuilder

type StatefulSetBuilder struct {
	builder.StatefulSet
	ClusterConfig *airflowv1alpha1.ClusterConfigSpec
	Executor      ExecutorType
	Auth          *Authentication
}

StatefulSetBuilder is an implementation of StatefulSetBuilder

func NewStatefulSetBuilder

func NewStatefulSetBuilder(
	client *client.Client,
	name string,
	clusterConfig *airflowv1alpha1.ClusterConfigSpec,
	replicas *int32,
	image *util.Image,
	ports []corev1.ContainerPort,
	overrides *commonsv1alpha1.OverridesSpec,
	roleGroupConfig *commonsv1alpha1.RoleGroupConfigSpec,
	executor ExecutorType,
	auth *Authentication,
	options ...builder.Option,
) *StatefulSetBuilder

NewStatefulSetBuilder returns a new StatefulSetBuilder

func (*StatefulSetBuilder) Build

Jump to

Keyboard shortcuts

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