Documentation ¶
Index ¶
- Constants
- func BuildBackup(sts *appsv1.StatefulSet, backupPolicyName string, ...) (*dataprotectionv1alpha1.Backup, error)
- func BuildBackupManifestsJob(key types.NamespacedName, backup *dataprotectionv1alpha1.Backup, ...) (*batchv1.Job, error)
- func BuildCfgManagerContainer(sidecarRenderedParam *cfgcm.CfgManagerBuildParams) (*corev1.Container, error)
- func BuildConfigMapWithTemplate(cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent, ...) (*corev1.ConfigMap, error)
- func BuildConnCredential(clusterDefiniiton *appsv1alpha1.ClusterDefinition, ...) (*corev1.Secret, error)
- func BuildCronJob(pvcKey types.NamespacedName, schedule string, sts *appsv1.StatefulSet) (*batchv1.CronJob, error)
- func BuildDeploy(reqCtx intctrlutil.RequestCtx, cluster *appsv1alpha1.Cluster, ...) (*appsv1.Deployment, error)
- func BuildEnvConfig(cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent) (*corev1.ConfigMap, error)
- func BuildHeadlessSvc(cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent) (*corev1.Service, error)
- func BuildPDB(cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent) (*policyv1.PodDisruptionBudget, error)
- func BuildPVCFromSnapshot(sts *appsv1.StatefulSet, vct corev1.PersistentVolumeClaimTemplate, ...) (*corev1.PersistentVolumeClaim, error)
- func BuildPersistentVolumeClaimLabels(sts *appsv1.StatefulSet, pvc *corev1.PersistentVolumeClaim, ...)
- func BuildRestoreJob(name, namespace string, image string, command []string, args []string, ...) (*batchv1.Job, error)
- func BuildSts(reqCtx intctrlutil.RequestCtx, cluster *appsv1alpha1.Cluster, ...) (*appsv1.StatefulSet, error)
- func BuildSvcList(cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent) ([]*corev1.Service, error)
- func BuildSvcListWithCustomAttributes(cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent, ...) ([]*corev1.Service, error)
- func BuildTLSSecret(namespace, clusterName, componentName string) (*corev1.Secret, error)
- func BuildVolumeSnapshot(snapshotKey types.NamespacedName, pvcName string, sts *appsv1.StatefulSet) (*snapshotv1.VolumeSnapshot, error)
- func WithMap(keysAndValues ...string) map[string]string
- type BaseBuilder
- func (builder *BaseBuilder[T, PT, B]) AddAnnotations(keysAndValues ...string) *B
- func (builder *BaseBuilder[T, PT, B]) AddAnnotationsInMap(annotations map[string]string) *B
- func (builder *BaseBuilder[T, PT, B]) AddControllerRevisionHashLabel(value string) *B
- func (builder *BaseBuilder[T, PT, B]) AddFinalizers(finalizers []string) *B
- func (builder *BaseBuilder[T, PT, B]) AddLabels(keysAndValues ...string) *B
- func (builder *BaseBuilder[T, PT, B]) AddLabelsInMap(labels map[string]string) *B
- func (builder *BaseBuilder[T, PT, B]) GetObject() PT
- func (builder *BaseBuilder[T, PT, B]) SetName(name string) *B
- func (builder *BaseBuilder[T, PT, B]) SetOwnerReferences(ownerAPIVersion string, ownerKind string, owner client.Object) *B
- type ConfigMapBuilder
- func (builder *ConfigMapBuilder) PutBinaryData(key string, value []byte) *ConfigMapBuilder
- func (builder *ConfigMapBuilder) PutData(key, value string) *ConfigMapBuilder
- func (builder *ConfigMapBuilder) SetBinaryData(binaryData map[string][]byte) *ConfigMapBuilder
- func (builder *ConfigMapBuilder) SetData(data map[string]string) *ConfigMapBuilder
- func (builder *ConfigMapBuilder) SetImmutable(immutable bool) *ConfigMapBuilder
- type ConsensusSetBuilder
- func (builder *ConsensusSetBuilder) AddObservationAction(action workloads.Action) *ConsensusSetBuilder
- func (builder *ConsensusSetBuilder) SetObservationActions(actions []workloads.Action) *ConsensusSetBuilder
- func (builder *ConsensusSetBuilder) SetReplicas(replicas int32) *ConsensusSetBuilder
- func (builder *ConsensusSetBuilder) SetRoles(roles []workloads.ConsensusRole) *ConsensusSetBuilder
- func (builder *ConsensusSetBuilder) SetService(service corev1.ServiceSpec) *ConsensusSetBuilder
- func (builder *ConsensusSetBuilder) SetTemplate(template corev1.PodTemplateSpec) *ConsensusSetBuilder
- type JobBuilder
- type PodBuilder
- type ServiceBuilder
- func (builder *ServiceBuilder) AddContainerPorts(ports ...corev1.ContainerPort) *ServiceBuilder
- func (builder *ServiceBuilder) AddPorts(ports ...corev1.ServicePort) *ServiceBuilder
- func (builder *ServiceBuilder) AddSelector(key, value string) *ServiceBuilder
- func (builder *ServiceBuilder) AddSelectors(keyValues ...string) *ServiceBuilder
- func (builder *ServiceBuilder) AddSelectorsInMap(keyValues map[string]string) *ServiceBuilder
- func (builder *ServiceBuilder) SetType(serviceType corev1.ServiceType) *ServiceBuilder
- type StatefulSetBuilder
- func (builder *StatefulSetBuilder) AddMatchLabel(key, value string) *StatefulSetBuilder
- func (builder *StatefulSetBuilder) AddMatchLabels(keyValues ...string) *StatefulSetBuilder
- func (builder *StatefulSetBuilder) AddMatchLabelsInMap(labels map[string]string) *StatefulSetBuilder
- func (builder *StatefulSetBuilder) AddVolumeClaimTemplates(templates ...corev1.PersistentVolumeClaim) *StatefulSetBuilder
- func (builder *StatefulSetBuilder) SetMinReadySeconds(minReadySeconds int32) *StatefulSetBuilder
- func (builder *StatefulSetBuilder) SetPodManagementPolicy(policy apps.PodManagementPolicyType) *StatefulSetBuilder
- func (builder *StatefulSetBuilder) SetReplicas(replicas int32) *StatefulSetBuilder
- func (builder *StatefulSetBuilder) SetServiceName(serviceName string) *StatefulSetBuilder
- func (builder *StatefulSetBuilder) SetTemplate(template corev1.PodTemplateSpec) *StatefulSetBuilder
- func (builder *StatefulSetBuilder) SetUpdateStrategyType(strategyType apps.StatefulSetUpdateStrategyType) *StatefulSetBuilder
- func (builder *StatefulSetBuilder) SetVolumeClaimTemplates(templates ...corev1.PersistentVolumeClaim) *StatefulSetBuilder
Constants ¶
View Source
const ( VolumeName = "tls" CAName = "ca.crt" CertName = "tls.crt" KeyName = "tls.key" MountPath = "/etc/pki/tls" )
Variables ¶
This section is empty.
Functions ¶
func BuildBackup ¶
func BuildBackup(sts *appsv1.StatefulSet, backupPolicyName string, backupKey types.NamespacedName) (*dataprotectionv1alpha1.Backup, error)
func BuildBackupManifestsJob ¶
func BuildBackupManifestsJob(key types.NamespacedName, backup *dataprotectionv1alpha1.Backup, podSpec *corev1.PodSpec) (*batchv1.Job, error)
func BuildCfgManagerContainer ¶
func BuildCfgManagerContainer(sidecarRenderedParam *cfgcm.CfgManagerBuildParams) (*corev1.Container, error)
func BuildConfigMapWithTemplate ¶
func BuildConfigMapWithTemplate(cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent, configs map[string]string, cmName string, configConstraintName string, tplCfg appsv1alpha1.ComponentTemplateSpec) (*corev1.ConfigMap, error)
func BuildConnCredential ¶
func BuildConnCredential(clusterDefiniiton *appsv1alpha1.ClusterDefinition, cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent) (*corev1.Secret, error)
func BuildCronJob ¶
func BuildCronJob(pvcKey types.NamespacedName, schedule string, sts *appsv1.StatefulSet) (*batchv1.CronJob, error)
func BuildDeploy ¶
func BuildDeploy(reqCtx intctrlutil.RequestCtx, cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent) (*appsv1.Deployment, error)
func BuildEnvConfig ¶
func BuildEnvConfig(cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent) (*corev1.ConfigMap, error)
BuildEnvConfig builds cluster component context ConfigMap object, which is to be used in workload container's envFrom.configMapRef with name of "$(cluster.metadata.name)-$(component.name)-env" pattern.
func BuildHeadlessSvc ¶
func BuildHeadlessSvc(cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent) (*corev1.Service, error)
func BuildPDB ¶
func BuildPDB(cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent) (*policyv1.PodDisruptionBudget, error)
func BuildPVCFromSnapshot ¶
func BuildPVCFromSnapshot(sts *appsv1.StatefulSet, vct corev1.PersistentVolumeClaimTemplate, pvcKey types.NamespacedName, snapshotName string, component *component.SynthesizedComponent) (*corev1.PersistentVolumeClaim, error)
func BuildPersistentVolumeClaimLabels ¶
func BuildPersistentVolumeClaimLabels(sts *appsv1.StatefulSet, pvc *corev1.PersistentVolumeClaim, component *component.SynthesizedComponent, pvcTplName string)
BuildPersistentVolumeClaimLabels builds a pvc name label, and synchronize the labels from sts to pvc.
func BuildRestoreJob ¶ added in v0.6.0
func BuildSts ¶
func BuildSts(reqCtx intctrlutil.RequestCtx, cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent, envConfigName string) (*appsv1.StatefulSet, error)
func BuildSvcList ¶
func BuildSvcList(cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent) ([]*corev1.Service, error)
func BuildSvcListWithCustomAttributes ¶ added in v0.6.0
func BuildSvcListWithCustomAttributes(cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent, customAttributeSetter func(*corev1.Service)) ([]*corev1.Service, error)
func BuildTLSSecret ¶
func BuildVolumeSnapshot ¶
func BuildVolumeSnapshot(snapshotKey types.NamespacedName, pvcName string, sts *appsv1.StatefulSet) (*snapshotv1.VolumeSnapshot, error)
Types ¶
type BaseBuilder ¶ added in v0.6.0
type BaseBuilder[T intctrlutil.Object, PT intctrlutil.PObject[T], B any] struct { // contains filtered or unexported fields }
func (*BaseBuilder[T, PT, B]) AddAnnotations ¶ added in v0.6.0
func (builder *BaseBuilder[T, PT, B]) AddAnnotations(keysAndValues ...string) *B
func (*BaseBuilder[T, PT, B]) AddAnnotationsInMap ¶ added in v0.6.0
func (builder *BaseBuilder[T, PT, B]) AddAnnotationsInMap(annotations map[string]string) *B
func (*BaseBuilder[T, PT, B]) AddControllerRevisionHashLabel ¶ added in v0.6.0
func (builder *BaseBuilder[T, PT, B]) AddControllerRevisionHashLabel(value string) *B
func (*BaseBuilder[T, PT, B]) AddFinalizers ¶ added in v0.6.0
func (builder *BaseBuilder[T, PT, B]) AddFinalizers(finalizers []string) *B
func (*BaseBuilder[T, PT, B]) AddLabels ¶ added in v0.6.0
func (builder *BaseBuilder[T, PT, B]) AddLabels(keysAndValues ...string) *B
func (*BaseBuilder[T, PT, B]) AddLabelsInMap ¶ added in v0.6.0
func (builder *BaseBuilder[T, PT, B]) AddLabelsInMap(labels map[string]string) *B
func (*BaseBuilder[T, PT, B]) GetObject ¶ added in v0.6.0
func (builder *BaseBuilder[T, PT, B]) GetObject() PT
func (*BaseBuilder[T, PT, B]) SetName ¶ added in v0.6.0
func (builder *BaseBuilder[T, PT, B]) SetName(name string) *B
func (*BaseBuilder[T, PT, B]) SetOwnerReferences ¶ added in v0.6.0
func (builder *BaseBuilder[T, PT, B]) SetOwnerReferences(ownerAPIVersion string, ownerKind string, owner client.Object) *B
type ConfigMapBuilder ¶ added in v0.6.0
type ConfigMapBuilder struct { BaseBuilder[corev1.ConfigMap, *corev1.ConfigMap, ConfigMapBuilder] }
func NewConfigMapBuilder ¶ added in v0.6.0
func NewConfigMapBuilder(namespace, name string) *ConfigMapBuilder
func (*ConfigMapBuilder) PutBinaryData ¶ added in v0.6.0
func (builder *ConfigMapBuilder) PutBinaryData(key string, value []byte) *ConfigMapBuilder
func (*ConfigMapBuilder) PutData ¶ added in v0.6.0
func (builder *ConfigMapBuilder) PutData(key, value string) *ConfigMapBuilder
func (*ConfigMapBuilder) SetBinaryData ¶ added in v0.6.0
func (builder *ConfigMapBuilder) SetBinaryData(binaryData map[string][]byte) *ConfigMapBuilder
func (*ConfigMapBuilder) SetData ¶ added in v0.6.0
func (builder *ConfigMapBuilder) SetData(data map[string]string) *ConfigMapBuilder
func (*ConfigMapBuilder) SetImmutable ¶ added in v0.6.0
func (builder *ConfigMapBuilder) SetImmutable(immutable bool) *ConfigMapBuilder
type ConsensusSetBuilder ¶
type ConsensusSetBuilder struct { BaseBuilder[workloads.ConsensusSet, *workloads.ConsensusSet, ConsensusSetBuilder] }
func NewConsensusSetBuilder ¶
func NewConsensusSetBuilder(namespace, name string) *ConsensusSetBuilder
func (*ConsensusSetBuilder) AddObservationAction ¶
func (builder *ConsensusSetBuilder) AddObservationAction(action workloads.Action) *ConsensusSetBuilder
func (*ConsensusSetBuilder) SetObservationActions ¶
func (builder *ConsensusSetBuilder) SetObservationActions(actions []workloads.Action) *ConsensusSetBuilder
func (*ConsensusSetBuilder) SetReplicas ¶
func (builder *ConsensusSetBuilder) SetReplicas(replicas int32) *ConsensusSetBuilder
func (*ConsensusSetBuilder) SetRoles ¶
func (builder *ConsensusSetBuilder) SetRoles(roles []workloads.ConsensusRole) *ConsensusSetBuilder
func (*ConsensusSetBuilder) SetService ¶
func (builder *ConsensusSetBuilder) SetService(service corev1.ServiceSpec) *ConsensusSetBuilder
func (*ConsensusSetBuilder) SetTemplate ¶
func (builder *ConsensusSetBuilder) SetTemplate(template corev1.PodTemplateSpec) *ConsensusSetBuilder
type JobBuilder ¶ added in v0.6.0
type JobBuilder struct { BaseBuilder[batchv1.Job, *batchv1.Job, JobBuilder] }
func NewJobBuilder ¶ added in v0.6.0
func NewJobBuilder(namespace, name string) *JobBuilder
func (*JobBuilder) AddSelector ¶ added in v0.6.0
func (builder *JobBuilder) AddSelector(key, value string) *JobBuilder
func (*JobBuilder) SetPodTemplateSpec ¶ added in v0.6.0
func (builder *JobBuilder) SetPodTemplateSpec(template corev1.PodTemplateSpec) *JobBuilder
func (*JobBuilder) SetSuspend ¶ added in v0.6.0
func (builder *JobBuilder) SetSuspend(suspend bool) *JobBuilder
type PodBuilder ¶ added in v0.6.0
type PodBuilder struct { BaseBuilder[corev1.Pod, *corev1.Pod, PodBuilder] }
func NewPodBuilder ¶ added in v0.6.0
func NewPodBuilder(namespace, name string) *PodBuilder
func (*PodBuilder) AddContainer ¶ added in v0.6.0
func (builder *PodBuilder) AddContainer(container corev1.Container) *PodBuilder
func (*PodBuilder) SetContainers ¶ added in v0.6.0
func (builder *PodBuilder) SetContainers(containers []corev1.Container) *PodBuilder
type ServiceBuilder ¶ added in v0.6.0
type ServiceBuilder struct { BaseBuilder[corev1.Service, *corev1.Service, ServiceBuilder] }
func NewHeadlessServiceBuilder ¶ added in v0.6.0
func NewHeadlessServiceBuilder(namespace, name string) *ServiceBuilder
func NewServiceBuilder ¶ added in v0.6.0
func NewServiceBuilder(namespace, name string) *ServiceBuilder
func (*ServiceBuilder) AddContainerPorts ¶ added in v0.6.0
func (builder *ServiceBuilder) AddContainerPorts(ports ...corev1.ContainerPort) *ServiceBuilder
func (*ServiceBuilder) AddPorts ¶ added in v0.6.0
func (builder *ServiceBuilder) AddPorts(ports ...corev1.ServicePort) *ServiceBuilder
func (*ServiceBuilder) AddSelector ¶ added in v0.6.0
func (builder *ServiceBuilder) AddSelector(key, value string) *ServiceBuilder
func (*ServiceBuilder) AddSelectors ¶ added in v0.6.0
func (builder *ServiceBuilder) AddSelectors(keyValues ...string) *ServiceBuilder
func (*ServiceBuilder) AddSelectorsInMap ¶ added in v0.6.0
func (builder *ServiceBuilder) AddSelectorsInMap(keyValues map[string]string) *ServiceBuilder
func (*ServiceBuilder) SetType ¶ added in v0.6.0
func (builder *ServiceBuilder) SetType(serviceType corev1.ServiceType) *ServiceBuilder
type StatefulSetBuilder ¶ added in v0.6.0
type StatefulSetBuilder struct { BaseBuilder[apps.StatefulSet, *apps.StatefulSet, StatefulSetBuilder] }
func NewStatefulSetBuilder ¶ added in v0.6.0
func NewStatefulSetBuilder(namespace, name string) *StatefulSetBuilder
func (*StatefulSetBuilder) AddMatchLabel ¶ added in v0.6.0
func (builder *StatefulSetBuilder) AddMatchLabel(key, value string) *StatefulSetBuilder
func (*StatefulSetBuilder) AddMatchLabels ¶ added in v0.6.0
func (builder *StatefulSetBuilder) AddMatchLabels(keyValues ...string) *StatefulSetBuilder
func (*StatefulSetBuilder) AddMatchLabelsInMap ¶ added in v0.6.0
func (builder *StatefulSetBuilder) AddMatchLabelsInMap(labels map[string]string) *StatefulSetBuilder
func (*StatefulSetBuilder) AddVolumeClaimTemplates ¶ added in v0.6.0
func (builder *StatefulSetBuilder) AddVolumeClaimTemplates(templates ...corev1.PersistentVolumeClaim) *StatefulSetBuilder
func (*StatefulSetBuilder) SetMinReadySeconds ¶ added in v0.6.0
func (builder *StatefulSetBuilder) SetMinReadySeconds(minReadySeconds int32) *StatefulSetBuilder
func (*StatefulSetBuilder) SetPodManagementPolicy ¶ added in v0.6.0
func (builder *StatefulSetBuilder) SetPodManagementPolicy(policy apps.PodManagementPolicyType) *StatefulSetBuilder
func (*StatefulSetBuilder) SetReplicas ¶ added in v0.6.0
func (builder *StatefulSetBuilder) SetReplicas(replicas int32) *StatefulSetBuilder
func (*StatefulSetBuilder) SetServiceName ¶ added in v0.6.0
func (builder *StatefulSetBuilder) SetServiceName(serviceName string) *StatefulSetBuilder
func (*StatefulSetBuilder) SetTemplate ¶ added in v0.6.0
func (builder *StatefulSetBuilder) SetTemplate(template corev1.PodTemplateSpec) *StatefulSetBuilder
func (*StatefulSetBuilder) SetUpdateStrategyType ¶ added in v0.6.0
func (builder *StatefulSetBuilder) SetUpdateStrategyType(strategyType apps.StatefulSetUpdateStrategyType) *StatefulSetBuilder
func (*StatefulSetBuilder) SetVolumeClaimTemplates ¶ added in v0.6.0
func (builder *StatefulSetBuilder) SetVolumeClaimTemplates(templates ...corev1.PersistentVolumeClaim) *StatefulSetBuilder
Click to show internal directories.
Click to hide internal directories.