Documentation
¶
Index ¶
- Constants
- func GetCondition(status *llamav1alpha1.LlamaStackDistributionStatus, conditionType string) *metav1.Condition
- func IsConditionFalse(status *llamav1alpha1.LlamaStackDistributionStatus, conditionType string) bool
- func IsConditionTrue(status *llamav1alpha1.LlamaStackDistributionStatus, conditionType string) bool
- func SetCondition(status *llamav1alpha1.LlamaStackDistributionStatus, condition metav1.Condition)
- func SetDeploymentReadyCondition(status *llamav1alpha1.LlamaStackDistributionStatus, ready bool, message string)
- func SetHealthCheckCondition(status *llamav1alpha1.LlamaStackDistributionStatus, healthy bool, ...)
- func SetServiceReadyCondition(status *llamav1alpha1.LlamaStackDistributionStatus, ready bool, message string)
- func SetStorageReadyCondition(status *llamav1alpha1.LlamaStackDistributionStatus, ready bool, message string)
- type LlamaStackDistributionReconciler
Constants ¶
const ( // CA Bundle related constants. DefaultCABundleKey = "ca-bundle.crt" CABundleVolumeName = "ca-bundle" ManagedCABundleConfigMapSuffix = "-ca-bundle" ManagedCABundleKey = "ca-bundle.crt" ManagedCABundleMountPath = "/etc/ssl/certs/ca-bundle" ManagedCABundleFilePath = "/etc/ssl/certs/ca-bundle/ca-bundle.crt" // Security limits for CA bundle processing. MaxCABundleSize = 10 * 1024 * 1024 // 10MB max total size MaxCABundleCertificates = 1000 // Maximum number of certificates )
const ( // ConditionTypeDeploymentReady indicates whether the deployment is ready. ConditionTypeDeploymentReady = "DeploymentReady" // ConditionTypeHealthCheck indicates whether the health check passed. ConditionTypeHealthCheck = "HealthCheck" // ConditionTypeStorageReady indicates whether the storage is ready. ConditionTypeStorageReady = "StorageReady" // ConditionTypeServiceReady indicates whether the service is ready. ConditionTypeServiceReady = "ServiceReady" )
Condition types.
const ( // ReasonDeploymentReady indicates the deployment is ready. ReasonDeploymentReady = "DeploymentReady" // ReasonDeploymentFailed indicates the deployment failed. ReasonDeploymentFailed = "DeploymentFailed" // ReasonDeploymentPending indicates the deployment is pending. ReasonDeploymentPending = "DeploymentPending" // ReasonHealthCheckPassed indicates the health check passed. ReasonHealthCheckPassed = "HealthCheckPassed" // ReasonHealthCheckFailed indicates the health check failed. ReasonHealthCheckFailed = "HealthCheckFailed" // ReasonStorageReady indicates the storage is ready. ReasonStorageReady = "StorageReady" // ReasonStorageFailed indicates the storage failed. ReasonStorageFailed = "StorageFailed" // ReasonServiceReady indicates the service is ready. ReasonServiceReady = "ServiceReady" // ReasonServiceFailed indicates the service failed. ReasonServiceFailed = "ServiceFailed" )
Condition reasons.
const ( // MessageDeploymentReady indicates the deployment is ready. MessageDeploymentReady = "Deployment is ready" // MessageDeploymentFailed indicates the deployment failed. MessageDeploymentFailed = "Deployment failed" // MessageDeploymentPending indicates the deployment is pending. MessageDeploymentPending = "Deployment is pending" // MessageHealthCheckPassed indicates the health check passed. MessageHealthCheckPassed = "Health check passed" // MessageHealthCheckFailed indicates the health check failed. MessageHealthCheckFailed = "Health check failed" // MessageStorageReady indicates the storage is ready. MessageStorageReady = "Storage is ready" // MessageStorageFailed indicates the storage failed. MessageStorageFailed = "Storage failed" // MessageServiceReady indicates the service is ready. MessageServiceReady = "Service is ready" // MessageServiceFailed indicates the service failed. MessageServiceFailed = "Service failed" )
Condition messages.
const ( // FSGroup is the filesystem group ID for the pod. // This is the default group ID for the llama-stack server. FSGroup = int64(1001) )
Constants for validation limits.
Variables ¶
This section is empty.
Functions ¶
func GetCondition ¶
func GetCondition(status *llamav1alpha1.LlamaStackDistributionStatus, conditionType string) *metav1.Condition
GetCondition returns a condition by type.
func IsConditionFalse ¶
func IsConditionFalse(status *llamav1alpha1.LlamaStackDistributionStatus, conditionType string) bool
IsConditionFalse returns true if the condition is false.
func IsConditionTrue ¶
func IsConditionTrue(status *llamav1alpha1.LlamaStackDistributionStatus, conditionType string) bool
IsConditionTrue returns true if the condition is true.
func SetCondition ¶
func SetCondition(status *llamav1alpha1.LlamaStackDistributionStatus, condition metav1.Condition)
SetCondition sets a condition in the status.
func SetDeploymentReadyCondition ¶
func SetDeploymentReadyCondition(status *llamav1alpha1.LlamaStackDistributionStatus, ready bool, message string)
SetDeploymentReadyCondition sets the deployment ready condition.
func SetHealthCheckCondition ¶
func SetHealthCheckCondition(status *llamav1alpha1.LlamaStackDistributionStatus, healthy bool, message string)
SetHealthCheckCondition sets the health check condition.
func SetServiceReadyCondition ¶
func SetServiceReadyCondition(status *llamav1alpha1.LlamaStackDistributionStatus, ready bool, message string)
SetServiceReadyCondition sets the service ready condition.
func SetStorageReadyCondition ¶
func SetStorageReadyCondition(status *llamav1alpha1.LlamaStackDistributionStatus, ready bool, message string)
SetStorageReadyCondition sets the storage ready condition.
Types ¶
type LlamaStackDistributionReconciler ¶
type LlamaStackDistributionReconciler struct {
client.Client
Scheme *runtime.Scheme
// Feature flags
EnableNetworkPolicy bool
// Cluster info
ClusterInfo *cluster.ClusterInfo
// contains filtered or unexported fields
}
LlamaStackDistributionReconciler reconciles a LlamaStack object.
ConfigMap Watching Feature: This reconciler watches for changes to ConfigMaps referenced by LlamaStackDistribution CRs. When a ConfigMap's data changes, it automatically triggers reconciliation of the referencing LlamaStackDistribution, which recalculates a content-based hash and updates the deployment's pod template annotations. This causes Kubernetes to restart the pods with the updated configuration.
func NewLlamaStackDistributionReconciler ¶
func NewLlamaStackDistributionReconciler(ctx context.Context, client client.Client, scheme *runtime.Scheme, clusterInfo *cluster.ClusterInfo) (*LlamaStackDistributionReconciler, error)
NewLlamaStackDistributionReconciler creates a new reconciler with default image mappings.
func NewTestReconciler ¶
func NewTestReconciler(client client.Client, scheme *runtime.Scheme, clusterInfo *cluster.ClusterInfo, httpClient *http.Client, enableNetworkPolicy bool) *LlamaStackDistributionReconciler
NewTestReconciler creates a reconciler for testing, allowing injection of a custom http client and feature flags.
func (*LlamaStackDistributionReconciler) Reconcile ¶
func (r *LlamaStackDistributionReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. the LlamaStack object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.12.2/pkg/reconcile
func (*LlamaStackDistributionReconciler) SetupWithManager ¶
func (r *LlamaStackDistributionReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.