Skip to content

Commit

Permalink
Merge pull request #94 from srl-labs/feat/launcher-scheduling-options
Browse files Browse the repository at this point in the history
feat: scheduling options for topology
  • Loading branch information
carlmontanari authored Jan 13, 2024
2 parents c9e0955 + 90f2e5b commit ef4e376
Show file tree
Hide file tree
Showing 22 changed files with 1,436 additions and 654 deletions.
16 changes: 16 additions & 0 deletions apis/v1alpha1/topologyspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ type Deployment struct {
// mapping applied.
// +optional
Resources map[string]k8scorev1.ResourceRequirements `json:"resources"`
// Scheduling holds information about how the launcher pod(s) should be configured with respect
// to "scheduling" things (affinity/node selector/tolerations).
// +optional
Scheduling Scheduling `json:"scheduling"`
// PrivilegedLauncher, when true, sets the launcher containers to privileged. By default, we do
// our best to *not* need this/set this, and instead set only the capabilities we need, however
// its possible that some containers launched by the launcher may need/want more capabilities,
Expand Down Expand Up @@ -164,6 +168,18 @@ type Deployment struct {
LauncherLogLevel string `json:"launcherLogLevel,omitempty"`
}

// Scheduling holds information about how the launcher pod(s) should be configured with respect
// to "scheduling" things (affinity/node selector/tolerations).
type Scheduling struct {
// NodeSelector sets the node selector that will be configured on all launcher pods for this
// Topology.
// +optional
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// Tolerations is a list of Tolerations that will be set on the launcher pod spec.
// +optional
Tolerations []k8scorev1.Toleration `json:"tolerations"`
}

// ImagePull holds configurations relevant to how clabernetes launcher pods handle pulling
// images.
type ImagePull struct {
Expand Down
31 changes: 31 additions & 0 deletions apis/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

239 changes: 129 additions & 110 deletions assets/crd/clabernetes.containerlab.dev_configs.yaml

Large diffs are not rendered by default.

54 changes: 31 additions & 23 deletions assets/crd/clabernetes.containerlab.dev_imagerequests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.13.0
controller-gen.kubebuilder.io/version: v0.14.0
name: imagerequests.clabernetes.containerlab.dev
spec:
group: clabernetes.containerlab.dev
Expand All @@ -17,32 +17,40 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: ImageRequest is an object that represents a request (from a launcher
pod) to pull an image on a given kubernetes node such that the image can
be "pulled through" into the launcher docker daemon.
description: |-
ImageRequest is an object that represents a request (from a launcher pod) to pull an image on a
given kubernetes node such that the image can be "pulled through" into the launcher docker
daemon.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: ImageRequestSpec is the spec for a Config resource.
properties:
kubernetesNode:
description: KubernetesNode is the node where the launcher pod is
running and where the image should be pulled too.
description: |-
KubernetesNode is the node where the launcher pod is running and where the image should be
pulled too.
type: string
requestedImage:
description: RequestedImage is the image that the launcher pod wants
the controller to get pulled onto the specified node.
description: |-
RequestedImage is the image that the launcher pod wants the controller to get pulled onto
the specified node.
type: string
requestedImagePullSecrets:
description: RequestedImagePullSecrets is a list of configured pull
Expand All @@ -56,9 +64,9 @@ spec:
image.
type: string
topologyNodeName:
description: TopologyNodeName is the name of the node in the topology
(i.e. the router name in a containerlab topology) that the image
is being requested for.
description: |-
TopologyNodeName is the name of the node in the topology (i.e. the router name in a
containerlab topology) that the image is being requested for.
type: string
required:
- kubernetesNode
Expand All @@ -70,15 +78,15 @@ spec:
description: ImageRequestStatus is the status for a ImageRequest resource.
properties:
accepted:
description: Accepted indicates that the ImageRequest controller has
seen this image request and is going to process it. This can be
useful to let the requesting pod know that "yep, this is in the
description: |-
Accepted indicates that the ImageRequest controller has seen this image request and is going
to process it. This can be useful to let the requesting pod know that "yep, this is in the
works, and i can go watch the cri images on this node now".
type: boolean
complete:
description: Complete indicates that the ImageRequest controller has
seen that the puller pod has done its job and that the image has
been pulled onto the requested node.
description: |-
Complete indicates that the ImageRequest controller has seen that the puller pod has done its
job and that the image has been pulled onto the requested node.
type: boolean
required:
- accepted
Expand Down
Loading

0 comments on commit ef4e376

Please sign in to comment.