Skip to content

Commit

Permalink
feat: add nodeselector to pod overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylvln committed May 23, 2023
1 parent 5be979c commit 123f169
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,11 @@ spec:
- IfNotPresent
type: string
type: object
nodeSelector:
additionalProperties:
type: string
description: Node selector to be applied on created Pod.
type: object
resources:
description: The desired compute resource requirements
of the created Pod.
Expand Down
5 changes: 5 additions & 0 deletions kube/resources/crd/bases/shulkermc.io_minecraftservers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,11 @@ spec:
- IfNotPresent
type: string
type: object
nodeSelector:
additionalProperties:
type: string
description: Node selector to be applied on created Pod.
type: object
resources:
description: The desired compute resource requirements of the
created Pod.
Expand Down
5 changes: 5 additions & 0 deletions kube/resources/crd/bases/shulkermc.io_proxyfleets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,11 @@ spec:
- IfNotPresent
type: string
type: object
nodeSelector:
additionalProperties:
type: string
description: Node selector to be applied on created Pod.
type: object
resources:
description: The desired compute resource requirements of the
created Pod.
Expand Down
3 changes: 3 additions & 0 deletions packages/shulker-crds/v1alpha1/mincraftserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ type MinecraftServerPodOverridesSpec struct {
//+optional
Affinity *corev1.Affinity `json:"affinity,omitempty"`

// Node selector to be applied on created Pod.
NodeSelector map[string]string `json:"nodeSelector,omitempty"`

// Tolerations to be applied on created Pod.
Tolarations []corev1.Toleration `json:"tolerations,omitempty"`

Expand Down
3 changes: 3 additions & 0 deletions packages/shulker-crds/v1alpha1/proxyfleet_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ type ProxyFleetPodOverridesSpec struct {
// Affinity scheduling rules to be applied on created Pod.
Affinity *corev1.Affinity `json:"affinity,omitempty"`

// Node selector to be applied on created Pod.
NodeSelector map[string]string `json:"nodeSelector,omitempty"`

// Tolerations to be applied on created Pod.
Tolarations []corev1.Toleration `json:"tolerations,omitempty"`

Expand Down
14 changes: 14 additions & 0 deletions packages/shulker-crds/v1alpha1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ func (b *MinecraftServerResourceGameServerBuilder) GetGameServerSpec() (*agonesv
podSpec.Affinity = b.Instance.Spec.PodOverrides.Affinity
}

podSpec.NodeSelector = b.Instance.Spec.PodOverrides.NodeSelector
podSpec.Tolerations = b.Instance.Spec.PodOverrides.Tolarations
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ func (b *ProxyFleetResourceFleetBuilder) getGameServerSpec() (*agonesv1.GameServ
podSpec.Affinity = b.Instance.Spec.PodOverrides.Affinity
}

podSpec.NodeSelector = b.Instance.Spec.PodOverrides.NodeSelector
podSpec.Tolerations = b.Instance.Spec.PodOverrides.Tolarations
}

Expand Down

0 comments on commit 123f169

Please sign in to comment.