registryapi

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package registryapi provides deployment management for the registry API component.

Package registryapi provides deployment management for the registry API component.

Index

Constants

View Source
const (

	// RegistryAPIPort is the port number used by the registry API container
	RegistryAPIPort = 8080
	// RegistryAPIPortName is the name assigned to the registry API port
	RegistryAPIPortName = "http"

	// DefaultCPURequest is the default CPU request for the registry API container
	DefaultCPURequest = "100m"
	// DefaultMemoryRequest is the default memory request for the registry API container
	DefaultMemoryRequest = "128Mi"
	// DefaultCPULimit is the default CPU limit for the registry API container
	DefaultCPULimit = "500m"
	// DefaultMemoryLimit is the default memory limit for the registry API container
	DefaultMemoryLimit = "512Mi"

	// HealthCheckPath is the HTTP path for liveness probe checks
	HealthCheckPath = "/health"
	// ReadinessCheckPath is the HTTP path for readiness probe checks
	ReadinessCheckPath = "/readiness"
	// LivenessInitialDelay is the initial delay in seconds for liveness probes
	LivenessInitialDelay = 30
	// LivenessPeriod is the period in seconds for liveness probe checks
	LivenessPeriod = 10
	// ReadinessInitialDelay is the initial delay in seconds for readiness probes
	ReadinessInitialDelay = 5
	// ReadinessPeriod is the period in seconds for readiness probe checks
	ReadinessPeriod = 5

	// RegistryDataVolumeName is the name of the volume used for registry data
	RegistryDataVolumeName = "registry-data"

	// RegistryServerConfigVolumeName is the name of the volume used for registry server config
	RegistryServerConfigVolumeName = "registry-server-config"

	// RegistryDataMountPath is the mount path for registry data in containers
	RegistryDataMountPath = "/data/registry"

	// DefaultServiceAccountName is the default service account used by registry API pods
	DefaultServiceAccountName = "toolhive-registry-api"
	// ServeCommand is the command used to start the registry API server
	ServeCommand = "serve"

	// DefaultReplicas is the default number of replicas for the registry API deployment
	DefaultReplicas = 1
)

Variables

This section is empty.

Functions

func BuildRegistryAPIContainer added in v0.6.8

func BuildRegistryAPIContainer(image string) corev1.Container

BuildRegistryAPIContainer creates the registry-api container with default configuration.

func DefaultRegistryAPIPodTemplateSpec added in v0.6.8

func DefaultRegistryAPIPodTemplateSpec(labels map[string]string, configHash string) corev1.PodTemplateSpec

DefaultRegistryAPIPodTemplateSpec creates a default PodTemplateSpec for the registry-api.

Types

type Manager

type Manager interface {
	// ReconcileAPIService orchestrates the deployment, service creation, and readiness checking for the registry API
	ReconcileAPIService(ctx context.Context, mcpRegistry *mcpv1alpha1.MCPRegistry) *mcpregistrystatus.Error

	// CheckAPIReadiness verifies that the deployed registry-API Deployment is ready
	CheckAPIReadiness(ctx context.Context, deployment *appsv1.Deployment) bool

	// IsAPIReady checks if the registry API deployment is ready and serving requests
	IsAPIReady(ctx context.Context, mcpRegistry *mcpv1alpha1.MCPRegistry) bool
}

Manager handles registry API deployment operations

func NewManager

func NewManager(
	k8sClient client.Client,
	scheme *runtime.Scheme,
) Manager

NewManager creates a new registry API manager

type PodTemplateSpecBuilder added in v0.6.8

type PodTemplateSpecBuilder struct {
	// contains filtered or unexported fields
}

PodTemplateSpecBuilder builds a PodTemplateSpec using the functional options pattern.

func NewPodTemplateSpecBuilder added in v0.6.8

func NewPodTemplateSpecBuilder() *PodTemplateSpecBuilder

NewPodTemplateSpecBuilder creates a new PodTemplateSpecBuilder with default values.

func (*PodTemplateSpecBuilder) Apply added in v0.6.8

Apply applies the given options to the PodTemplateSpecBuilder.

func (*PodTemplateSpecBuilder) Build added in v0.6.8

Build returns the configured PodTemplateSpec.

type PodTemplateSpecOption added in v0.6.8

type PodTemplateSpecOption func(*corev1.PodTemplateSpec)

PodTemplateSpecOption is a functional option for configuring a PodTemplateSpec.

func WithAnnotations added in v0.6.8

func WithAnnotations(annotations map[string]string) PodTemplateSpecOption

WithAnnotations sets the annotations on the PodTemplateSpec.

func WithContainer added in v0.6.8

func WithContainer(container corev1.Container) PodTemplateSpecOption

WithContainer adds a container to the PodSpec.

func WithContainerArgs added in v0.6.8

func WithContainerArgs(containerName string, args []string) PodTemplateSpecOption

WithContainerArgs sets the args for a specific container by name. This replaces any existing args for the container.

func WithLabels added in v0.6.8

func WithLabels(labels map[string]string) PodTemplateSpecOption

WithLabels sets the labels on the PodTemplateSpec.

func WithRegistryServerConfigMount added in v0.6.8

func WithRegistryServerConfigMount(containerName, configMapName string) PodTemplateSpecOption

WithRegistryServerConfigMount creates a volume and mount for the registry server config. This adds both the ConfigMap volume and the corresponding volume mount to the specified container.

func WithRegistrySourceMounts added in v0.6.8

func WithRegistrySourceMounts(containerName string, registries []mcpv1alpha1.MCPRegistryConfig) PodTemplateSpecOption

WithRegistrySourceMounts creates volumes and mounts for all registry source ConfigMaps. This iterates through the registry sources and creates a volume and mount for each ConfigMapRef.

func WithRegistryStorageMount added in v0.6.8

func WithRegistryStorageMount(containerName string) PodTemplateSpecOption

WithRegistryStorageMount creates an emptyDir volume and mount for registry storage. This adds both the emptyDir volume and the corresponding volume mount to the specified container.

func WithServiceAccountName added in v0.6.8

func WithServiceAccountName(name string) PodTemplateSpecOption

WithServiceAccountName sets the service account name for the pod.

func WithVolume added in v0.6.8

func WithVolume(volume corev1.Volume) PodTemplateSpecOption

WithVolume adds a volume to the PodSpec.

func WithVolumeMount added in v0.6.8

func WithVolumeMount(containerName string, mount corev1.VolumeMount) PodTemplateSpecOption

WithVolumeMount adds a volume mount to a specific container by name.

Directories

Path Synopsis
Package config provides management for the registry server config ConfigMap
Package config provides management for the registry server config ConfigMap
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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