Documentation ¶
Overview ¶
Package controllers provides controller functions
Index ¶
- Constants
- Variables
- func AddGitConnection(cfg *ini.File, name string, baseurl string, poolDelay int32)
- func AddWebClientSection(cfg *ini.File)
- func AppendCorporateCACertsVolumeMount(volumeMounts []apiv1.VolumeMount, volumeName string) []apiv1.VolumeMount
- func BaseGetStorageConfOrDefault(storageSpec sfv1.StorageSpec, storageDefault sfv1.StorageDefaultSpec) base.StorageConfig
- func DumpConfigINI(cfg *ini.File) string
- func GetConfigContextOrDie(contextName string) *rest.Config
- func GetValueFromKeySecret(secret apiv1.Secret, keyname string) ([]byte, error)
- func LoadConfigINI(zuulConf string) *ini.File
- func Main(ns string, metricsAddr string, probeAddr string, enableLeaderElection bool, ...)
- func Standalone(sf sfv1.SoftwareFactory, ns string, kubeContext string) error
- type LogServerReconciler
- type SFController
- func (r *SFController) AddDefaultConnections(cfg *ini.File, gitServerURL string)
- func (r *SFController) AddElasticSearchConnection(cfg *ini.File, conn sfv1.ElasticSearchConnection)
- func (r *SFController) AddGerritConnection(cfg *ini.File, conn sfv1.GerritConnection)
- func (r *SFController) AddGitHubConnection(cfg *ini.File, conn sfv1.GitHubConnection)
- func (r *SFController) AddGitLabConnection(cfg *ini.File, conn sfv1.GitLabConnection)
- func (r *SFController) AddOIDCAuthenticator(cfg *ini.File, authenticator sfv1.ZuulOIDCAuthenticatorSpec)
- func (r *SFController) AddPagureConnection(cfg *ini.File, conn sfv1.PagureConnection)
- func (r *SFController) AddSMTPConnection(cfg *ini.File, conn sfv1.SMTPConnection)
- func (r *SFController) CreateDBInitContainer(username string, password string, dbname string) apiv1.Container
- func (r *SFController) CreateProvisionDBJob(database string, password string) batchv1.Job
- func (r *SFController) DBPostInit(configSecret apiv1.Secret) apiv1.Secret
- func (r *SFController) DebugService(debugService string)
- func (r *SFController) DeployGitServer() bool
- func (r *SFController) DeployHTTPDGateway() bool
- func (r *SFController) DeployLogserver() bool
- func (r *SFController) DeployMariadb() bool
- func (r *SFController) DeployNodepool() map[string]bool
- func (r *SFController) DeployNodepoolBuilder(statsdExporterVolume apiv1.Volume, nodepoolStatsdMappingConfig string, ...) bool
- func (r *SFController) DeployNodepoolLauncher(statsdExporterVolume apiv1.Volume, nodepoolStatsdMappingConfig string, ...) bool
- func (r *SFController) DeployZookeeper() bool
- func (r *SFController) DeployZuul() bool
- func (r *SFController) DeployZuulSecrets()
- func (r *SFController) EnsureDiskUsagePromRule(ruleGroups []monitoringv1.RuleGroup) bool
- func (r *SFController) EnsureLogJuicer() bool
- func (r *SFController) EnsureSFPodMonitor(ports []string, selector metav1.LabelSelector) bool
- func (r *SFController) EnsureZuulComponents() bool
- func (r *SFController) EnsureZuulComponentsFrontServices()
- func (r *SFController) EnsureZuulConfigSecret(skipDBSettings bool, skipAuthSettings bool) *ini.File
- func (r *SFController) EnsureZuulExecutor(cfg *ini.File) bool
- func (r *SFController) EnsureZuulExecutorService()
- func (r *SFController) EnsureZuulMerger(cfg *ini.File) bool
- func (r *SFController) EnsureZuulScheduler(cfg *ini.File) bool
- func (r *SFController) EnsureZuulWeb(cfg *ini.File) bool
- func (r *SFController) EnsureZuulWeeder(checksum string) bool
- func (r *SFController) InstallTooling()
- func (r *SFController) IsExecutorEnabled() bool
- func (r *SFController) IsExternalExecutorEnabled() bool
- func (r *SFController) MkClientDNSNames(serviceName string) []string
- func (r *SFController) MkPreInitScript() string
- func (r *SFController) RunCommand(name string, args []string, extraVars []apiv1.EnvVar) *batchv1.Job
- func (r *SFController) SetupBaseSecrets(internalTenantSecretsVersion string) bool
- func (r *SFController) SetupConfigJob() bool
- func (r *SFController) Step() sfv1.SoftwareFactoryStatus
- type SFUtilContext
- func (r *SFUtilContext) CorporateCAConfigMapExists() (apiv1.ConfigMap, bool)
- func (r *SFUtilContext) CreateR(obj client.Object)
- func (r *SFUtilContext) DebugStatefulSet(name string)
- func (r *SFUtilContext) DeleteR(obj client.Object)
- func (r *SFUtilContext) EnsureConfigMap(baseName string, data map[string]string) apiv1.ConfigMap
- func (r *SFUtilContext) EnsureLocalCA()
- func (r *SFUtilContext) EnsureSSHKeySecret(name string)
- func (r *SFUtilContext) EnsureSecret(secret *apiv1.Secret)
- func (r *SFUtilContext) EnsureSecretUUID(name string) apiv1.Secret
- func (r *SFUtilContext) EnsureService(service *apiv1.Service)
- func (r *SFUtilContext) GetConfigMap(name string) (apiv1.ConfigMap, error)
- func (r *SFUtilContext) GetM(name string, obj client.Object) bool
- func (r *SFUtilContext) GetOrCreate(obj client.Object) bool
- func (r *SFUtilContext) GetSecret(name string) (apiv1.Secret, error)
- func (r *SFUtilContext) GetSecretDataFromKey(name string, key string) ([]byte, error)
- func (r *SFUtilContext) IsDeploymentReady(dep *appsv1.Deployment) bool
- func (r *SFUtilContext) IsStatefulSetReady(dep *appsv1.StatefulSet) bool
- func (r *SFUtilContext) PatchR(obj client.Object, patch client.Patch)
- func (r *SFUtilContext) PodExec(pod string, container string, command []string) error
- func (r *SFUtilContext) UpdateR(obj client.Object) bool
- type SoftwareFactoryReconciler
- func (r *SoftwareFactoryReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *SoftwareFactoryReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *SoftwareFactoryReconciler) StandaloneReconcile(ctx context.Context, ns string, sf sfv1.SoftwareFactory) error
- type ZuulDBOpts
Constants ¶
const ( MariaDBIdent = "mariadb" MariadbAdminPass = "mariadb-root-password" )
const ( LauncherIdent = nodepoolIdent + "-launcher" BuildLogsHttpdPortName = "buildlogs-http" NodepoolProvidersSecretsName = "nodepool-providers-secrets" BuilderIdent = nodepoolIdent + "-builder" )
const ( CustomSSLSecretName = "sf-ssl-cert" CorporateCACerts = "corporate-ca-certs" UpdateCATrustAnchorsPath = "/usr/share/pki/ca-trust-source/anchors/" UpdateCATrustCommand = "set -x && mkdir -p /etc/pki/ca-trust/extracted/{pem,java,edk2,openssl} && update-ca-trust" )
const ( ZuulPrometheusPortName = "zuul-metrics" ZuulSchedulerIdent = "zuul-scheduler" ZuulKeystorePasswordName = "zuul-keystore-password" )
const GitServerIdent = "git-server"
const GitServerIdentRW = "git-server-rw"
const ZookeeperIdent = "zookeeper"
Variables ¶
var NodepoolStatsdExporterPortName = monitoring.GetStatsdExporterPort(shortIdent)
var SetupLog = setupLog
var (
ZuulStatsdExporterPortName = monitoring.GetStatsdExporterPort("zuul")
)
Functions ¶
func AddGitConnection ¶
func AddWebClientSection ¶
func AppendCorporateCACertsVolumeMount ¶ added in v0.0.21
func AppendCorporateCACertsVolumeMount(volumeMounts []apiv1.VolumeMount, volumeName string) []apiv1.VolumeMount
func BaseGetStorageConfOrDefault ¶
func BaseGetStorageConfOrDefault(storageSpec sfv1.StorageSpec, storageDefault sfv1.StorageDefaultSpec) base.StorageConfig
BaseGetStorageConfOrDefault sets the default storageClassName
func DumpConfigINI ¶
func GetConfigContextOrDie ¶
func GetValueFromKeySecret ¶
GetValueFromKeySecret gets the Value of the Keyname from a Secret
func LoadConfigINI ¶
func Standalone ¶
func Standalone(sf sfv1.SoftwareFactory, ns string, kubeContext string) error
Types ¶
type LogServerReconciler ¶
type SFController ¶
type SFController struct { SFUtilContext // contains filtered or unexported fields }
func (*SFController) AddDefaultConnections ¶
func (r *SFController) AddDefaultConnections(cfg *ini.File, gitServerURL string)
func (*SFController) AddElasticSearchConnection ¶
func (r *SFController) AddElasticSearchConnection(cfg *ini.File, conn sfv1.ElasticSearchConnection)
func (*SFController) AddGerritConnection ¶
func (r *SFController) AddGerritConnection(cfg *ini.File, conn sfv1.GerritConnection)
func (*SFController) AddGitHubConnection ¶
func (r *SFController) AddGitHubConnection(cfg *ini.File, conn sfv1.GitHubConnection)
func (*SFController) AddGitLabConnection ¶
func (r *SFController) AddGitLabConnection(cfg *ini.File, conn sfv1.GitLabConnection)
func (*SFController) AddOIDCAuthenticator ¶
func (r *SFController) AddOIDCAuthenticator(cfg *ini.File, authenticator sfv1.ZuulOIDCAuthenticatorSpec)
func (*SFController) AddPagureConnection ¶
func (r *SFController) AddPagureConnection(cfg *ini.File, conn sfv1.PagureConnection)
func (*SFController) AddSMTPConnection ¶ added in v0.0.37
func (r *SFController) AddSMTPConnection(cfg *ini.File, conn sfv1.SMTPConnection)
func (*SFController) CreateDBInitContainer ¶
func (*SFController) CreateProvisionDBJob ¶
func (r *SFController) CreateProvisionDBJob(database string, password string) batchv1.Job
func (*SFController) DBPostInit ¶
func (r *SFController) DBPostInit(configSecret apiv1.Secret) apiv1.Secret
func (*SFController) DebugService ¶
func (r *SFController) DebugService(debugService string)
func (*SFController) DeployGitServer ¶
func (r *SFController) DeployGitServer() bool
func (*SFController) DeployHTTPDGateway ¶ added in v0.0.28
func (r *SFController) DeployHTTPDGateway() bool
func (*SFController) DeployLogserver ¶ added in v0.0.28
func (r *SFController) DeployLogserver() bool
func (*SFController) DeployMariadb ¶
func (r *SFController) DeployMariadb() bool
func (*SFController) DeployNodepool ¶
func (r *SFController) DeployNodepool() map[string]bool
func (*SFController) DeployNodepoolBuilder ¶
func (r *SFController) DeployNodepoolBuilder(statsdExporterVolume apiv1.Volume, nodepoolStatsdMappingConfig string, initialVolumeMounts []apiv1.VolumeMount, providersSecrets apiv1.Secret, providerSecretsExists bool) bool
func (*SFController) DeployNodepoolLauncher ¶
func (r *SFController) DeployNodepoolLauncher(statsdExporterVolume apiv1.Volume, nodepoolStatsdMappingConfig string, initialVolumeMounts []apiv1.VolumeMount, providersSecrets apiv1.Secret, providerSecretsExists bool) bool
func (*SFController) DeployZookeeper ¶
func (r *SFController) DeployZookeeper() bool
func (*SFController) DeployZuul ¶
func (r *SFController) DeployZuul() bool
func (*SFController) DeployZuulSecrets ¶
func (r *SFController) DeployZuulSecrets()
func (*SFController) EnsureDiskUsagePromRule ¶
func (r *SFController) EnsureDiskUsagePromRule(ruleGroups []monitoringv1.RuleGroup) bool
EnsureDiskUsagePromRule sync Prometheus Rules
func (*SFController) EnsureLogJuicer ¶ added in v0.0.39
func (r *SFController) EnsureLogJuicer() bool
func (*SFController) EnsureSFPodMonitor ¶
func (r *SFController) EnsureSFPodMonitor(ports []string, selector metav1.LabelSelector) bool
EnsureSFPodMonitor Create or Updates Software Factory Monitor for metrics
func (*SFController) EnsureZuulComponents ¶
func (r *SFController) EnsureZuulComponents() bool
func (*SFController) EnsureZuulComponentsFrontServices ¶
func (r *SFController) EnsureZuulComponentsFrontServices()
func (*SFController) EnsureZuulConfigSecret ¶
func (r *SFController) EnsureZuulConfigSecret(skipDBSettings bool, skipAuthSettings bool) *ini.File
EnsureZuulConfigSecret build and install the zuul.conf Secret resource If the resource cannot be built then the returned value is nil
func (*SFController) EnsureZuulExecutor ¶
func (r *SFController) EnsureZuulExecutor(cfg *ini.File) bool
func (*SFController) EnsureZuulExecutorService ¶ added in v0.0.27
func (r *SFController) EnsureZuulExecutorService()
func (*SFController) EnsureZuulMerger ¶
func (r *SFController) EnsureZuulMerger(cfg *ini.File) bool
func (*SFController) EnsureZuulScheduler ¶
func (r *SFController) EnsureZuulScheduler(cfg *ini.File) bool
func (*SFController) EnsureZuulWeb ¶
func (r *SFController) EnsureZuulWeb(cfg *ini.File) bool
func (*SFController) EnsureZuulWeeder ¶ added in v0.0.39
func (r *SFController) EnsureZuulWeeder(checksum string) bool
func (*SFController) InstallTooling ¶
func (r *SFController) InstallTooling()
func (*SFController) IsExecutorEnabled ¶ added in v0.0.25
func (r *SFController) IsExecutorEnabled() bool
func (*SFController) IsExternalExecutorEnabled ¶ added in v0.0.27
func (r *SFController) IsExternalExecutorEnabled() bool
func (*SFController) MkClientDNSNames ¶
func (r *SFController) MkClientDNSNames(serviceName string) []string
MkClientDNSNames returns an array of DNS Names
func (*SFController) MkPreInitScript ¶
func (r *SFController) MkPreInitScript() string
func (*SFController) RunCommand ¶
func (*SFController) SetupBaseSecrets ¶
func (r *SFController) SetupBaseSecrets(internalTenantSecretsVersion string) bool
SetupBaseSecrets returns true when the Job that set the zuul secret in the system-config repository is done
func (*SFController) SetupConfigJob ¶
func (r *SFController) SetupConfigJob() bool
func (*SFController) Step ¶
func (r *SFController) Step() sfv1.SoftwareFactoryStatus
type SFUtilContext ¶
type SFUtilContext struct { Client client.Client Scheme *runtime.Scheme RESTClient rest.Interface RESTConfig *rest.Config // contains filtered or unexported fields }
func (*SFUtilContext) CorporateCAConfigMapExists ¶
func (r *SFUtilContext) CorporateCAConfigMapExists() (apiv1.ConfigMap, bool)
CorporateCAConfigMapExists check if the ConfigMap named "corporate-ca-certs" exists
func (*SFUtilContext) CreateR ¶
func (r *SFUtilContext) CreateR(obj client.Object)
CreateR creates a resource with the owner as the ownerReferences.
func (*SFUtilContext) DebugStatefulSet ¶
func (r *SFUtilContext) DebugStatefulSet(name string)
DebugStatefulSet disables StatefulSet main container probes
func (*SFUtilContext) DeleteR ¶
func (r *SFUtilContext) DeleteR(obj client.Object)
DeleteR delete a resource.
func (*SFUtilContext) EnsureConfigMap ¶
EnsureConfigMap ensures a config map exist The ConfigMap is updated if needed
func (*SFUtilContext) EnsureLocalCA ¶
func (r *SFUtilContext) EnsureLocalCA()
EnsureLocalCA ensures cert-manager resources exists to enable of local CA Issuer This function does not support update
func (*SFUtilContext) EnsureSSHKeySecret ¶
func (r *SFUtilContext) EnsureSSHKeySecret(name string)
EnsureSSHKeySecret ensures a Secret exists container an autogenerated SSH key pair If it does not exixtthe Secret is created This function does not support Secret update
func (*SFUtilContext) EnsureSecret ¶
func (r *SFUtilContext) EnsureSecret(secret *apiv1.Secret)
EnsureSecret ensures a Secret exist The Secret is updated if needed
func (*SFUtilContext) EnsureSecretUUID ¶
func (r *SFUtilContext) EnsureSecretUUID(name string) apiv1.Secret
EnsureSecretUUID ensures a Secret containing an UUID This function does not support update
func (*SFUtilContext) EnsureService ¶
func (r *SFUtilContext) EnsureService(service *apiv1.Service)
EnsureService ensures a Service exists The Service is updated if needed
func (*SFUtilContext) GetConfigMap ¶ added in v0.0.21
func (r *SFUtilContext) GetConfigMap(name string) (apiv1.ConfigMap, error)
GetConfigMap Get ConfigMap by name
func (*SFUtilContext) GetM ¶
func (r *SFUtilContext) GetM(name string, obj client.Object) bool
GetM gets a resource, returning if it was found
func (*SFUtilContext) GetOrCreate ¶
func (r *SFUtilContext) GetOrCreate(obj client.Object) bool
GetOrCreate does not change an existing object, update needs to be used manually. In the case the object already exists then the function return True
func (*SFUtilContext) GetSecret ¶ added in v0.0.21
func (r *SFUtilContext) GetSecret(name string) (apiv1.Secret, error)
GetSecret Get Secret by name
func (*SFUtilContext) GetSecretDataFromKey ¶
func (r *SFUtilContext) GetSecretDataFromKey(name string, key string) ([]byte, error)
GetSecretDataFromKey Get Data from Secret Key
func (*SFUtilContext) IsDeploymentReady ¶
func (r *SFUtilContext) IsDeploymentReady(dep *appsv1.Deployment) bool
IsDeploymentReady checks if StatefulSet is ready
func (*SFUtilContext) IsStatefulSetReady ¶
func (r *SFUtilContext) IsStatefulSetReady(dep *appsv1.StatefulSet) bool
IsStatefulSetReady checks if StatefulSet is ready
func (*SFUtilContext) PatchR ¶
func (r *SFUtilContext) PatchR(obj client.Object, patch client.Patch)
PatchR delete a resource.
type SoftwareFactoryReconciler ¶
type SoftwareFactoryReconciler struct { client.Client Scheme *runtime.Scheme RESTClient rest.Interface RESTConfig *rest.Config CancelFunc context.CancelFunc Completed bool }
func (*SoftwareFactoryReconciler) Reconcile ¶
func (r *SoftwareFactoryReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.11.2/pkg/reconcile
func (*SoftwareFactoryReconciler) SetupWithManager ¶
func (r *SoftwareFactoryReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
func (*SoftwareFactoryReconciler) StandaloneReconcile ¶
func (r *SoftwareFactoryReconciler) StandaloneReconcile(ctx context.Context, ns string, sf sfv1.SoftwareFactory) error
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
libs
|
|
base
Package base provides various utility functions regarding base k8s resources used by the sf-operator
|
Package base provides various utility functions regarding base k8s resources used by the sf-operator |
cert
Package cert provides various utility functions regarding handling cert-manager for the sf-operator
|
Package cert provides various utility functions regarding handling cert-manager for the sf-operator |
conds
Package conds provides various utility functions regarding Status.Conditions for the sf-operator
|
Package conds provides various utility functions regarding Status.Conditions for the sf-operator |
logging
Package logging provides various utility functions regarding optional service log collection for the sf-operator:
|
Package logging provides various utility functions regarding optional service log collection for the sf-operator: |
monitoring
Package monitoring provides various utility functions regarding monitoring for the sf-operator:
|
Package monitoring provides various utility functions regarding monitoring for the sf-operator: |
utils
Package utils provides various utility functions
|
Package utils provides various utility functions |
zuulcf
Package zuulcf contains a library to build Zuul configurations.
|
Package zuulcf contains a library to build Zuul configurations. |