v1alpha1

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

README

Knative Serving API v1alpha1

This is the implementation of the Knative Serving API, which is specified in docs/spec/spec.md and verified via the conformance tests.

Updates to this implementation should include a corresponding change to the spec and the conformance tests. (#780)

Documentation

Overview

+k8s:deepcopy-gen=package +groupName=serving.knative.dev

Index

Constants

This section is empty.

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: serving.GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type Configuration

type Configuration struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec holds the desired state of the Configuration (from the client).
	// +optional
	Spec ConfigurationSpec `json:"spec,omitempty"`

	// Status communicates the observed state of the Configuration (from the controller).
	// +optional
	Status ConfigurationStatus `json:"status,omitempty"`
}

Configuration represents the "floating HEAD" of a linear history of Revisions, and optionally how the containers those revisions reference are built. Users create new Revisions by updating the Configuration's spec. The "latest created" revision's name is available under status, as is the "latest ready" revision's name. See also: https://github.com/knative/serving/blob/master/docs/spec/overview.md#configuration

func (*Configuration) DeepCopy

func (in *Configuration) DeepCopy() *Configuration

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Configuration.

func (*Configuration) DeepCopyInto

func (in *Configuration) DeepCopyInto(out *Configuration)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Configuration) DeepCopyObject

func (in *Configuration) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Configuration) GetGeneration

func (r *Configuration) GetGeneration() int64

func (*Configuration) GetSpecJSON

func (r *Configuration) GetSpecJSON() ([]byte, error)

func (*Configuration) SetDefaults

func (c *Configuration) SetDefaults()

func (*Configuration) SetGeneration

func (r *Configuration) SetGeneration(generation int64)

func (*Configuration) Validate

func (c *Configuration) Validate() *FieldError

type ConfigurationCondition

type ConfigurationCondition struct {
	Type ConfigurationConditionType `json:"type" description:"type of Configuration condition"`

	Status corev1.ConditionStatus `json:"status" description:"status of the condition, one of True, False, Unknown"`

	// +optional
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" description:"last time the condition transit from one status to another"`

	// +optional
	Reason string `json:"reason,omitempty" description:"one-word CamelCase reason for the condition's last transition"`

	// +optional
	Message string `json:"message,omitempty" description:"human-readable message indicating details about last transition"`
}

ConfigurationCondition defines a readiness condition for a Configuration. See: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#typical-status-properties

func (*ConfigurationCondition) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationCondition.

func (*ConfigurationCondition) DeepCopyInto

func (in *ConfigurationCondition) DeepCopyInto(out *ConfigurationCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ConfigurationConditionType

type ConfigurationConditionType string

ConfigurationConditionType is used to communicate the status of the reconciliation process. See also: https://github.com/knative/serving/blob/master/docs/spec/errors.md#error-conditions-and-reporting

const (
	// ConfigurationConditionReady is set when the configuration's latest
	// underlying revision has reported readiness.
	ConfigurationConditionReady ConfigurationConditionType = "Ready"
)

type ConfigurationList

type ConfigurationList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []Configuration `json:"items"`
}

ConfigurationList is a list of Configuration resources

func (*ConfigurationList) DeepCopy

func (in *ConfigurationList) DeepCopy() *ConfigurationList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationList.

func (*ConfigurationList) DeepCopyInto

func (in *ConfigurationList) DeepCopyInto(out *ConfigurationList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ConfigurationList) DeepCopyObject

func (in *ConfigurationList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ConfigurationSpec

type ConfigurationSpec struct {
	// TODO: Generation does not work correctly with CRD. They are scrubbed
	// by the APIserver (https://github.com/kubernetes/kubernetes/issues/58778)
	// So, we add Generation here. Once that gets fixed, remove this and use
	// ObjectMeta.Generation instead.
	// +optional
	Generation int64 `json:"generation,omitempty"`

	// Build optionally holds the specification for the build to
	// perform to produce the Revision's container image.
	// +optional
	Build *build.BuildSpec `json:"build,omitempty"`

	// RevisionTemplate holds the latest specification for the Revision to
	// be stamped out. If a Build specification is provided, then the
	// RevisionTemplate's BuildName field will be populated with the name of
	// the Build object created to produce the container for the Revision.
	// +optional
	RevisionTemplate RevisionTemplateSpec `json:"revisionTemplate"`
}

ConfigurationSpec holds the desired state of the Configuration (from the client).

func (*ConfigurationSpec) DeepCopy

func (in *ConfigurationSpec) DeepCopy() *ConfigurationSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationSpec.

func (*ConfigurationSpec) DeepCopyInto

func (in *ConfigurationSpec) DeepCopyInto(out *ConfigurationSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ConfigurationSpec) SetDefaults

func (cs *ConfigurationSpec) SetDefaults()

func (*ConfigurationSpec) Validate

func (cs *ConfigurationSpec) Validate() *FieldError

type ConfigurationStatus

type ConfigurationStatus struct {
	// Conditions communicates information about ongoing/complete
	// reconciliation processes that bring the "spec" inline with the observed
	// state of the world.
	// +optional
	Conditions []ConfigurationCondition `json:"conditions,omitempty"`

	// LatestReadyRevisionName holds the name of the latest Revision stamped out
	// from this Configuration that has had its "Ready" condition become "True".
	// +optional
	LatestReadyRevisionName string `json:"latestReadyRevisionName,omitempty"`

	// LatestCreatedRevisionName is the last revision that was created from this
	// Configuration. It might not be ready yet, for that use LatestReadyRevisionName.
	// +optional
	LatestCreatedRevisionName string `json:"latestCreatedRevisionName,omitempty"`

	// ObservedGeneration is the 'Generation' of the Configuration that
	// was last processed by the controller. The observed generation is updated
	// even if the controller failed to process the spec and create the Revision.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

ConfigurationStatus communicates the observed state of the Configuration (from the controller).

func (*ConfigurationStatus) DeepCopy

func (in *ConfigurationStatus) DeepCopy() *ConfigurationStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationStatus.

func (*ConfigurationStatus) DeepCopyInto

func (in *ConfigurationStatus) DeepCopyInto(out *ConfigurationStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ConfigurationStatus) GetCondition

func (*ConfigurationStatus) InitializeConditions

func (cs *ConfigurationStatus) InitializeConditions()

func (*ConfigurationStatus) IsLatestReadyRevisionNameUpToDate

func (cs *ConfigurationStatus) IsLatestReadyRevisionNameUpToDate() bool

IsLatestReadyRevisionNameUpToDate returns true if the Configuration is ready and LatestCreateRevisionName is equal to LatestReadyRevisionName. Otherwise it returns false.

func (*ConfigurationStatus) IsReady

func (cs *ConfigurationStatus) IsReady() bool

IsReady looks at the conditions on the ConfigurationStatus. ConfigurationConditionReady returns true if ConditionStatus is True

func (*ConfigurationStatus) MarkLatestCreatedFailed

func (cs *ConfigurationStatus) MarkLatestCreatedFailed(name, message string)

func (*ConfigurationStatus) MarkLatestReadyDeleted

func (cs *ConfigurationStatus) MarkLatestReadyDeleted()

func (*ConfigurationStatus) MarkRevisionCreationFailed

func (cs *ConfigurationStatus) MarkRevisionCreationFailed(message string)

func (*ConfigurationStatus) RemoveCondition

func (cs *ConfigurationStatus) RemoveCondition(t ConfigurationConditionType)

func (*ConfigurationStatus) SetLatestCreatedRevisionName

func (cs *ConfigurationStatus) SetLatestCreatedRevisionName(name string)

func (*ConfigurationStatus) SetLatestReadyRevisionName

func (cs *ConfigurationStatus) SetLatestReadyRevisionName(name string)

type Defaultable

type Defaultable interface {
	SetDefaults()
}

Defaultable defines an interface for setting the defaults for the uninitialized fields of this instance.

type FieldError

type FieldError struct {
	Message string
	Paths   []string
	// Details contains an optional longer payload.
	Details string
}

FieldError is used to propagate the context of errors pertaining to specific fields in a manner suitable for use in a recursive walk, so that errors contain the appropriate field context. +k8s:deepcopy-gen=false

func (*FieldError) Error

func (fe *FieldError) Error() string

Error implements error

func (*FieldError) ViaField

func (fe *FieldError) ViaField(prefix ...string) *FieldError

ViaField is used to propagate a validation error along a field access. For example, if a type recursively validates its "spec" via:

if err := foo.Spec.Validate(); err != nil {
  // Augment any field paths with the context that they were accessed
  // via "spec".
  return err.ViaField("spec")
}

type HasImmutableFields

type HasImmutableFields interface {
	// CheckImmutableFields checks that the current instance's immutable
	// fields haven't changed from the provided original.
	CheckImmutableFields(original HasImmutableFields) *FieldError
}

HasImmutableFields indicates that a particular type has fields that should not change after creation.

type PinnedType

type PinnedType struct {
	// The revision name to pin this service to until changed
	// to a different service type.
	// +optional
	RevisionName string `json:"revisionName,omitempty"`

	// The configuration for this service.
	// +optional
	Configuration ConfigurationSpec `json:"configuration,omitempty"`
}

func (*PinnedType) DeepCopy

func (in *PinnedType) DeepCopy() *PinnedType

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PinnedType.

func (*PinnedType) DeepCopyInto

func (in *PinnedType) DeepCopyInto(out *PinnedType)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PinnedType) Validate

func (pt *PinnedType) Validate() *FieldError

type Revision

type Revision struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec holds the desired state of the Revision (from the client).
	// +optional
	Spec RevisionSpec `json:"spec,omitempty"`

	// Status communicates the observed state of the Revision (from the controller).
	// +optional
	Status RevisionStatus `json:"status,omitempty"`
}

Revision is an immutable snapshot of code and configuration. A revision references a container image, and optionally a build that is responsible for materializing that container image from source. Revisions are created by updates to a Configuration.

See also: https://github.com/knative/serving/blob/master/docs/spec/overview.md#revision

func (*Revision) CheckImmutableFields

func (current *Revision) CheckImmutableFields(og HasImmutableFields) *FieldError

func (*Revision) DeepCopy

func (in *Revision) DeepCopy() *Revision

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Revision.

func (*Revision) DeepCopyInto

func (in *Revision) DeepCopyInto(out *Revision)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Revision) DeepCopyObject

func (in *Revision) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Revision) GetGeneration

func (r *Revision) GetGeneration() int64

func (*Revision) GetSpecJSON

func (r *Revision) GetSpecJSON() ([]byte, error)

func (*Revision) SetDefaults

func (r *Revision) SetDefaults()

func (*Revision) SetGeneration

func (r *Revision) SetGeneration(generation int64)

func (*Revision) Validate

func (rt *Revision) Validate() *FieldError

type RevisionCondition

type RevisionCondition struct {
	Type RevisionConditionType `json:"type" description:"type of Revision condition"`

	Status corev1.ConditionStatus `json:"status" description:"status of the condition, one of True, False, Unknown"`

	// +optional
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" description:"last time the condition transit from one status to another"`

	// +optional
	Reason string `json:"reason,omitempty" description:"one-word CamelCase reason for the condition's last transition"`

	// +optional
	Message string `json:"message,omitempty" description:"human-readable message indicating details about last transition"`
}

RevisionCondition defines a readiness condition for a Revision. See: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#typical-status-properties

func (*RevisionCondition) DeepCopy

func (in *RevisionCondition) DeepCopy() *RevisionCondition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RevisionCondition.

func (*RevisionCondition) DeepCopyInto

func (in *RevisionCondition) DeepCopyInto(out *RevisionCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RevisionConditionType

type RevisionConditionType string

RevisionConditionType is used to communicate the status of the reconciliation process. See also: https://github.com/knative/serving/blob/master/docs/spec/errors.md#error-conditions-and-reporting

const (
	// RevisionConditionReady is set when the revision is starting to materialize
	// runtime resources, and becomes true when those resources are ready.
	RevisionConditionReady RevisionConditionType = "Ready"
	// RevisionConditionBuildComplete is set when the revision has an associated build
	// and is marked True if/once the Build has completed succesfully.
	RevisionConditionBuildSucceeded RevisionConditionType = "BuildSucceeded"
	// RevisionConditionResourcesAvailable is set when underlying
	// Kubernetes resources have been provisioned.
	RevisionConditionResourcesAvailable RevisionConditionType = "ResourcesAvailable"
	// RevisionConditionContainerHealthy is set when the revision readiness check completes.
	RevisionConditionContainerHealthy RevisionConditionType = "ContainerHealthy"
)

type RevisionList

type RevisionList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []Revision `json:"items"`
}

RevisionList is a list of Revision resources

func (*RevisionList) DeepCopy

func (in *RevisionList) DeepCopy() *RevisionList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RevisionList.

func (*RevisionList) DeepCopyInto

func (in *RevisionList) DeepCopyInto(out *RevisionList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RevisionList) DeepCopyObject

func (in *RevisionList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RevisionRequestConcurrencyModelType

type RevisionRequestConcurrencyModelType string

RevisionRequestConcurrencyModelType is an enumeration of the concurrency models supported by a Revision.

const (
	// RevisionRequestConcurrencyModelSingle guarantees that only one
	// request will be handled at a time (concurrently) per instance
	// of Revision Container.
	RevisionRequestConcurrencyModelSingle RevisionRequestConcurrencyModelType = "Single"
	// RevisionRequestConcurencyModelMulti allows more than one request to
	// be handled at a time (concurrently) per instance of Revision
	// Container.
	RevisionRequestConcurrencyModelMulti RevisionRequestConcurrencyModelType = "Multi"
)

func (RevisionRequestConcurrencyModelType) Validate

type RevisionServingStateType

type RevisionServingStateType string

RevisionServingStateType is an enumeration of the levels of serving readiness of the Revision. See also: https://github.com/knative/serving/blob/master/docs/spec/errors.md#error-conditions-and-reporting

const (
	// The revision is ready to serve traffic. It should have Kubernetes
	// resources, and the Istio route should be pointed to the given resources.
	RevisionServingStateActive RevisionServingStateType = "Active"
	// The revision is not currently serving traffic, but could be made to serve
	// traffic quickly. It should have Kubernetes resources, but the Istio route
	// should be pointed to the activator.
	RevisionServingStateReserve RevisionServingStateType = "Reserve"
	// The revision has been decommissioned and is not needed to serve traffic
	// anymore. It should not have any Istio routes or Kubernetes resources.
	// A Revision may be brought out of retirement, but it may take longer than
	// it would from a "Reserve" state.
	// Note: currently not set anywhere. See https://github.com/knative/serving/issues/1203
	RevisionServingStateRetired RevisionServingStateType = "Retired"
)

func (RevisionServingStateType) Validate

func (ss RevisionServingStateType) Validate() *FieldError

type RevisionSpec

type RevisionSpec struct {
	// TODO: Generation does not work correctly with CRD. They are scrubbed
	// by the APIserver (https://github.com/kubernetes/kubernetes/issues/58778)
	// So, we add Generation here. Once that gets fixed, remove this and use
	// ObjectMeta.Generation instead.
	// +optional
	Generation int64 `json:"generation,omitempty"`

	// ServingState holds a value describing the desired state the Kubernetes
	// resources should be in for this Revision.
	// Users must not specify this when creating a revision. It is expected
	// that the system will manipulate this based on routability and load.
	// +optional
	ServingState RevisionServingStateType `json:"servingState,omitempty"`

	// ConcurrencyModel specifies the desired concurrency model
	// (Single or Multi) for the
	// Revision. Defaults to Multi.
	// +optional
	ConcurrencyModel RevisionRequestConcurrencyModelType `json:"concurrencyModel,omitempty"`

	// ServiceAccountName holds the name of the Kubernetes service account
	// as which the underlying K8s resources should be run. If unspecified
	// this will default to the "default" service account for the namespace
	// in which the Revision exists.
	// This may be used to provide access to private container images by
	// following: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#add-imagepullsecrets-to-a-service-account
	// TODO(ZhiminXiang): verify the corresponding service account exists.
	// +optional
	ServiceAccountName string `json:"serviceAccountName,omitempty"`

	// BuildName optionally holds the name of the Build responsible for
	// producing the container image for its Revision.
	// +optional
	BuildName string `json:"buildName,omitempty"`

	// Container defines the unit of execution for this Revision.
	// In the context of a Revision, we disallow a number of the fields of
	// this Container, including: name, resources, ports, and volumeMounts.
	// TODO(mattmoor): Link to the runtime contract tracked by:
	// https://github.com/knative/serving/issues/627
	// +optional
	Container corev1.Container `json:"container,omitempty"`
}

RevisionSpec holds the desired state of the Revision (from the client).

func (*RevisionSpec) DeepCopy

func (in *RevisionSpec) DeepCopy() *RevisionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RevisionSpec.

func (*RevisionSpec) DeepCopyInto

func (in *RevisionSpec) DeepCopyInto(out *RevisionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RevisionSpec) SetDefaults

func (rs *RevisionSpec) SetDefaults()

func (*RevisionSpec) Validate

func (rs *RevisionSpec) Validate() *FieldError

type RevisionStatus

type RevisionStatus struct {
	// ServiceName holds the name of a core Kubernetes Service resource that
	// load balances over the pods backing this Revision. When the Revision
	// is Active, this service would be an appropriate ingress target for
	// targeting the revision.
	// +optional
	ServiceName string `json:"serviceName,omitempty"`

	// Conditions communicates information about ongoing/complete
	// reconciliation processes that bring the "spec" inline with the observed
	// state of the world.
	// +optional
	Conditions []RevisionCondition `json:"conditions,omitempty"`

	// ObservedGeneration is the 'Generation' of the Configuration that
	// was last processed by the controller. The observed generation is updated
	// even if the controller failed to process the spec and create the Revision.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// LogURL specifies the generated logging url for this particular revision
	// based on the revision url template specified in the controller's config.
	// +optional
	LogURL string `json:"logUrl,omitempty"`
}

RevisionStatus communicates the observed state of the Revision (from the controller).

func (*RevisionStatus) DeepCopy

func (in *RevisionStatus) DeepCopy() *RevisionStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RevisionStatus.

func (*RevisionStatus) DeepCopyInto

func (in *RevisionStatus) DeepCopyInto(out *RevisionStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RevisionStatus) GetCondition

func (*RevisionStatus) InitializeBuildCondition

func (rs *RevisionStatus) InitializeBuildCondition()

func (*RevisionStatus) InitializeConditions

func (rs *RevisionStatus) InitializeConditions()

func (*RevisionStatus) IsActivationRequired

func (rs *RevisionStatus) IsActivationRequired() bool

func (*RevisionStatus) IsReady

func (rs *RevisionStatus) IsReady() bool

IsReady looks at the conditions and if the Status has a condition RevisionConditionReady returns true if ConditionStatus is True

func (*RevisionStatus) IsRoutable

func (rs *RevisionStatus) IsRoutable() bool

func (*RevisionStatus) MarkContainerHealthy

func (rs *RevisionStatus) MarkContainerHealthy()

func (*RevisionStatus) MarkContainerMissing

func (rs *RevisionStatus) MarkContainerMissing(message string)

func (*RevisionStatus) MarkDeploying

func (rs *RevisionStatus) MarkDeploying(reason string)

func (*RevisionStatus) MarkInactive

func (rs *RevisionStatus) MarkInactive()

func (*RevisionStatus) MarkProgressDeadlineExceeded

func (rs *RevisionStatus) MarkProgressDeadlineExceeded(message string)

func (*RevisionStatus) MarkResourcesAvailable

func (rs *RevisionStatus) MarkResourcesAvailable()

func (*RevisionStatus) MarkServiceTimeout

func (rs *RevisionStatus) MarkServiceTimeout()

func (*RevisionStatus) PropagateBuildStatus

func (rs *RevisionStatus) PropagateBuildStatus(bs buildv1alpha1.BuildStatus)

func (*RevisionStatus) RemoveCondition

func (rs *RevisionStatus) RemoveCondition(t RevisionConditionType)

type RevisionTemplateSpec

type RevisionTemplateSpec struct {
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`
	// +optional
	Spec RevisionSpec `json:"spec,omitempty"`
}

RevisionTemplateSpec describes the data a revision should have when created from a template. Based on: https://github.com/kubernetes/api/blob/e771f807/core/v1/types.go#L3179-L3190

func (*RevisionTemplateSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RevisionTemplateSpec.

func (*RevisionTemplateSpec) DeepCopyInto

func (in *RevisionTemplateSpec) DeepCopyInto(out *RevisionTemplateSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RevisionTemplateSpec) Validate

func (rt *RevisionTemplateSpec) Validate() *FieldError

type Route

type Route struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec holds the desired state of the Route (from the client).
	// +optional
	Spec RouteSpec `json:"spec,omitempty"`

	// Status communicates the observed state of the Route (from the controller).
	// +optional
	Status RouteStatus `json:"status,omitempty"`
}

Route is responsible for configuring ingress over a collection of Revisions. Some of the Revisions a Route distributes traffic over may be specified by referencing the Configuration responsible for creating them; in these cases the Route is additionally responsible for monitoring the Configuration for "latest ready" revision changes, and smoothly rolling out latest revisions. See also: https://github.com/knative/serving/blob/master/docs/spec/overview.md#route

func (*Route) DeepCopy

func (in *Route) DeepCopy() *Route

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Route.

func (*Route) DeepCopyInto

func (in *Route) DeepCopyInto(out *Route)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Route) DeepCopyObject

func (in *Route) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Route) GetGeneration

func (r *Route) GetGeneration() int64

func (*Route) GetSpecJSON

func (r *Route) GetSpecJSON() ([]byte, error)

func (*Route) SetDefaults

func (r *Route) SetDefaults()

func (*Route) SetGeneration

func (r *Route) SetGeneration(generation int64)

func (*Route) Validate

func (rt *Route) Validate() *FieldError

type RouteCondition

type RouteCondition struct {
	Type RouteConditionType `json:"type"`

	Status corev1.ConditionStatus `json:"status" description:"status of the condition, one of True, False, Unknown"`

	// +optional
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" description:"last time the condition transit from one status to another"`

	// +optional
	Reason string `json:"reason,omitempty" description:"one-word CamelCase reason for the condition's last transition"`
	// +optional
	Message string `json:"message,omitempty" description:"human-readable message indicating details about last transition"`
}

RouteCondition defines a readiness condition. See: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#typical-status-properties

func (*RouteCondition) DeepCopy

func (in *RouteCondition) DeepCopy() *RouteCondition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteCondition.

func (*RouteCondition) DeepCopyInto

func (in *RouteCondition) DeepCopyInto(out *RouteCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RouteConditionType

type RouteConditionType string

RouteConditionType is used to communicate the status of the reconciliation process. See also: https://github.com/knative/serving/blob/master/docs/spec/errors.md#error-conditions-and-reporting

const (
	// RouteConditionReady is set when the service is configured
	// and has available backends ready to receive traffic.
	RouteConditionReady RouteConditionType = "Ready"

	// RouteConditionAllTrafficAssigned is set to False when the
	// service is not configured properly or has no available
	// backends ready to receive traffic.
	RouteConditionAllTrafficAssigned RouteConditionType = "AllTrafficAssigned"
)

type RouteList

type RouteList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []Route `json:"items"`
}

RouteList is a list of Route resources

func (*RouteList) DeepCopy

func (in *RouteList) DeepCopy() *RouteList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteList.

func (*RouteList) DeepCopyInto

func (in *RouteList) DeepCopyInto(out *RouteList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RouteList) DeepCopyObject

func (in *RouteList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RouteSpec

type RouteSpec struct {
	// TODO: Generation does not work correctly with CRD. They are scrubbed
	// by the APIserver (https://github.com/kubernetes/kubernetes/issues/58778)
	// So, we add Generation here. Once that gets fixed, remove this and use
	// ObjectMeta.Generation instead.
	// +optional
	Generation int64 `json:"generation,omitempty"`

	// Traffic specifies how to distribute traffic over a collection of Knative Serving Revisions and Configurations.
	// +optional
	Traffic []TrafficTarget `json:"traffic,omitempty"`
}

RouteSpec holds the desired state of the Route (from the client).

func (*RouteSpec) DeepCopy

func (in *RouteSpec) DeepCopy() *RouteSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteSpec.

func (*RouteSpec) DeepCopyInto

func (in *RouteSpec) DeepCopyInto(out *RouteSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RouteSpec) SetDefaults

func (rs *RouteSpec) SetDefaults()

func (*RouteSpec) Validate

func (rs *RouteSpec) Validate() *FieldError

type RouteStatus

type RouteStatus struct {
	// Domain holds the top-level domain that will distribute traffic over the provided targets.
	// It generally has the form {route-name}.{route-namespace}.{cluster-level-suffix}
	// +optional
	Domain string `json:"domain,omitempty"`

	// DomainInternal holds the top-level domain that will distribute traffic over the provided
	// targets from inside the cluster. It generally has the form
	// {route-name}.{route-namespace}.svc.cluster.local
	// +optional
	DomainInternal string `json:"domainInternal,omitempty"`

	// Traffic holds the configured traffic distribution.
	// These entries will always contain RevisionName references.
	// When ConfigurationName appears in the spec, this will hold the
	// LatestReadyRevisionName that we last observed.
	// +optional
	Traffic []TrafficTarget `json:"traffic,omitempty"`

	// Conditions communicates information about ongoing/complete
	// reconciliation processes that bring the "spec" inline with the observed
	// state of the world.
	// +optional
	Conditions []RouteCondition `json:"conditions,omitempty"`

	// ObservedGeneration is the 'Generation' of the Configuration that
	// was last processed by the controller. The observed generation is updated
	// even if the controller failed to process the spec and create the Revision.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

RouteStatus communicates the observed state of the Route (from the controller).

func (*RouteStatus) DeepCopy

func (in *RouteStatus) DeepCopy() *RouteStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteStatus.

func (*RouteStatus) DeepCopyInto

func (in *RouteStatus) DeepCopyInto(out *RouteStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RouteStatus) GetCondition

func (rs *RouteStatus) GetCondition(t RouteConditionType) *RouteCondition

func (*RouteStatus) InitializeConditions

func (rs *RouteStatus) InitializeConditions()

func (*RouteStatus) IsReady

func (rs *RouteStatus) IsReady() bool

func (*RouteStatus) MarkConfigurationFailed

func (rs *RouteStatus) MarkConfigurationFailed(name string)

func (*RouteStatus) MarkConfigurationNotReady

func (rs *RouteStatus) MarkConfigurationNotReady(name string)

func (*RouteStatus) MarkMissingTrafficTarget

func (rs *RouteStatus) MarkMissingTrafficTarget(kind, name string)

func (*RouteStatus) MarkRevisionFailed

func (rs *RouteStatus) MarkRevisionFailed(name string)

func (*RouteStatus) MarkRevisionNotReady

func (rs *RouteStatus) MarkRevisionNotReady(name string)

func (*RouteStatus) MarkTrafficAssigned

func (rs *RouteStatus) MarkTrafficAssigned()

func (*RouteStatus) MarkUnknownTrafficError

func (rs *RouteStatus) MarkUnknownTrafficError(msg string)

func (*RouteStatus) RemoveCondition

func (rs *RouteStatus) RemoveCondition(t RouteConditionType)

type RunLatestType

type RunLatestType struct {
	// The configuration for this service.
	// +optional
	Configuration ConfigurationSpec `json:"configuration,omitempty"`
}

func (*RunLatestType) DeepCopy

func (in *RunLatestType) DeepCopy() *RunLatestType

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RunLatestType.

func (*RunLatestType) DeepCopyInto

func (in *RunLatestType) DeepCopyInto(out *RunLatestType)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RunLatestType) Validate

func (rlt *RunLatestType) Validate() *FieldError

type Service

type Service struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`
	// +optional
	Spec ServiceSpec `json:"spec,omitempty"`
	// +optional
	Status ServiceStatus `json:"status,omitempty"`
}

Service acts as a top-level container that manages a set of Routes and Configurations which implement a network service. Service exists to provide a singular abstraction which can be access controlled, reasoned about, and which encapsulates software lifecycle decisions such as rollout policy and team resource ownership. Service acts only as an orchestrator of the underlying Routes and Configurations (much as a kubernetes Deployment orchestrates ReplicaSets), and its usage is optional but recommended.

The Service's controller will track the statuses of its owned Configuration and Route, reflecting their statuses and conditions as its own.

See also: https://github.com/knative/serving/blob/master/docs/spec/overview.md#service

func (*Service) DeepCopy

func (in *Service) DeepCopy() *Service

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Service.

func (*Service) DeepCopyInto

func (in *Service) DeepCopyInto(out *Service)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Service) DeepCopyObject

func (in *Service) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Service) GetGeneration

func (s *Service) GetGeneration() int64

func (*Service) GetSpecJSON

func (s *Service) GetSpecJSON() ([]byte, error)

func (*Service) SetDefaults

func (s *Service) SetDefaults()

func (*Service) SetGeneration

func (s *Service) SetGeneration(generation int64)

func (*Service) Validate

func (s *Service) Validate() *FieldError

type ServiceCondition

type ServiceCondition struct {
	Type ServiceConditionType `json:"type"`

	Status corev1.ConditionStatus `json:"status" description:"status of the condition, one of True, False, Unknown"`

	// +optional
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" description:"last time the condition transit from one status to another"`

	// +optional
	Reason string `json:"reason,omitempty" description:"one-word CamelCase reason for the condition's last transition"`
	// +optional
	Message string `json:"message,omitempty" description:"human-readable message indicating details about last transition"`
}

func (*ServiceCondition) DeepCopy

func (in *ServiceCondition) DeepCopy() *ServiceCondition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCondition.

func (*ServiceCondition) DeepCopyInto

func (in *ServiceCondition) DeepCopyInto(out *ServiceCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceConditionType

type ServiceConditionType string

ServiceConditionType represents an Service condition value

const (
	// ServiceConditionReady is set when the service is configured
	// and has available backends ready to receive traffic.
	ServiceConditionReady ServiceConditionType = "Ready"
	// ServiceConditionRoutesReady is set when the service's underlying
	// routes have reported readiness.
	ServiceConditionRoutesReady ServiceConditionType = "RoutesReady"
	// ServiceConditionConfigurationsReady is set when the service's underlying
	// configurations have reported readiness.
	ServiceConditionConfigurationsReady ServiceConditionType = "ConfigurationsReady"
)

type ServiceList

type ServiceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []Service `json:"items"`
}

ServiceList is a list of Service resources

func (*ServiceList) DeepCopy

func (in *ServiceList) DeepCopy() *ServiceList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceList.

func (*ServiceList) DeepCopyInto

func (in *ServiceList) DeepCopyInto(out *ServiceList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ServiceList) DeepCopyObject

func (in *ServiceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ServiceSpec

type ServiceSpec struct {
	// TODO: Generation does not work correctly with CRD. They are scrubbed
	// by the APIserver (https://github.com/kubernetes/kubernetes/issues/58778)
	// So, we add Generation here. Once that gets fixed, remove this and use
	// ObjectMeta.Generation instead.
	// +optional
	Generation int64 `json:"generation,omitempty"`

	// RunLatest defines a simple Service. It will automatically
	// configure a route that keeps the latest ready revision
	// from the supplied configuration running.
	// +optional
	RunLatest *RunLatestType `json:"runLatest,omitempty"`

	// Pins this service to a specific revision name. The revision must
	// be owned by the configuration provided.
	// +optional
	Pinned *PinnedType `json:"pinned,omitempty"`
}

ServiceSpec represents the configuration for the Service object. Exactly one of its members (other than Generation) must be specified. Services can either track the latest ready revision of a configuration or be pinned to a specific revision.

func (*ServiceSpec) DeepCopy

func (in *ServiceSpec) DeepCopy() *ServiceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceSpec.

func (*ServiceSpec) DeepCopyInto

func (in *ServiceSpec) DeepCopyInto(out *ServiceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ServiceSpec) SetDefaults

func (ss *ServiceSpec) SetDefaults()

func (*ServiceSpec) Validate

func (ss *ServiceSpec) Validate() *FieldError

type ServiceStatus

type ServiceStatus struct {
	// +optional
	Conditions []ServiceCondition `json:"conditions,omitempty"`

	// From RouteStatus.
	// Domain holds the top-level domain that will distribute traffic over the provided targets.
	// It generally has the form {route-name}.{route-namespace}.{cluster-level-suffix}
	// +optional
	Domain string `json:"domain,omitempty"`

	// From RouteStatus.
	// DomainInternal holds the top-level domain that will distribute traffic over the provided
	// targets from inside the cluster. It generally has the form
	// {route-name}.{route-namespace}.svc.cluster.local
	// +optional
	DomainInternal string `json:"domainInternal,omitempty"`

	// From RouteStatus.
	// Traffic holds the configured traffic distribution.
	// These entries will always contain RevisionName references.
	// When ConfigurationName appears in the spec, this will hold the
	// LatestReadyRevisionName that we last observed.
	// +optional
	Traffic []TrafficTarget `json:"traffic,omitempty"`

	// From ConfigurationStatus.
	// LatestReadyRevisionName holds the name of the latest Revision stamped out
	// from this Service's Configuration that has had its "Ready" condition become "True".
	// +optional
	LatestReadyRevisionName string `json:"latestReadyRevisionName,omitempty"`

	// From ConfigurationStatus.
	// LatestCreatedRevisionName is the last revision that was created from this Service's
	// Configuration. It might not be ready yet, for that use LatestReadyRevisionName.
	// +optional
	LatestCreatedRevisionName string `json:"latestCreatedRevisionName,omitempty"`

	// ObservedGeneration is the 'Generation' of the Service that
	// was last processed by the controller.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

func (*ServiceStatus) DeepCopy

func (in *ServiceStatus) DeepCopy() *ServiceStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceStatus.

func (*ServiceStatus) DeepCopyInto

func (in *ServiceStatus) DeepCopyInto(out *ServiceStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ServiceStatus) GetCondition

func (*ServiceStatus) InitializeConditions

func (ss *ServiceStatus) InitializeConditions()

func (*ServiceStatus) IsReady

func (ss *ServiceStatus) IsReady() bool

func (*ServiceStatus) PropagateConfigurationStatus

func (ss *ServiceStatus) PropagateConfigurationStatus(cs ConfigurationStatus)

func (*ServiceStatus) PropagateRouteStatus

func (ss *ServiceStatus) PropagateRouteStatus(rs RouteStatus)

func (*ServiceStatus) RemoveCondition

func (ss *ServiceStatus) RemoveCondition(t ServiceConditionType)

type TrafficTarget

type TrafficTarget struct {
	// Name is optionally used to expose a dedicated hostname for referencing this
	// target exclusively. It has the form: {name}.${route.status.domain}
	// +optional
	Name string `json:"name,omitempty"`

	// RevisionName of a specific revision to which to send this portion of traffic.
	// This is mutually exclusive with ConfigurationName.
	// +optional
	RevisionName string `json:"revisionName,omitempty"`

	// ConfigurationName of a configuration to whose latest revision we will send
	// this portion of traffic. When the "status.latestReadyRevisionName" of the
	// referenced configuration changes, we will automatically migrate traffic
	// from the prior "latest ready" revision to the new one.
	// This field is never set in Route's status, only its spec.
	// This is mutually exclusive with RevisionName.
	// +optional
	ConfigurationName string `json:"configurationName,omitempty"`

	// Percent specifies percent of the traffic to this Revision or Configuration.
	// This defaults to zero if unspecified.
	Percent int `json:"percent"`
}

TrafficTarget holds a single entry of the routing table for a Route.

func (*TrafficTarget) DeepCopy

func (in *TrafficTarget) DeepCopy() *TrafficTarget

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrafficTarget.

func (*TrafficTarget) DeepCopyInto

func (in *TrafficTarget) DeepCopyInto(out *TrafficTarget)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TrafficTarget) Validate

func (tt *TrafficTarget) Validate() *FieldError

type Validatable

type Validatable interface {
	// Validate checks the validity of this types fields.
	Validate() *FieldError
}

Validatable indicates that a particular type may have its fields validated.

Jump to

Keyboard shortcuts

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