Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mattermost Taint/Toleration Support #237

Closed
runyontr opened this issue Aug 11, 2021 · 7 comments · Fixed by #250
Closed

Mattermost Taint/Toleration Support #237

runyontr opened this issue Aug 11, 2021 · 7 comments · Fixed by #250

Comments

@runyontr
Copy link

Summary

The Mattermost Operator does not expose tolerations as part of the scheduling spec:

https://github.com/mattermost/mattermost-operator/blob/master/apis/mattermost/v1beta1/mattermost_types.go#L96

Steps to reproduce

Create Kubernetes nodes with a Taint and try and schedule the mattermost pods on those nodes.

Expected behavior

Given a taint, we should be able to tell the mattermost pods to tolerate the taint via:

apiVersion: installation.mattermost.com/v1beta1
kind: Mattermost
metadata:
  name: mattermost
  namespace: mattermost
spec:
  ... #omited for brevity
  scheduling:
    tolerations:
    - key: "key1"
      operator: "Equal"
      value: "value1"
      effect: "NoSchedule"

Observed behavior (that appears unintentional)

Possible fixes

  1. Add toleration here: https://github.com/mattermost/mattermost-operator/blob/master/apis/mattermost/v1beta1/mattermost_types.go#L96
// Scheduling defines the configuration related to scheduling of the Mattermost pods
// as well as resource constraints.
type Scheduling struct {
	// Defines the resource requests and limits for the Mattermost app server pods.
	// +optional
	Resources v1.ResourceRequirements `json:"resources,omitempty"`
	// NodeSelector is a selector which must be true for the pod to fit on a node.
	// Selector which must match a node's labels for the pod to be scheduled on that node.
	// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
	// +optional
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	// If specified, affinity will define the pod's scheduling constraints
	// +optional
	Affinity *v1.Affinity `json:"affinity,omitempty"`
        // +optional
        Tolerations *v1.Tolerations `json:"tolerations,omitempty"`
}

Toleration Spec

  1. Pass tolerations into
    NodeSelector: mattermost.Spec.NodeSelector,
@Szymongib
Copy link
Contributor

Hey, thanks for submitting the issue.

I think adding this could make sense and I really like the first solution proposed with a slight adjustment to keep it in line with PodSpec so that would be.

type Scheduling struct {
        ...
        Tolerations []v1.Toleration `json:"tolerations,omitempty"`
}

Marking it as a help wanted for now if anyone is willing to help on that.

@vineelyalamarthy
Copy link

@Szymongib is it up for grabs. What are other interesting problems to solve.

@gabrieljackson
Copy link
Collaborator

@vineelyalamarthy, yes this ticket is up for grabs if you want to take a shot at implementing it.

@vineelyalamarthy
Copy link

yes sure. @gabrieljackson would like to check out some tasks on the app backend as well. Any pointers.

@gabrieljackson
Copy link
Collaborator

Are you referring to the Mattermost App itself? If so, those help wanted tickets can be found here: https://github.com/mattermost/mattermost-server/issues?q=is%3Aopen+is%3Aissue+label%3A%22Up+For+Grabs%22

@vineelyalamarthy
Copy link

@gabrieljackson can you assign this to me.

@gabrieljackson
Copy link
Collaborator

@vineelyalamarthy Done! Thanks for taking this on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants