k8sfactory

package
v0.0.0-...-ff642e8 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AWSCredentialFactory

func AWSCredentialFactory(base *consulv1alpha1.AWSCredential, traits ...Trait) *consulv1alpha1.AWSCredential

func ClearOwnerReference

func ClearOwnerReference(object any)

func ClusterIP

func ClusterIP(object any)

func ConfigMapFactory

func ConfigMapFactory(base *corev1.ConfigMap, traits ...Trait) *corev1.ConfigMap

func ConsulBackupFactory

func ConsulBackupFactory(base *consulv1alpha1.ConsulBackup, traits ...Trait) *consulv1alpha1.ConsulBackup

func ContainerFactory

func ContainerFactory(base *corev1.Container, traits ...Trait) *corev1.Container

func Created

func Created(object any)

func CronJobFactory

func CronJobFactory(base *batchv1.CronJob, traits ...Trait) *batchv1.CronJob

func DefaultNamespace

func DefaultNamespace(object any)

func Delete

func Delete(object any)

func DeploymentFactory

func DeploymentFactory(base *appsv1.Deployment, traits ...Trait) *appsv1.Deployment

func DisableCreatingIndexFile

func DisableCreatingIndexFile(object any)

func EnableCreatingIndexFile

func EnableCreatingIndexFile(object any)

func EventFactory

func EventFactory(base *corev1.Event, traits ...Trait) *corev1.Event

func ExecProbe

func ExecProbe(command ...string) *corev1.Probe

func Factory

func Factory(base any, traits ...Trait) any

func GrafanaFactory

func GrafanaFactory(base *grafanav1alpha1.Grafana, traits ...Trait) *grafanav1alpha1.Grafana

func GrafanaUserFactory

func GrafanaUserFactory(base *grafanav1alpha1.GrafanaUser, traits ...Trait) *grafanav1alpha1.GrafanaUser

func HTTPProbe

func HTTPProbe(port int, path string) *corev1.Probe

func HarborProjectFactory

func HarborProjectFactory(base *harborv1alpha1.HarborProject, traits ...Trait) *harborv1alpha1.HarborProject

func IPNone

func IPNone(object any)

func IngressClassFactory

func IngressClassFactory(base *networkingv1.IngressClass, traits ...Trait) *networkingv1.IngressClass

func IngressFactory

func IngressFactory(base *networkingv1.Ingress, traits ...Trait) *networkingv1.Ingress

func IngressPathFactory

func IngressPathFactory(base *networkingv1.HTTPIngressPath, traits ...Trait) *networkingv1.HTTPIngressPath

func IngressRuleFactory

func IngressRuleFactory(base *networkingv1.IngressRule, traits ...Trait) *networkingv1.IngressRule

func JobFactory

func JobFactory(base *batchv1.Job, traits ...Trait) *batchv1.Job

func LoadBalancer

func LoadBalancer(object any)

func LocalObjectReference

func LocalObjectReference(obj metav1.Object) corev1.LocalObjectReference

func MatchLabel

func MatchLabel(v map[string]string) metav1.LabelSelector

func MinIOBucketFactory

func MinIOBucketFactory(base *miniov1alpha1.MinIOBucket, traits ...Trait) *miniov1alpha1.MinIOBucket

func MinIOUserFactory

func MinIOUserFactory(base *miniov1alpha1.MinIOUser, traits ...Trait) *miniov1alpha1.MinIOUser

func NotReady

func NotReady(v any)

NotReady is the trait function for k8sfactory. The object is created but not ready.

func ObjectReference

func ObjectReference(obj metav1.Object) *consulv1alpha1.ObjectReference

func PodDisruptionBudgetFactory

func PodDisruptionBudgetFactory(base *policyv1.PodDisruptionBudget, traits ...Trait) *policyv1.PodDisruptionBudget

func PodFactory

func PodFactory(base *corev1.Pod, traits ...Trait) *corev1.Pod

func PodFailed

func PodFailed(v any)

func PodSucceeded

func PodSucceeded(v any)

func Ready

func Ready(v any)

func RoleBindingFactory

func RoleBindingFactory(base *rbacv1.RoleBinding, traits ...Trait) *rbacv1.RoleBinding

func RoleFactory

func RoleFactory(base *rbacv1.Role, traits ...Trait) *rbacv1.Role

func SecretFactory

func SecretFactory(base *corev1.Secret, traits ...Trait) *corev1.Secret

func SecretKeySelector

func SecretKeySelector(secret *corev1.Secret, key string) *corev1.SecretKeySelector

func ServiceAccountFactory

func ServiceAccountFactory(base *corev1.ServiceAccount, traits ...Trait) *corev1.ServiceAccount

func ServiceFactory

func ServiceFactory(base *corev1.Service, traits ...Trait) *corev1.Service

func TCPProbe

func TCPProbe(port int) *corev1.Probe

func TrafficPolicyLocal

func TrafficPolicyLocal(object any)

Types

type Trait

type Trait func(object any)

func AWSCredential

func AWSCredential(creds *consulv1alpha1.AWSCredential) Trait

func AccessKey

func AccessKey(ref *corev1.SecretKeySelector) Trait

func AdminPasswordSecret

func AdminPasswordSecret(v *corev1.SecretKeySelector) Trait

func Annotation

func Annotation(k, v string) Trait

func Annotations

func Annotations(annotations map[string]string) Trait

func Args

func Args(args ...string) Trait

func BackoffLimit

func BackoffLimit(limit int32) Trait

func BackupInterval

func BackupInterval(seconds int) Trait

func BackupService

func BackupService(objRef *consulv1alpha1.ObjectReference) Trait

func BackupStorage

func BackupStorage(v any) Trait

func BackupSucceeded

func BackupSucceeded(time time.Time) Trait

func Bucket

func Bucket(bucket string) Trait

func Container

func Container(c *corev1.Container) Trait

func ControlledBy

func ControlledBy(v runtime.Object, s *runtime.Scheme) Trait

func Controller

func Controller(v string) Trait

func CreatedAt

func CreatedAt(now time.Time) Trait

func Data

func Data(key string, value []byte) Trait

func DockerSecret

func DockerSecret(s *corev1.Secret) Trait

func EnvFrom

func EnvFrom(name string) Trait

func EnvFromField

func EnvFromField(k, v string) Trait

func EnvFromSecret

func EnvFromSecret(k, name, secretKey string) Trait

func EnvVar

func EnvVar(k, v string) Trait

func Finalizer

func Finalizer(v string) Trait

func Generation

func Generation(v int64) Trait

func Host

func Host(v string) Trait

func Image

func Image(image string, cmd []string) Trait

func IngressClass

func IngressClass(v *networkingv1.IngressClass) Trait

func InitContainer

func InitContainer(c *corev1.Container) Trait

func Job

func Job(j *batchv1.Job) Trait

func Label

func Label(v ...string) Trait

func Labels

func Labels(label map[string]string) Trait

func Limits

func Limits(lim corev1.ResourceList) Trait

func LivenessProbe

func LivenessProbe(p *corev1.Probe) Trait

func LoadBalancerIP

func LoadBalancerIP(ip string) Trait

func MatchLabelSelector

func MatchLabelSelector(label map[string]string) Trait

func MaxBackup

func MaxBackup(v int) Trait

func MinAvailable

func MinAvailable(v int) Trait

func MinIOCredential

func MinIOCredential(ref corev1.LocalObjectReference) Trait

func MinIOSelector

func MinIOSelector(sel metav1.LabelSelector) Trait

func Name

func Name(v string) Trait

func Namef

func Namef(format string, a ...interface{}) Trait

func Namespace

func Namespace(v string) Trait

func OnContainer

func OnContainer(name string, t ...Trait) Trait

func Parameters

func Parameters(params map[string]string) Trait

func Path

func Path(path string, pt networkingv1.PathType, svc *corev1.Service, port string) Trait

func Pod

func Pod(p *corev1.Pod) Trait

func PodFailurePolicy

func PodFailurePolicy(v batchv1.PodFailurePolicyRule) Trait

func PolicyRule

func PolicyRule(apiGroups, resources, verbs []string) Trait

func Port

func Port(name string, protocol corev1.Protocol, port int32) Trait

func PreferredInterPodAntiAffinity

func PreferredInterPodAntiAffinity(weight int32, selector *metav1.LabelSelector, key string) Trait

func ProjectReference

func ProjectReference(p *harborv1alpha1.HarborProject) Trait

func Provider

func Provider(name string) Trait

func PullPolicy

func PullPolicy(p corev1.PullPolicy) Trait

func ReadinessProbe

func ReadinessProbe(p *corev1.Probe) Trait

func ReadyProject

func ReadyProject(id int) Trait

func Reason

func Reason(v string) Trait

func Replicas

func Replicas(v int32) Trait

func Requests

func Requests(req corev1.ResourceList) Trait

func ResourceLimit

func ResourceLimit(cpu, mem resource.Quantity) Trait

func ResourceRequest

func ResourceRequest(cpu, mem resource.Quantity) Trait

func RestartPolicy

func RestartPolicy(policy corev1.RestartPolicy) Trait

func Role

func Role(r *rbacv1.Role) Trait

func Rule

func Rule(rule *networkingv1.IngressRule) Trait

func Schedule

func Schedule(v string) Trait

func SecretAccessKey

func SecretAccessKey(ref *corev1.SecretKeySelector) Trait

func Selector

func Selector(v ...string) Trait

func ServiceAccount

func ServiceAccount(v string) Trait

func ServiceReference

func ServiceReference(v corev1.LocalObjectReference) Trait

func SortVolume

func SortVolume() Trait

func StoragePath

func StoragePath(path string) Trait

func Subdomain

func Subdomain(v string) Trait

func Subject

func Subject(v runtime.Object) Trait

func TargetPort

func TargetPort(name string, protocol corev1.Protocol, port int32, targetPort intstr.IntOrString) Trait

func UID

func UID() Trait

func UserEmail

func UserEmail(v string) Trait

func UserSelector

func UserSelector(v metav1.LabelSelector) Trait

func VaultPath

func VaultPath(mountPath, path string) Trait

func Volume

func Volume(vol *VolumeSource) Trait

func WorkDir

func WorkDir(dir string) Trait

type VolumeSource

type VolumeSource struct {
	Mount  corev1.VolumeMount
	Source corev1.Volume
}

func NewConfigMapVolumeSource

func NewConfigMapVolumeSource(name, path, configMapName string) *VolumeSource

func NewEmptyDirVolumeSource

func NewEmptyDirVolumeSource(name, path string) *VolumeSource

func NewPersistentVolumeClaimVolumeSource

func NewPersistentVolumeClaimVolumeSource(name, path, pvcName string) *VolumeSource

func NewSecretStoreVolumeSource

func NewSecretStoreVolumeSource(name, path string) *VolumeSource

func NewSecretVolumeSource

func NewSecretVolumeSource(name, path string, source *corev1.Secret, items ...corev1.KeyToPath) *VolumeSource

func (*VolumeSource) PathJoin

func (s *VolumeSource) PathJoin(elem ...string) string

Jump to

Keyboard shortcuts

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