Documentation
¶
Overview ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- type Controller
- func (c *Controller) Apply(ctx context.Context, provisioner *v1alpha5.Provisioner) error
- func (c *Controller) Delete(ctx context.Context, name string)
- func (c *Controller) List(ctx context.Context) []*Provisioner
- func (c *Controller) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error)
- func (c *Controller) Register(_ context.Context, m manager.Manager) error
- type Launcher
- type Provisioner
Constants ¶
This section is empty.
Variables ¶
var ( MaxBatchDuration = time.Second * 10 MinBatchDuration = time.Second * 1 // MaxPodsPerBatch limits the number of pods we process at one time to avoid using too much memory MaxPodsPerBatch = 2_000 )
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller for the resource
func NewController ¶
func NewController(ctx context.Context, kubeClient client.Client, coreV1Client corev1.CoreV1Interface, cloudProvider cloudprovider.CloudProvider) *Controller
NewController is a constructor
func (*Controller) Apply ¶
func (c *Controller) Apply(ctx context.Context, provisioner *v1alpha5.Provisioner) error
Apply creates or updates the provisioner to the latest configuration
func (*Controller) Delete ¶
func (c *Controller) Delete(ctx context.Context, name string)
Delete stops and removes a provisioner. Enqueued pods will be provisioned.
func (*Controller) List ¶
func (c *Controller) List(ctx context.Context) []*Provisioner
List active provisioners in order of priority
type Launcher ¶
type Launcher struct {
Packer *binpacking.Packer
KubeClient client.Client
CoreV1Client corev1.CoreV1Interface
CloudProvider cloudprovider.CloudProvider
}
func (*Launcher) Launch ¶
func (l *Launcher) Launch(ctx context.Context, provisioner *v1alpha5.Provisioner, schedules []*scheduling.Schedule, instanceTypes []cloudprovider.InstanceType) error
type Provisioner ¶
type Provisioner struct {
// State
*v1alpha5.Provisioner
Stop context.CancelFunc
// contains filtered or unexported fields
}
Provisioner waits for enqueued pods, batches them, creates capacity and binds the pods to the capacity.
func (*Provisioner) Add ¶
Add a pod to the provisioner and block until it's processed. The caller is responsible for verifying that the pod was scheduled correctly. In the future, this may be expanded to include concepts such as retriable errors.
func (*Provisioner) Batch ¶
func (p *Provisioner) Batch(ctx context.Context) (pods []*v1.Pod)
Batch returns a slice of enqueued pods after idle or timeout
func (*Provisioner) FilterProvisionable ¶
FilterProvisionable removes pods that have been assigned a node. This check is needed to prevent duplicate binds when a pod is scheduled to a node between the time it was ingested into the scheduler and the time it is included in a provisioner batch.
func (*Provisioner) Start ¶
func (p *Provisioner) Start(ctx context.Context)