namespace

package
v0.0.0-...-fc68dbe Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0, MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MemoryRequest = "256Mi"
	CpuRequest    = "100m"
	MemoryLimit   = "512Mi"
	CpuLimit      = "300m"
)

Variables

View Source
var Replicas int32 = 1

Functions

func ClickHouseQuotasProvision

func ClickHouseQuotasProvision(
	quotaName string,
	databaseName string,
	chEndpoints *config.ClickHouseEndpoints,
	quotaDefn string,
	username string,
) []common.Action

func ClickHouseUsersProvision

func ClickHouseUsersProvision(
	username string,
	password string,
	grants []string,
	instanceGrants []string,
	databaseName string,
	chEndpoints *config.ClickHouseEndpoints,
) []common.Action

func Deployment

func Deployment(cr *v1alpha1.GitLabNamespace) *v1.Deployment

func DeploymentMutator

func DeploymentMutator(
	clusterConfig *v1alpha1.Cluster,
	cr *v1alpha1.GitLabNamespace,
	current *v1.Deployment,
) error

func DeploymentSelector

func DeploymentSelector(cr *v1alpha1.GitLabNamespace) client.ObjectKey

func GetRBACObjects

func GetRBACObjects(cr *v1alpha1.GitLabNamespace) ([]client.Object, error)

Get all RBAC objects from the embedded go templates above

func GetTenantOperatorName

func GetTenantOperatorName() string

func GetTenantOperatorSelector

func GetTenantOperatorSelector() map[string]string

func Group

func Group(clusterConfig *v1alpha1.Cluster, cr *v1alpha1.GitLabNamespace) *tenantOperator.Group

func GroupMutator

func GroupMutator(
	clusterConfig *v1alpha1.Cluster,
	cr *v1alpha1.GitLabNamespace,
	current *tenantOperator.Group,
) error

func GroupSelector

func GroupSelector(cr *v1alpha1.GitLabNamespace) client.ObjectKey

func Namespace

func Namespace(cr *v1alpha1.GitLabNamespace) *v1.Namespace

func NamespaceMutator

func NamespaceMutator(cr *v1alpha1.GitLabNamespace, current *v1.Namespace) error

func NamespaceSelector

func NamespaceSelector(cr *v1alpha1.GitLabNamespace) client.ObjectKey

func ServiceAccount

func ServiceAccount(clusterConfig *v1alpha1.Cluster, cr *v1alpha1.GitLabNamespace) *v1.ServiceAccount

func ServiceAccountMutator

func ServiceAccountMutator(
	clusterConfig *v1alpha1.Cluster,
	cr *v1alpha1.GitLabNamespace,
	current *v1.ServiceAccount,
) error

func Tenant

func TenantMutator

func TenantMutator(
	cluster *v1alpha1.Cluster,
	cr *v1alpha1.GitLabNamespace,
	current *tenantOperator.Tenant,
) error

func TenantSelector

func TenantSelector(cr *v1alpha1.GitLabNamespace) client.ObjectKey

Types

type ClickhouseAssetsT

type ClickhouseAssetsT struct {
	Jaeger struct {
		Credentials *corev1.Secret
		Quotas      *corev1.ConfigMap
	}
	ErrorTracking struct {
		Credentials *corev1.Secret
		Quotas      *corev1.ConfigMap
	}
}

type GitLabNamespaceReconciler

type GitLabNamespaceReconciler struct {
	Teardown bool
	Log      logr.Logger
}

func NewGitLabNamespaceReconciler

func NewGitLabNamespaceReconciler(teardown bool, logger logr.Logger) *GitLabNamespaceReconciler

func (*GitLabNamespaceReconciler) Reconcile

type GitLabNamespaceState

type GitLabNamespaceState struct {
	Tenant *tenantOperator.Tenant
	Group  *tenantOperator.Group
	// Track all remaining groups in tenant so we
	// can tear down the tenant if no more groups exist
	TenantGroups *tenant.GroupsState
	Operator     *v1.Deployment
	Namespace    *corev1.Namespace

	Cluster *v1alpha1.Cluster

	ClickHouseAssets *ClickhouseAssetsT
	// contains filtered or unexported fields
}

func NewGitLabNamespaceState

func NewGitLabNamespaceState() *GitLabNamespaceState

func (*GitLabNamespaceState) ClickHouseQuotasInfo

func (i *GitLabNamespaceState) ClickHouseQuotasInfo(subsystem SubsystemName) (map[string]string, error)

func (*GitLabNamespaceState) ClickHouseUserInfo

func (i *GitLabNamespaceState) ClickHouseUserInfo(subsystem SubsystemName) (*url.Userinfo, error)

Get the Clickhouse user and password

func (*GitLabNamespaceState) GetClickhouseEndpoints

func (i *GitLabNamespaceState) GetClickhouseEndpoints() *config.ClickHouseEndpoints

func (*GitLabNamespaceState) GetClusterState

func (i *GitLabNamespaceState) GetClusterState() *v1alpha1.Cluster

func (*GitLabNamespaceState) Read

func (*GitLabNamespaceState) TenantEmpty

func (i *GitLabNamespaceState) TenantEmpty() bool

TenantEmpty returns true if no groups exist for the tenant

type ReconcileGitLabNamespace

type ReconcileGitLabNamespace struct {
	// This client, initialized using mgr.Client() above, is a split client
	// that reads objects from the cache and writes to the apiserver
	Client       client.Client
	Scheme       *runtime.Scheme
	Transport    *http.Transport
	Recorder     record.EventRecorder
	Log          logr.Logger
	StatusPoller *polling.StatusPoller
}

ReconcileGitLabNamespace reconciles a GitLabNamespace object

func (*ReconcileGitLabNamespace) Reconcile

func (r *ReconcileGitLabNamespace) Reconcile(
	ctx context.Context,
	request reconcile.Request,
) (result ctrl.Result, err error)

Reconcile: The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true. Upon completion, we just requeue the Request explicitly to be reconciled every minute thereafter.

One valid use-case of the repeated reconcile(s) of the underlying `GitlabNamespace` object is the need for updating a `Tenant` to inherit changes in `ClusterSpec.GOUI`. Since `Cluster“ updates do not trigger `GitlabNamespace` and by proxy `Tenant` reconciliation, th controller attempts to reconcile all underlying objects every X period of time.

func (*ReconcileGitLabNamespace) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type SubsystemName

type SubsystemName string
const (
	JaegerSubsystemName        SubsystemName = "jaeger"
	ErrorTrackingSubsystemName SubsystemName = "errortracking"
)

Jump to

Keyboard shortcuts

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