Documentation
¶
Index ¶
- type AppLogStreamer
- type InternalAppLogsService
- type InternalAppService
- func (s *InternalAppService) Create(ctx context.Context, req *connect.Request[flyteapp.CreateRequest]) (*connect.Response[flyteapp.CreateResponse], error)
- func (s *InternalAppService) Delete(ctx context.Context, req *connect.Request[flyteapp.DeleteRequest]) (*connect.Response[flyteapp.DeleteResponse], error)
- func (s *InternalAppService) Get(ctx context.Context, req *connect.Request[flyteapp.GetRequest]) (*connect.Response[flyteapp.GetResponse], error)
- func (s *InternalAppService) List(ctx context.Context, req *connect.Request[flyteapp.ListRequest]) (*connect.Response[flyteapp.ListResponse], error)
- func (s *InternalAppService) Update(ctx context.Context, req *connect.Request[flyteapp.UpdateRequest]) (*connect.Response[flyteapp.UpdateResponse], error)
- func (s *InternalAppService) Watch(ctx context.Context, req *connect.Request[flyteapp.WatchRequest], ...) error
- type K8sAppLogStreamer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppLogStreamer ¶ added in v2.0.14
type AppLogStreamer interface {
TailLogs(ctx context.Context, replicaID *flyteapp.ReplicaIdentifier, send func(*flyteapp.LogLines) error) error
}
AppLogStreamer streams pod logs for an app replica.
type InternalAppLogsService ¶ added in v2.0.14
type InternalAppLogsService struct {
appconnect.UnimplementedAppLogsServiceHandler
// contains filtered or unexported fields
}
InternalAppLogsService is the data plane implementation of AppLogsService. It resolves an app_id or replica_id to the backing pods and streams logs.
func NewInternalAppLogsService ¶ added in v2.0.14
func NewInternalAppLogsService(k8sClient appk8s.AppK8sClientInterface, streamer AppLogStreamer) *InternalAppLogsService
NewInternalAppLogsService creates a new InternalAppLogsService.
func (*InternalAppLogsService) TailLogs ¶ added in v2.0.14
func (s *InternalAppLogsService) TailLogs( ctx context.Context, req *connect.Request[flyteapp.TailLogsRequest], stream *connect.ServerStream[flyteapp.TailLogsResponse], ) error
TailLogs streams log lines for the given app or replica.
type InternalAppService ¶
type InternalAppService struct {
appconnect.UnimplementedAppServiceHandler
// contains filtered or unexported fields
}
InternalAppService is the data plane implementation of the AppService. It has direct K8s access via AppK8sClientInterface.
func NewInternalAppService ¶
func NewInternalAppService(k8s appk8s.AppK8sClientInterface) *InternalAppService
NewInternalAppService creates a new InternalAppService.
func (*InternalAppService) Create ¶
func (s *InternalAppService) Create( ctx context.Context, req *connect.Request[flyteapp.CreateRequest], ) (*connect.Response[flyteapp.CreateResponse], error)
Create deploys a new app as a KService CRD.
func (*InternalAppService) Delete ¶
func (s *InternalAppService) Delete( ctx context.Context, req *connect.Request[flyteapp.DeleteRequest], ) (*connect.Response[flyteapp.DeleteResponse], error)
Delete removes the KService CRD for the given app entirely.
func (*InternalAppService) Get ¶
func (s *InternalAppService) Get( ctx context.Context, req *connect.Request[flyteapp.GetRequest], ) (*connect.Response[flyteapp.GetResponse], error)
Get retrieves an app and its live status from the KService CRD. Note: App.Spec is not populated — status and ingress URL are the authoritative fields.
func (*InternalAppService) List ¶
func (s *InternalAppService) List( ctx context.Context, req *connect.Request[flyteapp.ListRequest], ) (*connect.Response[flyteapp.ListResponse], error)
List returns apps for the requested scope with pagination.
func (*InternalAppService) Update ¶
func (s *InternalAppService) Update( ctx context.Context, req *connect.Request[flyteapp.UpdateRequest], ) (*connect.Response[flyteapp.UpdateResponse], error)
Update modifies an app's spec or desired state. When Spec.DesiredState is STOPPED, the app is scaled to zero (KService kept). When Spec.DesiredState is STARTED or ACTIVE, the app is redeployed/resumed. Otherwise the spec update is applied and the app is redeployed.
func (*InternalAppService) Watch ¶
func (s *InternalAppService) Watch( ctx context.Context, req *connect.Request[flyteapp.WatchRequest], stream *connect.ServerStream[flyteapp.WatchResponse], ) error
Watch streams live KService events to the client. It first sends the current state as CreateEvents (initial snapshot), then streams changes.
type K8sAppLogStreamer ¶ added in v2.0.14
type K8sAppLogStreamer struct {
// contains filtered or unexported fields
}
K8sAppLogStreamer streams logs from the pod backing an app replica.
func NewK8sAppLogStreamer ¶ added in v2.0.14
func NewK8sAppLogStreamer(k8sConfig *rest.Config) (*K8sAppLogStreamer, error)
NewK8sAppLogStreamer creates a K8sAppLogStreamer from a Kubernetes REST config. It clears the timeout so that long-lived log streams are not interrupted.