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 ¶
- Variables
- func ImageToString(i Image) string
- func IsDeploymentReady(dep *appsv1.Deployment) bool
- func IsDeploymentRolloutDone(obj *appsv1.Deployment) bool
- func IsStatefulSetRolloutDone(obj *appsv1.StatefulSet) bool
- func MkContainer(name string, image string) apiv1.Container
- func MkContainerPort(port int, name string) apiv1.ContainerPort
- func MkDeployment(name string, ns string, image string) appsv1.Deployment
- func MkEmptyDirVolume(name string) apiv1.Volume
- func MkEnvVar(env string, value string) apiv1.EnvVar
- func MkEnvVarFromFieldRef(env string, fieldPath string) apiv1.EnvVar
- func MkHTTPSRoute(name string, ns string, host string, serviceName string, path string, port int, ...) apiroutev1.Route
- func MkHeadlessService(name string, ns string, selector string, ports []int32, portName string) apiv1.Service
- func MkHeadlessServicePod(name string, ns string, podName string, ports []int32, portName string) apiv1.Service
- func MkJob(name string, ns string, container apiv1.Container) batchv1.Job
- func MkLiveHTTPProbe(path string, port int) *apiv1.Probe
- func MkLivenessCMDProbe(cmd []string) *apiv1.Probe
- func MkPVC(name string, ns string, storageParams StorageConfig, ...) apiv1.PersistentVolumeClaim
- func MkReadinessCMDProbe(cmd []string) *apiv1.Probe
- func MkReadinessHTTPProbe(path string, port int) *apiv1.Probe
- func MkReadinessTCPProbe(port int) *apiv1.Probe
- func MkSSHKeySecret(name string, namespace string) apiv1.Secret
- func MkSecretEnvVar(env string, secret string, key string) apiv1.EnvVar
- func MkSecretFromFunc(name string, namespace string, getData func() string) apiv1.Secret
- func MkSecurityContext(privileged bool) *apiv1.SecurityContext
- func MkService(name string, ns string, selector string, ports []int32, portName string) apiv1.Service
- func MkServicePod(name string, ns string, podName string, ports []int32, portName string) apiv1.Service
- func MkStartupCMDProbe(cmd []string) *apiv1.Probe
- func MkStartupHTTPProbe(path string, port int) *apiv1.Probe
- func MkStatefulset(name string, ns string, replicas int32, serviceName string, ...) appsv1.StatefulSet
- func MkVolumeCM(volumeName string, configMapRef string) apiv1.Volume
- func MkVolumeSecret(name string, secretName ...string) apiv1.Volume
- func ZuulImage(service string) string
- type Image
- type StorageConfig
Constants ¶
This section is empty.
Variables ¶
var ( BusyboxImage = ImageToString(Image{Path: "quay.io/software-factory/sf-op-busybox", Version: "1.5-3"}) GerritImage = ImageToString(Image{Path: "quay.io/software-factory/gerrit", Version: "3.6.4-8"}) GitServerImage = ImageToString(Image{Path: "quay.io/software-factory/git-deamon", Version: "2.39.3-1"}) SSHDImage = ImageToString(Image{Path: "quay.io/software-factory/sshd", Version: "0.1-3"}) PurgeLogsImage = ImageToString(Image{Path: "quay.io/software-factory/purgelogs", Version: "0.2.3-3"}) NodepoolLauncherImage = ImageToString(Image{Path: "quay.io/software-factory/nodepool-launcher", Version: nodepoolImageVersion}) NodepoolBuilderImage = ImageToString(Image{Path: "quay.io/software-factory/nodepool-builder", Version: nodepoolImageVersion}) MariabDBImage = ImageToString(Image{Path: "quay.io/software-factory/mariadb", Version: "10.5.16-4"}) ZookeeperImage = ImageToString(Image{Path: "quay.io/software-factory/zookeeper", Version: "3.8.3-1"}) // https://catalog.redhat.com/software/containers/ubi8/httpd-24/6065b844aee24f523c207943?q=httpd&architecture=amd64&image=651f274c8ce9242f7bb3e011 HTTPDImage = ImageToString(Image{Path: "registry.access.redhat.com/ubi8/httpd-24", Version: "1-284.1696531168"}) NodeExporterImage = ImageToString(Image{Path: "quay.io/prometheus/node-exporter", Version: "v1.6.1"}) StatsdExporterImage = ImageToString(Image{Path: "quay.io/prometheus/statsd-exporter", Version: "v0.24.0"}) FluentBitImage = ImageToString(Image{Path: "cr.fluentbit.io/fluent/fluent-bit", Version: "2.1.10-debug"}) )
var DefaultPodSecurityContext = apiv1.PodSecurityContext{ RunAsNonRoot: pointer.Bool(true), SeccompProfile: &apiv1.SeccompProfile{ Type: "RuntimeDefault", }, }
DefaultPodSecurityContext is the PodSecurityContext used by sf-operator Pods
Functions ¶
func ImageToString ¶
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 MkContainer ¶
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 ¶
MkEmptyDirVolume produces a EmptyDir Volume
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 MkLivenessCMDProbe ¶
func MkPVC ¶
func MkPVC(name string, ns string, storageParams StorageConfig, accessMode apiv1.PersistentVolumeAccessMode) apiv1.PersistentVolumeClaim
MkPVC produces PerssistentVolumeClaim
func MkReadinessCMDProbe ¶
func MkReadinessTCPProbe ¶
func MkSSHKeySecret ¶
MkSSHKeySecret produces a Secret storing a SSH Key pair
func MkSecretEnvVar ¶
MkSecretEnvVar produces an EnvVar from a Secret's key. When the 'key' parameter is empty the key name is the Secret name
func MkSecretFromFunc ¶
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 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 ¶
MkVolumeCM produce a Volume from a ConfigMap
func MkVolumeSecret ¶
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
Types ¶
type StorageConfig ¶
StorageConfig is used to define PVC Storage