Documentation
¶
Index ¶
- Constants
- func AirwayGVR() schema.GroupVersionResource
- func ClusterFlightGVR() schema.GroupVersionResource
- func FlightGVR() schema.GroupVersionResource
- func FlightInputStream(spec FlightSpec) io.Reader
- type Airway
- type AirwayMode
- type AirwaySpec
- type ClusterFlight
- type Flight
- type FlightSpec
- type PruneOptions
- type WasmURLs
Constants ¶
View Source
const ( KindAirway = "Airway" APIVersion = "yoke.cd/v1alpha1" )
View Source
const ( KindFlight = "Flight" KindClusterFlight = "ClusterFlight" )
Variables ¶
This section is empty.
Functions ¶
func AirwayGVR ¶
func AirwayGVR() schema.GroupVersionResource
func ClusterFlightGVR ¶
func ClusterFlightGVR() schema.GroupVersionResource
func FlightGVR ¶
func FlightGVR() schema.GroupVersionResource
func FlightInputStream ¶ added in v0.18.4
func FlightInputStream(spec FlightSpec) io.Reader
Types ¶
type Airway ¶
type Airway struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitzero"`
Spec AirwaySpec `json:"spec"`
Status flight.Status `json:"status,omitzero"`
}
func (Airway) CRD ¶
func (airway Airway) CRD() *apiextensionsv1.CustomResourceDefinition
CRD returns the CustomResourceDefinition as described by the template. The CRD will share the same name as the Airway and is owned by it.
func (Airway) CRGroupResource ¶
func (airway Airway) CRGroupResource() schema.GroupResource
CRGroupResource returns the schema.GroupResource of the Custom Resource as defined by its CRD template.
func (*Airway) DeepCopyObject ¶ added in v0.19.7
func (Airway) MarshalJSON ¶
func (Airway) OpenAPISchema ¶ added in v0.18.4
func (Airway) OpenAPISchema() *apiextensionsv1.JSONSchemaProps
type AirwayMode ¶
type AirwayMode string
const ( AirwayModeStandard AirwayMode = "standard" AirwayModeStatic AirwayMode = "static" AirwayModeDynamic AirwayMode = "dynamic" AirwayModeSubscription AirwayMode = "subscription" )
func (AirwayMode) IsDynamic ¶ added in v0.19.4
func (mode AirwayMode) IsDynamic() bool
func (AirwayMode) OpenAPISchema ¶
func (AirwayMode) OpenAPISchema() *apiextensionsv1.JSONSchemaProps
type AirwaySpec ¶
type AirwaySpec struct {
// WasmURLs defines the locations for the various implementations the AirTrafficController will invoke.
WasmURLs WasmURLs `json:"wasmUrls" Description:"Remote WASM URLS backing the Airway."`
// ObjectPath allows you to set a path within your CR to the value you wish to pass to your flight.
// By default the entire Custom Resource is injected via STDIN to your flight implementation.
// If, for example, you wish to encode the "spec" property over STDIN you would set ObjectPath to []string{"spec"}.
ObjectPath []string `` /* 155-byte string literal not displayed */
// FixDriftInterval sets an interval at which the resource is requeued for evaluation by the AirTrafficController.
// The ATC will attempt to reapply the resource. In most cases this will result in a noop. If however a user
// changed any of the underlying resource's configuration, this will be set back via this mechanism. It allows
// you to enforce the desired state of your resource against external manipulation.
FixDriftInterval metav1.Duration `json:"fixDriftInterval,omitzero" Description:"Interval to requeue flight for evaluation. Self-healing mechanism."`
// ClusterAccess allows the flight to lookup resources in the cluster. Resources are limited to those owned by the calling release.
ClusterAccess bool `json:"clusterAccess,omitempty" Default:"false" Description:"Allow flight access to the cluster via WASI SDK."`
// ResourceAccessMatchers combined with ClusterAccess allow you to lookup any resource in your cluster. By default without any matchers
// the only resources that you can lookup are resources that are directly owned by the release. If you wish to access resources external
// to the release you can provide a set of matcher patterns. If any pattern matches, the resource is allowed to by accessed.
//
// The pattern goes like this: $namespace/$Kind.Group:$name
// Where namespace and name are optional. If they are omitted it is the same as setting them to '*'.
//
// Examples Matchers:
// - Deployment.apps # matches all deployments in your cluster
// - foo/Deployment.apps # matches all deployments in namespace foo
// - foo/Deployment.apps:example # matches a deployment named example in namespace foo.
// - * # matches all resources in the cluster.
// - foo/* # matches all resources in namespace foo.
ResourceAccessMatchers []string `` /* 144-byte string literal not displayed */
// Insecure only applies to flights using OCI urls. Allows image references to be fetched without TLS verification.
Insecure bool `` /* 152-byte string literal not displayed */
// SkipAdmissionWebhook bypasses admission webhook for the airway's CRs.
// The admission webhook validates that the resources that would be created pass a dry-run phase.
// However in the case of some multi-stage implementations, stages that depend on prior stages cannot pass dry-run.
// In this case there is no option but to skip the admission webhook.
//
// Therefore multi-stage Airways are not generally recommended.
SkipAdmissionWebhook bool `json:"skipAdmissionWebhook,omitempty" Description:"Skip admission validation for your airway instances."`
// Mode sets different behaviors for how the child resources of flights are managed by the ATC.
//
// - "standard" is the same not specifying any mode. In "standard" mode, flights are evaluated once
// and child resources are applied, and no further evaluation is made should child resources be modified.
//
// - "static" mode checks any change to a child resource against desired state at admission time.
// If any fields conflict with the desired state the change is rejected at admission.
//
// - "dynamic" mode requeues the parent flight for evaluation any time a child resource is modified.
// This means that if a conflicting state is found it will be reverted in realtime.
// The advantage of this mode over static, is that combined with cluster-access we can dynamically
// build new desired state based on external changes to child resources.
Mode AirwayMode `json:"mode,omitempty"`
// HistoryCapSize controls how many revisions of an instance (custom resource) of this airway is kept in history.
// To make it uncapped set this value to any negative integer.
// By default 2.
HistoryCapSize int `json:"historyCapSize,omitempty" Description:"Max length of history for releases generated by your instances. Default is 2."`
// Template is the CustomResourceDefinition Specification to create. A CRD will be created using this specification
// and bound to the implementation defined by the WasmURLs.Flight property.
Template apiextensionsv1.CustomResourceDefinitionSpec `json:"template" Description:"CRD defintion for your custom instances"`
// Prune enables pruning for resources that are not automatically pruned between updates or on deletion.
Prune PruneOptions `json:"prune,omitzero" Description:"Prune options for deletion of your instances"`
// MaxMemoryMib sets the maximum amount of memory an Airway instance's flight execution can allocate.
// Leaving it unset will allow the maximum amount of memory which is 4Gib. It is recommended to set a reasonable maximum
// when working with third party flights.
MaxMemoryMib uint32 `json:"maxMemoryMib,omitzero" Description:"Maximum amounts of Mib to allow the flight to allocate. Default is 4Gib."`
// Timeout is the timeout for the airway instance's flight execution. Default setting is 10s.
Timeout metav1.Duration `json:"timeout,omitzero" Description:"Maximum execution duration before flight is cancelled."`
}
func (AirwaySpec) OpenAPISchema ¶ added in v0.18.4
func (AirwaySpec) OpenAPISchema() *apiextensionsv1.JSONSchemaProps
type ClusterFlight ¶
type ClusterFlight Flight
func (*ClusterFlight) DeepCopyObject ¶ added in v0.19.7
func (flight *ClusterFlight) DeepCopyObject() runtime.Object
func (ClusterFlight) MarshalJSON ¶
func (flight ClusterFlight) MarshalJSON() ([]byte, error)
func (ClusterFlight) OpenAPISchema ¶ added in v0.18.4
func (ClusterFlight) OpenAPISchema() *apiextensionsv1.JSONSchemaProps
type Flight ¶
type Flight struct {
metav1.TypeMeta
metav1.ObjectMeta `json:"metadata,omitzero"`
Spec FlightSpec `json:"spec"`
Status flight.Status `json:"status,omitzero"`
}
func (*Flight) DeepCopyObject ¶ added in v0.19.7
func (Flight) MarshalJSON ¶
func (Flight) OpenAPISchema ¶ added in v0.18.4
func (Flight) OpenAPISchema() *apiextensionsv1.JSONSchemaProps
type FlightSpec ¶
type FlightSpec struct {
// WasmURLs defines the locations for the various implementations the AirTrafficController will invoke.
WasmURL string `json:"wasmUrl" Description:"URL of flight module. Can be http(s) or oci."`
// Checksum is the explicit sha256 checksum to verify wasm module against. If not present is inferred from url if possible.
Checksum string `` /* 143-byte string literal not displayed */
// Input will be passed to the flight over stdin. Flights are wasm programs and a string representation of the input
// is the most practical. This means that the input is not constrained to being json/yaml. It can be binary (base64), cue, toml,
// or any input expected by the underlying flight implementation.
// As a convenience, you can use InputObject for json/yaml formats. However Input takes precedence InputObject.
Input string `json:"input,omitzero" Description:"Raw input for for flight STDIN."`
// InputObject will be marshalled to JSON and passed as the input to the flight.
// This is a convenience to allow users to write their inputs within the json/yaml context of the flight resource
// instead of under a string property like Input. This field has no effect if Input is defined.
InputObject map[string]any `` /* 136-byte string literal not displayed */
Args []string `json:"args,omitempty" Description:"List of command-line args to be passed to flight during execution."`
// FixDriftInterval sets an interval at which the resource is requeued for evaluation by the AirTrafficController.
// The ATC will attempt to reapply the resource. In most cases this will result in a noop. If however a user
// changed any of the underlying resource's configuration, this will be set back via this mechanism. It allows
// you to enforce the desired state of your resource against external manipulation.
FixDriftInterval metav1.Duration `json:"fixDriftInterval,omitzero" Description:"Interval to requeue flight for evaluation. Self-healing mechanism."`
// ClusterAccess allows the flight to lookup resources in the cluster. Resources are limited to those owned by the calling release.
ClusterAccess bool `json:"clusterAccess,omitempty" Default:"false" Description:"Allow flight access to the cluster via WASI SDK."`
// ResourceAccessMatchers combined with ClusterAccess allow you to lookup any resource in your cluster. By default without any matchers
// the only resources that you can lookup are resources that are directly owned by the release. If you wish to access resources external
// to the release you can provide a set of matcher patterns. If any pattern matches, the resource is allowed to by accessed.
//
// The pattern goes like this: $namespace/$Kind.Group:$name
// Where namespace and name are optional. If they are omitted it is the same as setting them to '*'.
//
// Examples Matchers:
// - Deployment.apps # matches all deployments in your cluster
// - foo/Deployment.apps # matches all deployments in namespace foo
// - foo/Deployment.apps:example # matches a deployment named example in namespace foo.
// - * # matches all resources in the cluster.
// - foo/* # matches all resources in namespace foo.
ResourceAccessMatchers []string `` /* 144-byte string literal not displayed */
// Insecure only applies to flights using OCI urls. Allows image references to be fetched without TLS verification.
Insecure bool `` /* 152-byte string literal not displayed */
// SkipAdmissionWebhook bypasses admission webhook for the airway's CRs.
// The admission webhook validates that the resources that would be created pass a dry-run phase.
// However in the case of some multi-stage implementations, stages that depend on prior stages cannot pass dry-run.
// In this case there is no option but to skip the admission webhook.
//
// Therefore multi-stage Airways are not generally recommended.
SkipAdmissionWebhook bool `json:"skipAdmissionWebhook,omitempty" Description:"Skip admission validation for your flight."`
// HistoryCapSize controls how many revisions of an instance (custom resource) of this airway is kept in history.
// To make it uncapped set this value to any negative integer.
// By default 2.
HistoryCapSize int `json:"historyCapSize,omitempty" Description:"Max length of history for releases generated by your flight. Default is 2"`
// Prune enables pruning for resources that are not automatically pruned between updates or on deletion.
Prune PruneOptions `json:"prune,omitzero" Description:"Options for pruning sensitive resources on deletion."`
// MaxMemoryMib sets the maximum amount of memory an Airway instance's flight execution can allocate.
// Leaving it unset will allow the maximum amount of memory which is 4Gib. It is recommended to set a reasonable maximum
// when working with third party flights.
MaxMemoryMib uint32 `json:"maxMemoryMib,omitzero" Description:"Maximum amounts of Mib to allow the flight to allocate. Default is 4Gib."`
// Timeout is the timeout for the airway instance's flight execution. Default setting is 10s.
Timeout metav1.Duration `json:"timeout,omitzero" Description:"Maximum execution duration before flight is cancelled."`
}
func (FlightSpec) OpenAPISchema ¶ added in v0.18.4
func (FlightSpec) OpenAPISchema() *apiextensionsv1.JSONSchemaProps
type PruneOptions ¶
type PruneOptions struct {
// CRDs enables the pruning of CustomResourceDefinition resources.
// By default CRDs are orphaned but if set to true they will be removed. This cascades to deleting all custom resources defined by the CRD.
// Destructive and dangerous, use with care.
CRDs bool `json:"crds,omitzero" Description:"Delete owned CRDs on deletion"`
// Namespaces enables the pruning of Namespace resources.
// By default namespaces are orphaned but if set to true they will be removed. This cascades to deleting all resources within the namespace.
// Destructive and dangerous, use with care.
Namespaces bool `json:"namespaces,omitzero" Description:"Delete owned namespaces on deletion"`
}
PruneOptions describes the resources we wish to enable pruning for.
type WasmURLs ¶
type WasmURLs struct {
// Flight is the implementation used to implement the CustomResource as a Package. The flight is always applied against
// the storage version of the Custom Resource. This property is required.
Flight string `json:"flight" Description:"URL to flight module. Supports http(s) or oci."`
// FlightChecksum is the explicit sha256 checksum to verify flight against.
// Useful when module cannot be referenced by its checksum implicity via tag or path components.
FlightChecksum string `` /* 189-byte string literal not displayed */
// Converter is the implementation of the conversion webhook. If present, the ATC will automatically use it to serve conversion
// requests between the various served versions of the Custom Resource.
Converter string `json:"converter,omitempty" Description:"URL to converter module. Used for conversion webhooks. Supports http(s) or oci."`
// ConverterChecksum is the explicit sha256 checksum to verify converter against.
// Useful when module cannot be referenced by its checksum implicity via tag or path components.
ConverterChecksum string `` /* 195-byte string literal not displayed */
}
Click to show internal directories.
Click to hide internal directories.