base

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

View Source
var DefaultPodSecurityContext = apiv1.PodSecurityContext{
	RunAsNonRoot: pointer.Bool(true),
	SeccompProfile: &apiv1.SeccompProfile{
		Type: "RuntimeDefault",
	},
}

DefaultPodSecurityContext is the PodSecurityContext used by sf-operator Pods

Functions

func BusyboxImage

func BusyboxImage() string

func FluentBitImage

func FluentBitImage(debug bool) string

func GitServerImage

func GitServerImage() string

func HTTPDImage

func HTTPDImage() string

func IsDeploymentReady

func IsDeploymentReady(dep *appsv1.Deployment) bool

func IsDeploymentRolloutDone

func IsDeploymentRolloutDone(obj *appsv1.Deployment) bool

IsDeploymentRolloutDone returns True when the Deployment rollout is over

func IsStatefulSetRolloutDone

func IsStatefulSetRolloutDone(obj *appsv1.StatefulSet) bool

IsStatefulSetRolloutDone returns True when the StatefulSet rollout is over

func MariaDBImage added in v0.0.27

func MariaDBImage() string

func MkContainer

func MkContainer(name string, image string) apiv1.Container

MkContainer produces a Container with the default settings

func MkContainerPort

func MkContainerPort(port int, name string) apiv1.ContainerPort

MkContainerPort produces a TCP ContainerPort

func MkDeployment

func MkDeployment(name string, ns string, image string) appsv1.Deployment

MkDeployment produces a Deployment.

func MkEmptyDirVolume

func MkEmptyDirVolume(name string) apiv1.Volume

MkEmptyDirVolume produces a EmptyDir Volume

func MkEnvVar

func MkEnvVar(env string, value string) apiv1.EnvVar

MkEnvVar is small helper to produce an EnvVar

func MkEnvVarFromFieldRef

func MkEnvVarFromFieldRef(env string, fieldPath string) apiv1.EnvVar

func MkHTTPSRoute

func MkHTTPSRoute(
	name string, ns string, host string, serviceName string, path string,
	port int, annotations map[string]string, customTLS *apiroutev1.TLSConfig) apiroutev1.Route

MkHTTPSRoute produces a Route on top of a Service

func MkHeadlessService

func MkHeadlessService(name string, ns string, selector string, ports []int32, portName string) apiv1.Service

MkHeadlessService produces a headless service.

func MkHeadlessServicePod

func MkHeadlessServicePod(name string, ns string, podName string, ports []int32, portName string) apiv1.Service

MkHeadlessServicePod produces a headless service.

func MkJob

func MkJob(name string, ns string, container apiv1.Container) batchv1.Job

MkJob produces a Job

func MkLiveHTTPProbe

func MkLiveHTTPProbe(path string, port int) *apiv1.Probe

func MkLivenessCMDProbe

func MkLivenessCMDProbe(cmd []string) *apiv1.Probe

func MkPVC

func MkPVC(name string, ns string, storageParams StorageConfig, accessMode apiv1.PersistentVolumeAccessMode) apiv1.PersistentVolumeClaim

MkPVC produces PerssistentVolumeClaim

func MkReadinessCMDProbe

func MkReadinessCMDProbe(cmd []string) *apiv1.Probe

func MkReadinessHTTPProbe

func MkReadinessHTTPProbe(path string, port int) *apiv1.Probe

func MkReadinessTCPProbe

func MkReadinessTCPProbe(port int) *apiv1.Probe

func MkSSHKeySecret

func MkSSHKeySecret(name string, namespace string) apiv1.Secret

MkSSHKeySecret produces a Secret storing a SSH Key pair

func MkSecretEnvVar

func MkSecretEnvVar(env string, secret string, key string) apiv1.EnvVar

MkSecretEnvVar produces an EnvVar from a Secret's key. When the 'key' parameter is empty the key name is the Secret name

func MkSecretFromFunc

func MkSecretFromFunc(name string, namespace string, getData func() string) apiv1.Secret

MkSecretFromFunc produces a Secret where data is the result of getData

func MkSecurityContext

func MkSecurityContext(privileged bool) *apiv1.SecurityContext

MkSecurityContext produces a SecurityContext

func MkService

func MkService(name string, ns string, selector string, ports []int32, portName string) apiv1.Service

MkService produces a Service

func MkServicePod

func MkServicePod(name string, ns string, podName string, ports []int32, portName string) apiv1.Service

MkServicePod produces a Service that target a single Pod by name

func MkStartupCMDProbe

func MkStartupCMDProbe(cmd []string) *apiv1.Probe

func MkStartupHTTPProbe

func MkStartupHTTPProbe(path string, port int) *apiv1.Probe

func MkStatefulset

func MkStatefulset(
	name string, ns string, replicas int32, serviceName string,
	container apiv1.Container, pvc apiv1.PersistentVolumeClaim) appsv1.StatefulSet

MkStatefulset produces a StatefulSet.

func MkVolumeCM

func MkVolumeCM(volumeName string, configMapRef string) apiv1.Volume

MkVolumeCM produce a Volume from a ConfigMap

func MkVolumeSecret

func MkVolumeSecret(name string, secretName ...string) apiv1.Volume

MkVolumeSecret produces a Volume from a Secret source When the secretName var is not set then Secret name is the same as the Volume name

func NodeExporterImage

func NodeExporterImage() string

func NodepoolBuilderImage

func NodepoolBuilderImage() string

func NodepoolLauncherImage

func NodepoolLauncherImage() string

func PurgelogsImage added in v0.0.27

func PurgelogsImage() string

func SSHDImage

func SSHDImage() string

func StatsdExporterImage

func StatsdExporterImage() string

func ZookeeperImage

func ZookeeperImage() string

func ZuulExecutorImage added in v0.0.27

func ZuulExecutorImage() string

func ZuulMergerImage added in v0.0.27

func ZuulMergerImage() string

func ZuulSchedulerImage added in v0.0.27

func ZuulSchedulerImage() string

func ZuulWebImage added in v0.0.27

func ZuulWebImage() string

Types

type ContainerImages added in v0.0.27

type ContainerImages struct {
	Images []Image `yaml:"images"`
}

type Image

type Image struct {
	Name      string `yaml:"name"`
	Container string `yaml:"container"`
	Version   string `yaml:"version"`
	Source    string `yaml:"source,omitempty"`
}

type StorageConfig

type StorageConfig struct {
	StorageClassName string
	Size             resource.Quantity
}

StorageConfig is used to define PVC Storage

Jump to

Keyboard shortcuts

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