gitlab

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GitLabShellComponentName is the common name of GitLab Shell.
	GitLabShellComponentName = "gitlab-shell"

	// TaskRunnerComponentName is the common name of GitLab Task Runner.
	TaskRunnerComponentName = "task-runner"

	// MigrationsComponentName is the common name of Migrations.
	MigrationsComponentName = "migrations"

	// GitLabExporterComponentName is the common name of GitLab Exporter.
	GitLabExporterComponentName = "gitlab-exporter"

	// RegistryComponentName is the common name of the Registry.
	RegistryComponentName = "registry"

	// WebserviceComponentName is the common name of Webservice.
	WebserviceComponentName = "webservice"

	// SharedSecretsComponentName is the common name of Shared Secrets.
	SharedSecretsComponentName = "shared-secrets"

	// GitalyComponentName is the common name of Gitaly.
	GitalyComponentName = "gitaly"

	// SidekiqComponentName is the common name of Sidekiq.
	SidekiqComponentName = "sidekiq"

	// RedisComponentName is the common name of Redis.
	RedisComponentName = "redis"

	// PostgresComponentName is the common name of PostgreSQL.
	PostgresComponentName = "postgresql"
)
View Source
const (
	// SharedSecretsJobDefaultTimeout is the default timeout to wait for Shared Secrets job to finish.
	SharedSecretsJobDefaultTimeout = 300 * time.Second
)

Variables

This section is empty.

Functions

func AvailableChartVersions

func AvailableChartVersions() []string

AvailableChartVersions lists the version of available GitLab Charts. The values are sorted from newest to oldest (semantic versioning).

func ExporterConfigMaps

func ExporterConfigMaps(adapter CustomResourceAdapter) []*corev1.ConfigMap

ExporterConfigMaps returns the ConfigMaps for the GitLab Exporter component.

func ExporterDeployment

func ExporterDeployment(adapter CustomResourceAdapter) *appsv1.Deployment

ExporterDeployment returns the Deployment for the GitLab Exporter component.

func ExporterService

func ExporterService(adapter CustomResourceAdapter) *corev1.Service

ExporterService returns the Service for the GitLab Exporter component.

func GetBoolValue

func GetBoolValue(values helm.Values, key string) (bool, error)

GetBoolValue returns the value of the specified key as boolean. Returns error if the key is not boolean.

func GetStringValue

func GetStringValue(values helm.Values, key string) (string, error)

GetStringValue returns the value of the specified key as string. Returns error if the key is not string.

func GetTemplate

func GetTemplate(adapter CustomResourceAdapter) (helm.Template, error)

GetTemplate ensures that only one instance of Helm template exists per deployment and it is rendered only when needed, e.g. it has changed.

func GitalyConfigMap

func GitalyConfigMap(adapter CustomResourceAdapter) *corev1.ConfigMap

GitalyConfigMap returns the ConfigMap of Gitaly component.

func GitalyService

func GitalyService(adapter CustomResourceAdapter) *corev1.Service

GitalyService returns the Service of GitLab Shell component.

func GitalyStatefulSet

func GitalyStatefulSet(adapter CustomResourceAdapter) *appsv1.StatefulSet

GitalyStatefulSet returns the StatefulSet of Gitaly component.

func MigrationsConfigMap

func MigrationsConfigMap(adapter CustomResourceAdapter) *corev1.ConfigMap

MigrationsConfigMap returns the ConfigMaps of Migrations component.

func MigrationsJob

func MigrationsJob(adapter CustomResourceAdapter) (*batchv1.Job, error)

MigrationsJob returns the Job for Migrations component.

func PostgresConfigMap

func PostgresConfigMap(adapter CustomResourceAdapter) *corev1.ConfigMap

PostgresConfigMap returns the ConfigMap of the PostgreSQL component.

func PostgresServices

func PostgresServices(adapter CustomResourceAdapter) []*corev1.Service

PostgresServices returns the Services of the Postgres component.

func PostgresStatefulSet

func PostgresStatefulSet(adapter CustomResourceAdapter) *appsv1.StatefulSet

PostgresStatefulSet returns the StatefulSet of the PostgreSQL component.

func RedisConfigMaps

func RedisConfigMaps(adapter CustomResourceAdapter) []*corev1.ConfigMap

RedisConfigMaps returns the ConfigMaps of the Redis component.

func RedisServices

func RedisServices(adapter CustomResourceAdapter) []*corev1.Service

RedisServices returns the Services of the Redis component.

func RedisStatefulSet

func RedisStatefulSet(adapter CustomResourceAdapter) *appsv1.StatefulSet

RedisStatefulSet returns the Statefulset of the Redis component.

func RegistryConfigMap

func RegistryConfigMap(adapter CustomResourceAdapter) *corev1.ConfigMap

RegistryConfigMap returns the ConfigMap of the Registry component.

func RegistryDeployment

func RegistryDeployment(adapter CustomResourceAdapter) *appsv1.Deployment

RegistryDeployment returns the Deployment of the Registry component.

func RegistryIngress

func RegistryIngress(adapter CustomResourceAdapter) *extensionsv1beta1.Ingress

RegistryIngress returns the Ingress of the Registry component.

func RegistryService

func RegistryService(adapter CustomResourceAdapter) *corev1.Service

RegistryService returns the Service of the Registry component.

func SelfSignedCertsJob

func SelfSignedCertsJob(adapter CustomResourceAdapter) (*batchv1.Job, error)

SelfSignedCertsJob returns the Job for Self Signed Certificates component.

func SharedSecretsConfigMap

func SharedSecretsConfigMap(adapter CustomResourceAdapter) (*corev1.ConfigMap, error)

SharedSecretsConfigMap returns the ConfigMaps of Shared Secret component.

func SharedSecretsJob

func SharedSecretsJob(adapter CustomResourceAdapter) (*batchv1.Job, error)

SharedSecretsJob returns the Job for Shared Secret component.

func SharedSecretsJobTimeout

func SharedSecretsJobTimeout() time.Duration

SharedSecretsJobTimeout returns the timeout for shared secrets job to finish.

func SharedSecretsJobWaitPeriod

func SharedSecretsJobWaitPeriod(timeout, elapsed time.Duration) time.Duration

SharedSecretsJobWaitPeriod returns the wait time next check of shared secrets job status.

func SharedSecretsResources

func SharedSecretsResources(adapter CustomResourceAdapter) (*corev1.ConfigMap, *batchv1.Job, error)

SharedSecretsResources returns Kubernetes resources for running shared secrets job.

func ShellConfigMaps

func ShellConfigMaps(adapter CustomResourceAdapter) []*corev1.ConfigMap

ShellConfigMaps returns the ConfigMaps of GitLab Shell component.

func ShellDeployment

func ShellDeployment(adapter CustomResourceAdapter) *appsv1.Deployment

ShellDeployment returns the Deployment of GitLab Shell component.

func ShellService

func ShellService(adapter CustomResourceAdapter) *corev1.Service

ShellService returns the Service of GitLab Shell component.

func SidekiqConfigMaps

func SidekiqConfigMaps(adapter CustomResourceAdapter) []*corev1.ConfigMap

SidekiqConfigMaps returns the ConfigMaps of the Sidekiq component.

func SidekiqDeployment

func SidekiqDeployment(adapter CustomResourceAdapter) *appsv1.Deployment

SidekiqDeployment returns the Deployment of the Sidekiq component.

func TaskRunnerConfigMap

func TaskRunnerConfigMap(adapter CustomResourceAdapter) *corev1.ConfigMap

TaskRunnerConfigMap returns the ConfigMaps of the Task Runner component.

func TaskRunnerDeployment

func TaskRunnerDeployment(adapter CustomResourceAdapter) *appsv1.Deployment

TaskRunnerDeployment returns the Deployment of the Task Runner component.

func WebserviceConfigMaps

func WebserviceConfigMaps(adapter CustomResourceAdapter) []*corev1.ConfigMap

WebserviceConfigMaps returns the ConfigMaps for the Webservice component.

func WebserviceDeployment

func WebserviceDeployment(adapter CustomResourceAdapter) *appsv1.Deployment

WebserviceDeployment returns the Deployment for the Webservice component.

func WebserviceIngress

func WebserviceIngress(adapter CustomResourceAdapter) *extensionsv1beta1.Ingress

WebserviceIngress returns the Ingress for the Webservice component.

func WebserviceService

func WebserviceService(adapter CustomResourceAdapter) *corev1.Service

WebserviceService returns the Service for the Webservice component.

Types

type CustomResourceAdapter

type CustomResourceAdapter interface {
	// Resource returns the reference to the underlaying Custom Resource.
	Resource() *gitlabv1beta1.GitLab

	// Hash generates a hash based on the key parts of a GitLab Custom Resource. The hash can be used
	// to identify changes to the underlaying resource. For example this is useful when rendering a
	// Helm template.
	Hash() string

	// Reference returns a fully qualified name of the associated GitLab Custom Resource. As opposed
	// to Hash this value does not change.
	Reference() string

	// Namespace returns the namespace in which the GitLab instance must be deployed. When Operator
	// is scoped to
	// a namespace this must be equal to the namespace of the Operator.
	Namespace() string

	// ReleaseName returns the name of the GitLab instance that must be deployed. This will be used
	// as a qualifier to distinguish between multiple GitLab instances in a namespace.
	ReleaseName() string

	// ChartVersion returns the version of GitLab chart that must be used to deploy this GitLab
	// instance.
	ChartVersion() string

	// Values returns the set of values that will be used the render GitLab chart.
	Values() helm.Values
}

CustomResourceAdapter is a wrapper for GitLab Custom Resource. It provides a convenient interface to interact with the GitLab instances and guards the controller from its structural changes.

This adapter is immutable and will not update itself after initialization. Therefore, it must be created when GitLab Custom Resource changes, e.g. in reconcile loop.

func NewCustomResourceAdapter

func NewCustomResourceAdapter(gitlab *gitlabv1beta1.GitLab) CustomResourceAdapter

NewCustomResourceAdapter returns a new adapter for the provided GitLab instance.

Jump to

Keyboard shortcuts

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