Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deployer ¶
type Deployer struct {
Client client.Client
FaaSAdaptor kdexv1alpha1.KDexFaaSAdaptorSpec
Host kdexv1alpha1.KDexInternalHost
ImagePullSecrets []corev1.LocalObjectReference
Scheme *runtime.Scheme
ServiceAccount string
// TokenPrefix is the host's resolved white-label PASETO API token prefix
// (per-host spec or NexusConfiguration default). Injected as
// PASETO_TOKEN_PREFIX so the function's verifier can restore the
// "v4.public." header. Empty => bare tokens (no prefixing). It MUST be the
// same value the host's TokenManager mints with.
TokenPrefix string
}
func (*Deployer) Deploy ¶
func (d *Deployer) Deploy(ctx context.Context, function *kdexv1alpha1.KDexFunction) (*batchv1.Job, error)
The FaaS adaptor is responsible for deploying the function. Since there are virtually unlimited number of ways to deploy a function, we use a job as a bridge between the Nexus controller and the FaaS adaptor. The workload provided by the FaaS adaptor knows how to deploy the function. Whether the functions are deployed on KNative, AWS Lambda, Google Cloud Functions, Azure Functions, or something else is irrelevant to the Nexus controller. The job is responsible for deploying the function and reporting the status of the deployment back to the Nexus controller. The job must return success or failure along with reasons, and upon success, at least the URL of the function so that the Focal Controller can mount it into the host's service mesh and dispatch requests to it.
func (*Deployer) Observe ¶
func (d *Deployer) Observe(ctx context.Context, function *kdexv1alpha1.KDexFunction) (client.Object, error)
type Runtime ¶
type Runtime interface {
// Deploy returns a Job that, when executed, will deploy or update the function.
// The Job is expected to update the KDexFunction status upon completion.
Deploy(ctx context.Context, function *kdexv1alpha1.KDexFunction) (*batchv1.Job, error)
// Observe returns a workload that, when executed, calls the provider API to check status.
// For external providers, this is likely a CronJob.
// For K8s-native providers (like Knative), this might return nil (if handled by standard Watch),
// or a no-op Job for consistency.
Observe(ctx context.Context, function *kdexv1alpha1.KDexFunction) (client.Object, error)
}
Runtime defines the interface for interacting with a FaaS provider.