Documentation ¶
Index ¶
- func MutateK8sService(svc *corev1.Service)
- func SKS(ns, name string, so ...SKSOption) *netv1alpha1.ServerlessService
- func WithBufferedTraffic(pa *autoscalingv1alpha1.PodAutoscaler)
- func WithEndpointsOwnersRemoved(eps *corev1.Endpoints)
- func WithHPAClass(pa *autoscalingv1alpha1.PodAutoscaler)
- func WithK8sSvcOwnersRemoved(svc *corev1.Service)
- func WithMetricOwnersRemoved(m *autoscalingv1alpha1.Metric)
- func WithPADeletionTimestamp(r *autoscalingv1alpha1.PodAutoscaler)
- func WithPAOwnersRemoved(pa *autoscalingv1alpha1.PodAutoscaler)
- func WithPASKSReady(pa *autoscalingv1alpha1.PodAutoscaler)
- func WithPodAutoscalerOwnersRemoved(r *autoscalingv1alpha1.PodAutoscaler)
- func WithPrivateService(sks *netv1alpha1.ServerlessService)
- func WithProxyMode(sks *netv1alpha1.ServerlessService)
- func WithPubService(sks *netv1alpha1.ServerlessService)
- func WithReachabilityReachable(pa *autoscalingv1alpha1.PodAutoscaler)
- func WithReachabilityUnknown(pa *autoscalingv1alpha1.PodAutoscaler)
- func WithReachabilityUnreachable(pa *autoscalingv1alpha1.PodAutoscaler)
- func WithSKSOwnersRemoved(sks *netv1alpha1.ServerlessService)
- func WithSKSReady(sks *netv1alpha1.ServerlessService)
- func WithScaleTargetInitialized(pa *autoscalingv1alpha1.PodAutoscaler)
- func WithSubsets(ep *corev1.Endpoints)
- func WithTraffic(pa *autoscalingv1alpha1.PodAutoscaler)
- type EndpointsOption
- type IngressOption
- type K8sServiceOption
- type PodAutoscalerOption
- func MarkResourceNotOwnedByPA(rType, name string) PodAutoscalerOption
- func WithLowerScaleBound(i int) PodAutoscalerOption
- func WithMetricAnnotation(metric string) PodAutoscalerOption
- func WithNoTraffic(reason, message string) PodAutoscalerOption
- func WithObservedGeneration(gen int64) PodAutoscalerOption
- func WithPAContainerConcurrency(cc int64) PodAutoscalerOption
- func WithPAMetricsService(svc string) PodAutoscalerOption
- func WithPASKSNotReady(m string) PodAutoscalerOption
- func WithPAStatusService(svc string) PodAutoscalerOption
- func WithPanicThresholdPercentageAnnotation(percentage string) PodAutoscalerOption
- func WithPanicWindowPercentageAnnotation(percentage string) PodAutoscalerOption
- func WithProtocolType(pt networking.ProtocolType) PodAutoscalerOption
- func WithReachability(r autoscalingv1alpha1.ReachabilityType) PodAutoscalerOption
- func WithTUAnnotation(tu string) PodAutoscalerOption
- func WithTargetAnnotation(target string) PodAutoscalerOption
- func WithUpperScaleBound(i int) PodAutoscalerOption
- func WithWindowAnnotation(window string) PodAutoscalerOption
- type PodOption
- type SKSOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MutateK8sService ¶
MutateK8sService changes the service in a way that must be reconciled.
func SKS ¶
func SKS(ns, name string, so ...SKSOption) *netv1alpha1.ServerlessService
SKS creates a generic ServerlessService object.
func WithBufferedTraffic ¶
func WithBufferedTraffic(pa *autoscalingv1alpha1.PodAutoscaler)
WithBufferedTraffic updates the PA to reflect that it has received and buffered traffic while it is being activated.
func WithEndpointsOwnersRemoved ¶
WithEndpointsOwnersRemoved clears the owner references of this Endpoints resource.
func WithHPAClass ¶
func WithHPAClass(pa *autoscalingv1alpha1.PodAutoscaler)
WithHPAClass updates the PA to add the hpa class annotation.
func WithK8sSvcOwnersRemoved ¶
WithK8sSvcOwnersRemoved clears the owner references of this Service.
func WithMetricOwnersRemoved ¶ added in v0.10.0
func WithMetricOwnersRemoved(m *autoscalingv1alpha1.Metric)
WithMetricOwnersRemoved clears the owner references of this PodAutoscaler.
func WithPADeletionTimestamp ¶
func WithPADeletionTimestamp(r *autoscalingv1alpha1.PodAutoscaler)
WithPADeletionTimestamp will set the DeletionTimestamp on the PodAutoscaler.
func WithPAOwnersRemoved ¶
func WithPAOwnersRemoved(pa *autoscalingv1alpha1.PodAutoscaler)
WithPAOwnersRemoved clears the owner references of this PA resource.
func WithPASKSReady ¶ added in v0.17.0
func WithPASKSReady(pa *autoscalingv1alpha1.PodAutoscaler)
WithPASKSReady marks PA status that SKS is ready.
func WithPodAutoscalerOwnersRemoved ¶
func WithPodAutoscalerOwnersRemoved(r *autoscalingv1alpha1.PodAutoscaler)
WithPodAutoscalerOwnersRemoved clears the owner references of this PodAutoscaler.
func WithPrivateService ¶
func WithPrivateService(sks *netv1alpha1.ServerlessService)
WithPrivateService annotates SKS status with the private service name.
func WithProxyMode ¶
func WithProxyMode(sks *netv1alpha1.ServerlessService)
WithProxyMode puts SKS into proxy mode.
func WithPubService ¶
func WithPubService(sks *netv1alpha1.ServerlessService)
WithPubService annotates SKS status with the given service name.
func WithReachabilityReachable ¶ added in v0.9.0
func WithReachabilityReachable(pa *autoscalingv1alpha1.PodAutoscaler)
WithReachabilityReachable sets the reachability of the PodAutoscaler to reachable.
func WithReachabilityUnknown ¶ added in v0.9.0
func WithReachabilityUnknown(pa *autoscalingv1alpha1.PodAutoscaler)
WithReachabilityUnknown sets the reachability of the PodAutoscaler to unknown.
func WithReachabilityUnreachable ¶ added in v0.9.0
func WithReachabilityUnreachable(pa *autoscalingv1alpha1.PodAutoscaler)
WithReachabilityUnreachable sets the reachability of the PodAutoscaler to unreachable.
func WithSKSOwnersRemoved ¶
func WithSKSOwnersRemoved(sks *netv1alpha1.ServerlessService)
WithSKSOwnersRemoved clears the owner references of this SKS resource.
func WithSKSReady ¶
func WithSKSReady(sks *netv1alpha1.ServerlessService)
WithSKSReady marks SKS as ready.
func WithScaleTargetInitialized ¶ added in v0.17.0
func WithScaleTargetInitialized(pa *autoscalingv1alpha1.PodAutoscaler)
WithScaleTargetInitialized updates the PA to reflect it having initialized its ScaleTarget.
func WithSubsets ¶
WithSubsets adds subsets to the body of an Endpoints object.
func WithTraffic ¶
func WithTraffic(pa *autoscalingv1alpha1.PodAutoscaler)
WithTraffic updates the PA to reflect it receiving traffic.
Types ¶
type EndpointsOption ¶
EndpointsOption enables further configuration of the Kubernetes Endpoints.
type IngressOption ¶ added in v0.8.0
type IngressOption func(*netv1alpha1.Ingress)
IngressOption enables further configuration of the Ingress.
func WithHosts ¶
func WithHosts(index int, hosts ...string) IngressOption
WithHosts sets the Hosts of the ingress rule specified index
func WithLoadbalancerFailed ¶ added in v0.13.3
func WithLoadbalancerFailed(reason, message string) IngressOption
WithLoadbalancerFailed marks the respective status as failed using the given reason and message.
type K8sServiceOption ¶
K8sServiceOption enables further configuration of the Kubernetes Service.
func OverrideServiceName ¶
func OverrideServiceName(name string) K8sServiceOption
OverrideServiceName changes the name of the Kubernetes Service.
func WithClusterIP ¶
func WithClusterIP(ip string) K8sServiceOption
WithClusterIP assigns a ClusterIP to the K8s Service.
func WithExternalName ¶
func WithExternalName(name string) K8sServiceOption
WithExternalName gives external name to the K8s Service.
type PodAutoscalerOption ¶
type PodAutoscalerOption func(*autoscalingv1alpha1.PodAutoscaler)
PodAutoscalerOption is an option that can be applied to a PA.
func MarkResourceNotOwnedByPA ¶
func MarkResourceNotOwnedByPA(rType, name string) PodAutoscalerOption
MarkResourceNotOwnedByPA marks PA as not owning a resource it is supposed to own.
func WithLowerScaleBound ¶
func WithLowerScaleBound(i int) PodAutoscalerOption
WithLowerScaleBound sets minScale to the given number.
func WithMetricAnnotation ¶
func WithMetricAnnotation(metric string) PodAutoscalerOption
WithMetricAnnotation adds a metric annotation to the PA.
func WithNoTraffic ¶
func WithNoTraffic(reason, message string) PodAutoscalerOption
WithNoTraffic updates the PA to reflect the fact that it is not receiving traffic.
func WithObservedGeneration ¶ added in v0.16.0
func WithObservedGeneration(gen int64) PodAutoscalerOption
WithObservedGeneration returns a PodAutoScalerOption which sets the Status.ObservedGeneration field to the given generation.
func WithPAContainerConcurrency ¶ added in v0.8.0
func WithPAContainerConcurrency(cc int64) PodAutoscalerOption
WithPAContainerConcurrency returns a PodAutoscalerOption which sets the PodAutoscaler containerConcurrency to the provided value.
func WithPAMetricsService ¶ added in v0.11.0
func WithPAMetricsService(svc string) PodAutoscalerOption
WithPAMetricsService annotates PA Status with the provided service name.
func WithPASKSNotReady ¶ added in v0.17.0
func WithPASKSNotReady(m string) PodAutoscalerOption
WithPASKSNotReady marks PA status that SKS is not ready.
func WithPAStatusService ¶
func WithPAStatusService(svc string) PodAutoscalerOption
WithPAStatusService annotates PA Status with the provided service name.
func WithPanicThresholdPercentageAnnotation ¶
func WithPanicThresholdPercentageAnnotation(percentage string) PodAutoscalerOption
WithPanicThresholdPercentageAnnotation returns a PodAutoscalerOption which sets the PodAutoscaler autoscaling.knative.dev/panicThresholdPercentage annotation to the provided value.
func WithPanicWindowPercentageAnnotation ¶
func WithPanicWindowPercentageAnnotation(percentage string) PodAutoscalerOption
WithPanicWindowPercentageAnnotation retturn a PodAutoscalerOption which set the PodAutoscaler autoscaling.knative.dev/panicWindowPercentage annotation to the provided value.
func WithProtocolType ¶
func WithProtocolType(pt networking.ProtocolType) PodAutoscalerOption
WithProtocolType sets the protocol type on the PodAutoscaler.
func WithReachability ¶ added in v0.9.0
func WithReachability(r autoscalingv1alpha1.ReachabilityType) PodAutoscalerOption
WithReachability sets the reachability of the PodAutoscaler to the given value.
func WithTUAnnotation ¶ added in v0.8.0
func WithTUAnnotation(tu string) PodAutoscalerOption
WithTUAnnotation returns a PodAutoscalerOption which sets the PodAutoscaler autoscaling.knative.dev/targetUtilizationPercentage annotation to the provided value.
func WithTargetAnnotation ¶
func WithTargetAnnotation(target string) PodAutoscalerOption
WithTargetAnnotation returns a PodAutoscalerOption which sets the PodAutoscaler autoscaling.knative.dev/target annotation to the provided value.
func WithUpperScaleBound ¶
func WithUpperScaleBound(i int) PodAutoscalerOption
WithUpperScaleBound sets maxScale to the given number.
func WithWindowAnnotation ¶
func WithWindowAnnotation(window string) PodAutoscalerOption
WithWindowAnnotation returns a PodAutoScalerOption which sets the PodAutoscaler autoscaling.knative.dev/window annotation to the provided value.
type PodOption ¶
PodOption enables further configuration of a Pod.
func WithFailingContainer ¶
WithFailingContainer sets the .Status.ContainerStatuses on the pod to include a container named accordingly to fail with the given state.
func WithUnschedulableContainer ¶
WithUnschedulableContainer sets the .Status.Conditions on the pod to include `PodScheduled` status to `False` with the given message and reason.
func WithWaitingContainer ¶
WithWaitingContainer sets the .Status.ContainerStatuses on the pod to include a container named accordingly to wait with the given state.
type SKSOption ¶
type SKSOption func(sks *netv1alpha1.ServerlessService)
SKSOption is a callback type for decorate SKS objects.
func WithDeployRef ¶
WithDeployRef annotates SKS with a deployment objectRef.
func WithNumActivators ¶ added in v0.14.0
WithNumActivators sets the number of requested activators on the SKS spec.