storage

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package storage provides shared utilities for building Kubernetes storage resources used across the resource-handler controllers.

Currently this package contains BuildPVCTemplate, which constructs PersistentVolumeClaim templates suitable for StatefulSet volumeClaimTemplates. It is used by the TopoServer controller to provision persistent storage for etcd data.

The package exists as a separate shared utility so that storage construction logic is consistent across controllers and avoids duplication. Controllers that need PVC templates import this package rather than reimplementing the boilerplate for access modes, storage class, and resource request setup.

Usage

pvc := storage.BuildPVCTemplate("data", &storageClass, "10Gi", nil)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPVCTemplate

func BuildPVCTemplate(
	name string,
	storageClassName *string,
	storageSize string,
	accessModes []corev1.PersistentVolumeAccessMode,
) corev1.PersistentVolumeClaim

BuildPVCTemplate creates a PersistentVolumeClaim for StatefulSet's volumeClaimTemplates. Builds from simple storage class name and size parameters.

Parameters:

  • name: Name for the volume claim (e.g., "data")
  • storageClassName: Optional storage class name (nil uses cluster default)
  • storageSize: Size of the volume (e.g., "10Gi")
  • accessModes: List of access modes (e.g., [ReadWriteOnce]). Defaults to ReadWriteOnce if empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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