Documentation ¶
Index ¶
- Constants
- Variables
- func AdminRoute(adapter gitlab.CustomResourceAdapter) *routev1.Route
- func AppConfigConnectionSecret(adapter gitlab.CustomResourceAdapter, minioSecret corev1.Secret) (*corev1.Secret, error)
- func BucketCreationJob(adapter gitlab.CustomResourceAdapter) *batchv1.Job
- func CertificateIssuer(adapter gitlab.CustomResourceAdapter) *certmanagerv1alpha2.Issuer
- func ConfigMapData(name, namespace string) (map[string]string, error)
- func ConfigMapWithHash(cm *corev1.ConfigMap)
- func DeploymentConfigMaps(deploy *appsv1.Deployment) []string
- func EncodeString(message string) string
- func EndpointAnnotations(adapter gitlab.CustomResourceAdapter, annotate bool) map[string]string
- func ExporterServiceMonitor(cr *gitlabv1beta1.GitLab) *monitoringv1.ServiceMonitor
- func ExposePrometheusCluster(cr *gitlabv1beta1.GitLab) *corev1.Service
- func GenericConfigMap(name, namespace string, labels map[string]string) *corev1.ConfigMap
- func GenericCronJob(component Component) *batchv1beta1.CronJob
- func GenericDeployment(component Component) *appsv1.Deployment
- func GenericJob(component Component) *batchv1.Job
- func GenericSecret(name, namespace string, labels map[string]string) *corev1.Secret
- func GenericStatefulSet(component Component) *appsv1.StatefulSet
- func GetDeploymentPods(kclient client.Client, name, namespace string) (result []corev1.Pod, err error)
- func GetIssuerConfig(adapter gitlab.CustomResourceAdapter) certmanagerv1alpha2.IssuerConfig
- func GetLabelSet(cr *gitlabv1beta1.GitLab) labels.Set
- func GetSecretValue(client client.Client, namespace, secret, key string) (string, error)
- func GitalyServiceMonitor(cr *gitlabv1beta1.GitLab) *monitoringv1.ServiceMonitor
- func HorizontalAutoscaler(deployment *appsv1.Deployment, cr *gitlabv1beta1.GitLab) *autoscalingv1.HorizontalPodAutoscaler
- func IsEmailAddress(email string) bool
- func IsMinioAvailable() bool
- func IsOpenshift() bool
- func IsPodRunning(pod *corev1.Pod) bool
- func IsPrometheusSupported() bool
- func Label(resource, component, resourceType string) map[string]string
- func MainRoute(adapter gitlab.CustomResourceAdapter) *routev1.Route
- func MinioIngress(adapter gitlab.CustomResourceAdapter) *extensionsv1beta1.Ingress
- func MinioScriptConfigMap(adapter gitlab.CustomResourceAdapter) *corev1.ConfigMap
- func MinioSecret(adapter gitlab.CustomResourceAdapter) *corev1.Secret
- func MinioService(adapter gitlab.CustomResourceAdapter) *corev1.Service
- func MinioStatefulSet(adapter gitlab.CustomResourceAdapter) *appsv1.StatefulSet
- func Password(options PasswordOptions) string
- func PostgresqlServiceMonitor(cr *gitlabv1beta1.GitLab) *monitoringv1.ServiceMonitor
- func PrometheusCluster(cr *gitlabv1beta1.GitLab) *monitoringv1.Prometheus
- func ReadConfig(filename string) string
- func RedisServiceMonitor(cr *gitlabv1beta1.GitLab) *monitoringv1.ServiceMonitor
- func RegistryConnectionSecret(adapter gitlab.CustomResourceAdapter, minioSecret corev1.Secret) (*corev1.Secret, error)
- func RegistryRoute(adapter gitlab.CustomResourceAdapter) *routev1.Route
- func RemoveEmptyLines(block string) string
- func ResourceQuantity(request string) resource.Quantity
- func SecretData(name, namespace string) (map[string]string, error)
- func ServiceAccount(name, namespace string) *corev1.ServiceAccount
- func TaskRunnerConnectionSecret(adapter gitlab.CustomResourceAdapter, minioSecret corev1.Secret) *corev1.Secret
- func WebserviceServiceMonitor(cr *gitlabv1beta1.GitLab) *monitoringv1.ServiceMonitor
- type Component
- type ConfigurationOptions
- type EndpointTLS
- type Image
- type KubeConfig
- type ObjectStoreOptions
- type PasswordOptions
- type Release
- func (r *Release) Busybox() string
- func (r *Release) Certificates() string
- func (r *Release) GitLabExporter() string
- func (r *Release) Gitaly() string
- func (r *Release) IsDefault() bool
- func (r *Release) MiniDebian() string
- func (r *Release) Minio() string
- func (r *Release) MinioClient() string
- func (r *Release) Postgresql() string
- func (r *Release) PostgresqlExporter() string
- func (r *Release) Redis() string
- func (r *Release) RedisExporter() string
- func (r *Release) Registry() string
- func (r *Release) Shell() string
- func (r *Release) Sidekiq() string
- func (r *Release) TaskRunner() string
- func (r *Release) Webservice() string
- func (r *Release) Workhorse() string
- type ResourceLabels
Constants ¶
const (
// GitlabType represents resource of type Gitlab
GitlabType = "gitlab"
)
Variables ¶
var ( // ConfigMapDefaultMode for configmap projected volume ConfigMapDefaultMode int32 = 420 // ExecutableDefaultMode for configmap projected volume ExecutableDefaultMode int32 = 493 // ProjectedVolumeDefaultMode for projected volume ProjectedVolumeDefaultMode int32 = 256 // SecretDefaultMode for secret projected volume SecretDefaultMode int32 = 288 )
Functions ¶
func AdminRoute ¶
func AdminRoute(adapter gitlab.CustomResourceAdapter) *routev1.Route
AdminRoute returns GitLab admin route
func AppConfigConnectionSecret ¶
func AppConfigConnectionSecret(adapter gitlab.CustomResourceAdapter, minioSecret corev1.Secret) (*corev1.Secret, error)
AppConfigConnectionSecret returns secret containing MinIO connection config for `global.appConfig.object_store.connection.secret`.
func BucketCreationJob ¶
func BucketCreationJob(adapter gitlab.CustomResourceAdapter) *batchv1.Job
BucketCreationJob creates the buckets used by GitLab
func CertificateIssuer ¶
func CertificateIssuer(adapter gitlab.CustomResourceAdapter) *certmanagerv1alpha2.Issuer
CertificateIssuer create a certificate generator
func ConfigMapData ¶
ConfigMapData returns data contained in a configmap
func ConfigMapWithHash ¶
ConfigMapWithHash updates configmap with annotation containing a SHA256 hash of its data
func DeploymentConfigMaps ¶
func DeploymentConfigMaps(deploy *appsv1.Deployment) []string
DeploymentConfigMaps returns a list of configmaps used in a deployment
func EncodeString ¶
EncodeString accepts strings and returns a base64 encoded string
func EndpointAnnotations ¶
func EndpointAnnotations(adapter gitlab.CustomResourceAdapter, annotate bool) map[string]string
EndpointAnnotations generates annotation for ingresses
func ExporterServiceMonitor ¶
func ExporterServiceMonitor(cr *gitlabv1beta1.GitLab) *monitoringv1.ServiceMonitor
ExporterServiceMonitor returns the GitLab exporter service monitor
func ExposePrometheusCluster ¶
func ExposePrometheusCluster(cr *gitlabv1beta1.GitLab) *corev1.Service
ExposePrometheusCluster creates a service for Prometheus
func GenericConfigMap ¶
GenericConfigMap returns empty configmap
func GenericCronJob ¶
func GenericCronJob(component Component) *batchv1beta1.CronJob
GenericCronJob returns a kubernetes CronJob
func GenericDeployment ¶
func GenericDeployment(component Component) *appsv1.Deployment
GenericDeployment returns a generic deployment
func GenericJob ¶
GenericJob returns a Kubernetes Job
func GenericSecret ¶
GenericSecret returns empty secret
func GenericStatefulSet ¶
func GenericStatefulSet(component Component) *appsv1.StatefulSet
GenericStatefulSet returns a generic k8s statefulset
func GetDeploymentPods ¶
func GetDeploymentPods(kclient client.Client, name, namespace string) (result []corev1.Pod, err error)
GetDeploymentPods returns the pods that belong to a given deployment
func GetIssuerConfig ¶
func GetIssuerConfig(adapter gitlab.CustomResourceAdapter) certmanagerv1alpha2.IssuerConfig
GetIssuerConfig gets the ACME issuer to use from GitLab resource
func GetLabelSet ¶
func GetLabelSet(cr *gitlabv1beta1.GitLab) labels.Set
func GetSecretValue ¶
GetSecretValue returns the value for a key from an existing secret
func GitalyServiceMonitor ¶
func GitalyServiceMonitor(cr *gitlabv1beta1.GitLab) *monitoringv1.ServiceMonitor
GitalyServiceMonitor returns the Gitaly service monitor
func HorizontalAutoscaler ¶
func HorizontalAutoscaler(deployment *appsv1.Deployment, cr *gitlabv1beta1.GitLab) *autoscalingv1.HorizontalPodAutoscaler
HorizontalAutoscaler return HPA for deployment passed
func IsEmailAddress ¶
IsEmailAddress evaluates a string and returns true if a valid email address. False is otherwise returned
func IsMinioAvailable ¶
func IsMinioAvailable() bool
IsMinioAvailable checks if Minio API provided by minio operator is present
func IsOpenshift ¶
func IsOpenshift() bool
IsOpenshift check if API has the API route.openshift.io/v1, then it is considered an openshift environment
func IsPodRunning ¶
IsPodRunning function tells user if pod is running
func IsPrometheusSupported ¶
func IsPrometheusSupported() bool
IsPrometheusSupported checks for Prometheus API endpoint
func MainRoute ¶
func MainRoute(adapter gitlab.CustomResourceAdapter) *routev1.Route
MainRoute returns main GitLab application route
func MinioIngress ¶
func MinioIngress(adapter gitlab.CustomResourceAdapter) *extensionsv1beta1.Ingress
MinioIngress returns the Ingress that exposes MinIO.
func MinioScriptConfigMap ¶
func MinioScriptConfigMap(adapter gitlab.CustomResourceAdapter) *corev1.ConfigMap
MinioScriptConfigMap returns scripts used to configure Minio
func MinioSecret ¶
func MinioSecret(adapter gitlab.CustomResourceAdapter) *corev1.Secret
MinioSecret returns secret containing Minio accesskey and secretkey
func MinioService ¶
func MinioService(adapter gitlab.CustomResourceAdapter) *corev1.Service
MinioService returns service that exposes Minio
func MinioStatefulSet ¶
func MinioStatefulSet(adapter gitlab.CustomResourceAdapter) *appsv1.StatefulSet
MinioStatefulSet return Minio statefulset
func Password ¶
func Password(options PasswordOptions) string
Password creates an password string based on the password options provided
func PostgresqlServiceMonitor ¶
func PostgresqlServiceMonitor(cr *gitlabv1beta1.GitLab) *monitoringv1.ServiceMonitor
PostgresqlServiceMonitor returns the Postgres service monitor
func PrometheusCluster ¶
func PrometheusCluster(cr *gitlabv1beta1.GitLab) *monitoringv1.Prometheus
PrometheusCluster returns a prometheus cluster object TODO: receive replicas from user input
func ReadConfig ¶
ReadConfig returns contents of file as string
func RedisServiceMonitor ¶
func RedisServiceMonitor(cr *gitlabv1beta1.GitLab) *monitoringv1.ServiceMonitor
RedisServiceMonitor returns the Redis service monitor
func RegistryConnectionSecret ¶
func RegistryConnectionSecret(adapter gitlab.CustomResourceAdapter, minioSecret corev1.Secret) (*corev1.Secret, error)
RegistryConnectionSecret returns secret containing MinIO connection config for `registry.storage.secret`.
func RegistryRoute ¶
func RegistryRoute(adapter gitlab.CustomResourceAdapter) *routev1.Route
RegistryRoute returns GitLab registry route
func RemoveEmptyLines ¶
RemoveEmptyLines removes empty lines from block string
func ResourceQuantity ¶
ResourceQuantity returns quantity requested for resource
func SecretData ¶
SecretData gets a secret by name and returns its data
func ServiceAccount ¶
func ServiceAccount(name, namespace string) *corev1.ServiceAccount
ServiceAccount returns service account to be used by pods
func TaskRunnerConnectionSecret ¶
func TaskRunnerConnectionSecret(adapter gitlab.CustomResourceAdapter, minioSecret corev1.Secret) *corev1.Secret
TaskRunnerConnectionSecret returns secret containing MinIO connection config for `global.task-runner.backups.objectStorage.config.secret`.
func WebserviceServiceMonitor ¶
func WebserviceServiceMonitor(cr *gitlabv1beta1.GitLab) *monitoringv1.ServiceMonitor
WebserviceServiceMonitor returns the Webservice service monitor
Types ¶
type Component ¶
type Component struct { // Namespace of the component Namespace string // Defines the number of pods for the // component to be created Replicas int32 // Labels for the component Labels map[string]string // InitContainers contains a list of containers that may // need to run before the main application container starts up InitContainers []corev1.Container // Containers containers a list of containers that make up a pod Containers []corev1.Container // Contains a list of volumes used by the containers Volumes []corev1.Volume // Defines volume claims to be used by a statefulset VolumeClaimTemplates []corev1.PersistentVolumeClaim }
Component represents an application / micro-service that makes part of a larger application
type ConfigurationOptions ¶
type ConfigurationOptions struct { // ObjectStore defines object that describes values // for the S3 compatible storage service ObjectStore ObjectStoreOptions }
ConfigurationOptions holds options used to configure the different GitLab components
func SystemBuildOptions ¶
func SystemBuildOptions(adapter gitlab.CustomResourceAdapter) ConfigurationOptions
SystemBuildOptions retrieves options from the Gitlab custom resource and uses them to build configuration options used to deploy the Gitlab instance
type EndpointTLS ¶
type EndpointTLS struct {
// contains filtered or unexported fields
}
EndpointTLS informs which services require to be secured using generated TLS certificates
func RequiresCertManagerCertificate ¶
func RequiresCertManagerCertificate(adapter gitlab.CustomResourceAdapter) EndpointTLS
RequiresCertManagerCertificate function returns true an administrator did not provide a TLS ceritificate for an endpoint
func (EndpointTLS) Any ¶
func (ep EndpointTLS) Any() bool
Any returns true if any ingress requires a cert-manager certificate
func (EndpointTLS) GitLab ¶
func (ep EndpointTLS) GitLab() bool
GitLab returns true if GitLab endpoint requires a cert-manager provisioned certificate
func (EndpointTLS) Minio ¶
func (ep EndpointTLS) Minio() bool
Minio returns true if Minio endpoint requires a cert-manager provisioned certificate
func (EndpointTLS) Registry ¶
func (ep EndpointTLS) Registry() bool
Registry returns true if Registry endpoint requires a cert-manager provisioned certificate
type KubeConfig ¶
KubeConfig returns kubernetes client configuration
func KubernetesConfig ¶
func KubernetesConfig() KubeConfig
KubernetesConfig returns kubernetes client config
func (KubeConfig) NewKubernetesClient ¶
func (k KubeConfig) NewKubernetesClient() (*kubernetes.Clientset, error)
NewKubernetesClient returns a client that can be used to interact with the kubernetes api
type ObjectStoreOptions ¶
type ObjectStoreOptions struct { // URL defines address for development // S3 storage service URL string // Endpoint defines the URL the API endpoint // including the protocol Endpoint string // Credentials is the name of the secret // that contains the 'accesskey' and 'secretkey' Credentials string // Capacity of the volume to be used by the development // minio instance Capacity string }
ObjectStoreOptions defines properties for the S3 storage used by GitLab
type PasswordOptions ¶
type PasswordOptions struct { // Length defines desired password length Length int // EnableSpecialCharacters adds special characters // to generated passwords EnableSpecialChars bool }
PasswordOptions provides parameters to be used when generating passwords
type Release ¶
type Release struct { Version string `json:"version" yaml:"version"` Default bool `json:"default,omitempty" yaml:"default,omitempty"` Images []Image `json:"images" yaml:"images"` }
Release defines a GitLab release
func (*Release) Certificates ¶
Certificates return certificates container image
func (*Release) GitLabExporter ¶
GitLabExporter return GitLab exporter container image
func (*Release) MiniDebian ¶
MiniDebian return mini debian container image
func (*Release) MinioClient ¶
MinioClient return minio client container image
func (*Release) Postgresql ¶
Postgresql return postgresql container image
func (*Release) PostgresqlExporter ¶
PostgresqlExporter return postgres exporter container image
func (*Release) RedisExporter ¶
RedisExporter return redis exporter container image
func (*Release) TaskRunner ¶
TaskRunner return task runner container image
func (*Release) Webservice ¶
Webservice return webservice container image
type ResourceLabels ¶
ResourceLabels type encapsulates map[string]string
func (ResourceLabels) GetName ¶
func (l ResourceLabels) GetName() string
GetName returns the name of resource based on instance label