Skip to content

Commit

Permalink
feat: add tolerations to pod overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylvln committed May 23, 2023
1 parent 99d7ca0 commit 4290b19
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
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"`

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

// Name of the ServiceAccount to use.
//+optional
ServiceAccountName string `json:"serviceAccountName,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"`

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

// Name of the ServiceAccount to use.
ServiceAccountName string `json:"serviceAccountName,omitempty"`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ func (b *MinecraftServerResourceGameServerBuilder) GetGameServerSpec() (*agonesv
if b.Instance.Spec.PodOverrides.Affinity != nil {
podSpec.Affinity = b.Instance.Spec.PodOverrides.Affinity
}

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

gameServerSpec := agonesv1.GameServerSpec{
Expand Down
2 changes: 2 additions & 0 deletions packages/shulker-operator/src/resources/proxyfleet/fleet.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ func (b *ProxyFleetResourceFleetBuilder) getGameServerSpec() (*agonesv1.GameServ
if b.Instance.Spec.PodOverrides.Affinity != nil {
podSpec.Affinity = b.Instance.Spec.PodOverrides.Affinity
}

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

gameServerSpec := agonesv1.GameServerSpec{
Expand Down

0 comments on commit 4290b19

Please sign in to comment.