placement

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

Placement Plugin

The rigdev.placement plugin adds placement configuration to the Deployment resource of your capsule. It can modify the nodeSelector and tolerations fields of the deployment. It has a requireTag bool config value. If set to true, the plugin will only run on capsules rigdev.placement/tag annotation matches the tag of the placement plugin. This also means the tag must be set on the plugin if requireTag is true.

Example

Config (in context of the rig-operator Helm values):

config:
  pipeline:
    steps:
      - plugins:
        - name: rigdev.placement
          config: |
            nodeSelector:
              key1: value1
            tolerations:
              - key: some-key
                value: some-value

The Deployment resource of the Capsule

kind: Deployment
...
spec:
  template:
    spec:
      nodeSelector:
        key2: value2
      tolerations:
        - key: some-other-key
          value: some-other-value
   ...

The resulting config of the Deployment is

kind: Deployment
...
spec:
  template:
    spec:
      nodeSelector:
        key1: value1
        key2: value2
      tolerations:
        - key: some-other-key
          value: some-other-value
        - key: some-key
          value: some-value
   ...

Config

Configuration for the placement plugin

Field Description
nodeSelector object (keys:string, values:string) Nodeselectors which will be inserted into the deployment's podSpec
tolerations Toleration array Tolerations which will be appended to the deployment's podSpec
requireTag boolean True if a capsule needs a Tag annotation to be run

Documentation

Overview

+groupName=plugins.rig.dev -- Only used for config doc generation

Index

Constants

View Source
const Name = "rigdev.placement"
View Source
const (
	TagAnnotation = "rigdev.placement/tag"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Nodeselectors which will be inserted into the deployment's podSpec
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	// Tolerations which will be appended to the deployment's podSpec
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
	// True if a capsule needs a Tag annotation to be run
	RequireTag bool `json:"requireTag,omitempty"`
}

Configuration for the placement plugin +kubebuilder:object:root=true

type Plugin

type Plugin struct {
	plugin.NoWatchObjectStatus
	// contains filtered or unexported fields
}

func (*Plugin) Initialize

func (p *Plugin) Initialize(req plugin.InitializeRequest) error

func (*Plugin) Run

func (p *Plugin) Run(_ context.Context, req pipeline.CapsuleRequest, _ hclog.Logger) error

Jump to

Keyboard shortcuts

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