Bläddra i källkod

add nodeSelector & tolerations

pull/14/head
Andrey Inishev 1 år sedan
förälder
incheckning
731fd77d66
3 ändrade filer med 19 tillägg och 17 borttagningar
  1. +2
    -0
      pkg/apis/rabbitmq/v1/rabbitmq_types.go
  2. +15
    -17
      pkg/apis/rabbitmq/v1/zz_generated.deepcopy.go
  3. +2
    -0
      pkg/controller/rabbitmq/rabbitmq_controller.go

+ 2
- 0
pkg/apis/rabbitmq/v1/rabbitmq_types.go Visa fil

@@ -120,6 +120,8 @@ type RabbitmqSpec struct {
RabbitmqPrometheusImage string `json:"prometheus_image,omitempty"`

RabbitmqAffinity *corev1.Affinity `json:"affinity,omitempty"`
NodeSelector map[string]string `json:"nodeSelector"`
Tolerations []corev1.Toleration `json:"tolerations"`

RabbitmqUseServiceMonitor bool `json:"use_service_monitor,omitempty"`
}


+ 15
- 17
pkg/apis/rabbitmq/v1/zz_generated.deepcopy.go Visa fil

@@ -1,22 +1,6 @@
// +build !ignore_autogenerated

/*
Copyright The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Code generated by deepcopy-gen. DO NOT EDIT.
// Code generated by operator-sdk. DO NOT EDIT.

package v1

@@ -223,6 +207,20 @@ func (in *RabbitmqSpec) DeepCopyInto(out *RabbitmqSpec) {
*out = new(corev1.Affinity)
(*in).DeepCopyInto(*out)
}
if in.NodeSelector != nil {
in, out := &in.NodeSelector, &out.NodeSelector
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.Tolerations != nil {
in, out := &in.Tolerations, &out.Tolerations
*out = make([]corev1.Toleration, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}



+ 2
- 0
pkg/controller/rabbitmq/rabbitmq_controller.go Visa fil

@@ -474,6 +474,8 @@ func newStatefulSet(cr *rabbitmqv1.Rabbitmq, secretNames secretResouces) *v1.Sta
},
},
Containers: podContainers,
Tolerations: cr.Spec.Tolerations,
NodeSelector: cr.Spec.NodeSelector,
Volumes: []corev1.Volume{
{
Name: "rabbit-config",


Laddar…
Avbryt
Spara