diff --git a/.arclint b/.arclint index 9ed132f517a..d3c1e2ced72 100644 --- a/.arclint +++ b/.arclint @@ -19,6 +19,7 @@ "(^private\/credentials\/.*\\.sh)", "(^private\/credentials\/.*\\.yaml)", "(^src/operator/client/versioned/)", + "(^src/operator/apis/px.dev/v1alpha1/zz_generated.deepcopy.go)", "(^src/stirling/bpf_tools/bcc_bpf/system-headers)", "(^src/stirling/mysql/testing/.*\\.json$)", "(^src/stirling/obj_tools/testdata/go/test_go_binary.go)", diff --git a/k8s/operator/crd/base/px.dev_viziers.yaml b/k8s/operator/crd/base/px.dev_viziers.yaml index ac46c0f5de4..b25d7b59240 100644 --- a/k8s/operator/crd/base/px.dev_viziers.yaml +++ b/k8s/operator/crd/base/px.dev_viziers.yaml @@ -232,6 +232,49 @@ spec: format: int64 type: integer type: object + tolerations: + description: 'Tolerations allows scheduling pods on nodes with + matching taints. More info: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/: + This field cannot be updated once the cluster is created.' + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using + the matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. + Empty means match all taint effects. When specified, allowed + values are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to + the value. Valid operators are Exists and Equal. Defaults + to Equal. Exists is equivalent to wildcard for value, + so that a pod can tolerate all taints of a particular + category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of + time the toleration (which must be of effect NoExecute, + otherwise this field is ignored) tolerates the taint. + By default, it is not set, which means tolerate the taint + forever (do not evict). Zero and negative values will + be treated as 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array type: object registry: description: 'Registry specifies the image registry to use rather diff --git a/src/api/proto/vizierconfigpb/vizier_types.pb.go b/src/api/proto/vizierconfigpb/vizier_types.pb.go index e74c25d3e66..2f3fea03081 100755 --- a/src/api/proto/vizierconfigpb/vizier_types.pb.go +++ b/src/api/proto/vizierconfigpb/vizier_types.pb.go @@ -8,6 +8,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" + types "github.com/gogo/protobuf/types" io "io" math "math" math_bits "math/bits" @@ -210,6 +211,7 @@ type PodPolicyReq struct { Annotations map[string]string `protobuf:"bytes,2,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Resources *ResourceReqs `protobuf:"bytes,3,opt,name=resources,proto3" json:"resources,omitempty"` NodeSelector map[string]string `protobuf:"bytes,4,rep,name=nodeSelector,proto3" json:"nodeSelector,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Tolerations []*Toleration `protobuf:"bytes,5,rep,name=tolerations,proto3" json:"tolerations,omitempty"` } func (m *PodPolicyReq) Reset() { *m = PodPolicyReq{} } @@ -272,6 +274,13 @@ func (m *PodPolicyReq) GetNodeSelector() map[string]string { return nil } +func (m *PodPolicyReq) GetTolerations() []*Toleration { + if m != nil { + return m.Tolerations + } + return nil +} + type ResourceReqs struct { Limits *ResourceList `protobuf:"bytes,1,opt,name=limits,proto3" json:"limits,omitempty"` Requests *ResourceList `protobuf:"bytes,2,opt,name=requests,proto3" json:"requests,omitempty"` @@ -323,6 +332,81 @@ func (m *ResourceReqs) GetRequests() *ResourceList { return nil } +type Toleration struct { + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Operator string `protobuf:"bytes,2,opt,name=operator,proto3" json:"operator,omitempty"` + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` + Effect string `protobuf:"bytes,4,opt,name=effect,proto3" json:"effect,omitempty"` + TolerationSeconds *types.Int64Value `protobuf:"bytes,5,opt,name=toleration_seconds,json=tolerationSeconds,proto3" json:"toleration_seconds,omitempty"` +} + +func (m *Toleration) Reset() { *m = Toleration{} } +func (*Toleration) ProtoMessage() {} +func (*Toleration) Descriptor() ([]byte, []int) { + return fileDescriptor_5892195818dca4ca, []int{3} +} +func (m *Toleration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Toleration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Toleration.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Toleration) XXX_Merge(src proto.Message) { + xxx_messageInfo_Toleration.Merge(m, src) +} +func (m *Toleration) XXX_Size() int { + return m.Size() +} +func (m *Toleration) XXX_DiscardUnknown() { + xxx_messageInfo_Toleration.DiscardUnknown(m) +} + +var xxx_messageInfo_Toleration proto.InternalMessageInfo + +func (m *Toleration) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *Toleration) GetOperator() string { + if m != nil { + return m.Operator + } + return "" +} + +func (m *Toleration) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +func (m *Toleration) GetEffect() string { + if m != nil { + return m.Effect + } + return "" +} + +func (m *Toleration) GetTolerationSeconds() *types.Int64Value { + if m != nil { + return m.TolerationSeconds + } + return nil +} + type ResourceList struct { ResourceList map[string]*ResourceQuantity `protobuf:"bytes,1,rep,name=resource_list,json=resourceList,proto3" json:"resource_list,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } @@ -330,7 +414,7 @@ type ResourceList struct { func (m *ResourceList) Reset() { *m = ResourceList{} } func (*ResourceList) ProtoMessage() {} func (*ResourceList) Descriptor() ([]byte, []int) { - return fileDescriptor_5892195818dca4ca, []int{3} + return fileDescriptor_5892195818dca4ca, []int{4} } func (m *ResourceList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -373,7 +457,7 @@ type ResourceQuantity struct { func (m *ResourceQuantity) Reset() { *m = ResourceQuantity{} } func (*ResourceQuantity) ProtoMessage() {} func (*ResourceQuantity) Descriptor() ([]byte, []int) { - return fileDescriptor_5892195818dca4ca, []int{4} + return fileDescriptor_5892195818dca4ca, []int{5} } func (m *ResourceQuantity) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -418,7 +502,7 @@ type DataCollectorParams struct { func (m *DataCollectorParams) Reset() { *m = DataCollectorParams{} } func (*DataCollectorParams) ProtoMessage() {} func (*DataCollectorParams) Descriptor() ([]byte, []int) { - return fileDescriptor_5892195818dca4ca, []int{5} + return fileDescriptor_5892195818dca4ca, []int{6} } func (m *DataCollectorParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -475,7 +559,7 @@ type LeadershipElectionParams struct { func (m *LeadershipElectionParams) Reset() { *m = LeadershipElectionParams{} } func (*LeadershipElectionParams) ProtoMessage() {} func (*LeadershipElectionParams) Descriptor() ([]byte, []int) { - return fileDescriptor_5892195818dca4ca, []int{6} + return fileDescriptor_5892195818dca4ca, []int{7} } func (m *LeadershipElectionParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -519,6 +603,7 @@ func init() { proto.RegisterMapType((map[string]string)(nil), "px.vizierconfigpb.PodPolicyReq.LabelsEntry") proto.RegisterMapType((map[string]string)(nil), "px.vizierconfigpb.PodPolicyReq.NodeSelectorEntry") proto.RegisterType((*ResourceReqs)(nil), "px.vizierconfigpb.ResourceReqs") + proto.RegisterType((*Toleration)(nil), "px.vizierconfigpb.Toleration") proto.RegisterType((*ResourceList)(nil), "px.vizierconfigpb.ResourceList") proto.RegisterMapType((map[string]*ResourceQuantity)(nil), "px.vizierconfigpb.ResourceList.ResourceListEntry") proto.RegisterType((*ResourceQuantity)(nil), "px.vizierconfigpb.ResourceQuantity") @@ -532,73 +617,80 @@ func init() { } var fileDescriptor_5892195818dca4ca = []byte{ - // 1053 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xf7, 0xc6, 0x69, 0x12, 0x3f, 0xbb, 0xa9, 0x3d, 0x69, 0xd1, 0x60, 0x95, 0x4d, 0x30, 0x12, - 0x58, 0x2d, 0x38, 0x34, 0x20, 0x95, 0x06, 0xd1, 0x2a, 0xff, 0x10, 0x82, 0x24, 0x98, 0x8d, 0xda, - 0x43, 0x2f, 0xab, 0xf1, 0xee, 0x8b, 0x33, 0xca, 0xae, 0x67, 0x33, 0x33, 0x6b, 0xd5, 0x39, 0x71, - 0xe0, 0x03, 0xf0, 0x31, 0xf8, 0x06, 0x7c, 0x05, 0x0e, 0x48, 0xe4, 0xd8, 0x13, 0x22, 0xce, 0x85, - 0x63, 0xaf, 0xdc, 0xd0, 0xce, 0xae, 0xe3, 0x4d, 0xe3, 0x36, 0xcd, 0xcd, 0xf3, 0x7e, 0xbf, 0xdf, - 0x7b, 0x6f, 0xde, 0x7b, 0xf3, 0xd6, 0xb0, 0xac, 0xa4, 0xb7, 0xcc, 0x22, 0xbe, 0x1c, 0x49, 0xa1, - 0xc5, 0x72, 0x9f, 0x1f, 0x73, 0x94, 0x9e, 0xe8, 0xed, 0xf3, 0x6e, 0xd4, 0xc9, 0x8e, 0xae, 0x1e, - 0x44, 0xa8, 0x5a, 0x86, 0x41, 0x6a, 0xd1, 0x8b, 0xd6, 0x45, 0x56, 0xfd, 0xb3, 0x2e, 0xd7, 0x07, - 0x71, 0xa7, 0xe5, 0x89, 0x70, 0xb9, 0x2b, 0xba, 0x22, 0xf5, 0xd5, 0x89, 0xf7, 0xcd, 0x29, 0x75, - 0x9c, 0xfc, 0x4a, 0x3d, 0x34, 0x7e, 0x9f, 0x05, 0x78, 0x66, 0x3c, 0xec, 0x45, 0xe8, 0x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f, 0xa2, 0xfd, 0x80, 0x75, 0x55, 0xf6, 0x4a, - 0x56, 0xdf, 0x6d, 0x03, 0xb7, 0x36, 0x8c, 0xbc, 0x8d, 0xe1, 0xb7, 0x89, 0xd8, 0xd4, 0x77, 0x9d, - 0x0c, 0xff, 0x5e, 0x9c, 0xcf, 0x80, 0xad, 0x1d, 0x03, 0x38, 0xf3, 0xde, 0x05, 0x62, 0x7d, 0x0d, - 0x16, 0x26, 0x48, 0xaf, 0xb9, 0xcd, 0x8a, 0xd5, 0xe9, 0xc6, 0x77, 0x40, 0xdf, 0xb4, 0xb8, 0x93, - 0x6f, 0xec, 0x78, 0xfd, 0xa3, 0xe4, 0xc2, 0x77, 0xc3, 0x74, 0xd0, 0x8b, 0x4e, 0x75, 0x84, 0xb4, - 0x0d, 0xb0, 0xa3, 0xd6, 0x37, 0x4f, 0x4e, 0xed, 0xc2, 0xcb, 0x53, 0xbb, 0xf0, 0xea, 0xd4, 0xb6, - 0x7e, 0x1e, 0xda, 0xd6, 0x6f, 0x43, 0xdb, 0xfa, 0x63, 0x68, 0x5b, 0x27, 0x43, 0xdb, 0xfa, 0x67, - 0x68, 0x5b, 0xff, 0x0e, 0xed, 0xc2, 0xab, 0xa1, 0x6d, 0xfd, 0x7a, 0x66, 0x17, 0x4e, 0xce, 0xec, - 0xc2, 0xcb, 0x33, 0xbb, 0xf0, 0x7c, 0xfe, 0x62, 0x91, 0x3a, 0x33, 0xe6, 0xef, 0xd1, 0x17, 0xff, - 0x07, 0x00, 0x00, 0xff, 0xff, 0x90, 0x15, 0x3e, 0xaf, 0x93, 0x09, 0x00, 0x00, + // 1167 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x4f, 0x73, 0xd3, 0x46, + 0x14, 0x8f, 0xe2, 0x90, 0xc4, 0xcf, 0x26, 0xd8, 0x1b, 0x60, 0xb6, 0x2e, 0x88, 0xd4, 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b4, 0x92, 0xb4, 0x60, 0x59, 0xe0, 0xc0, 0x97, 0x4a, 0x8c, 0x28, 0xd1, 0xc0, 0xe9, 0x99, + 0x9c, 0x83, 0x6a, 0xda, 0x09, 0xb1, 0x1f, 0x70, 0x45, 0x57, 0x75, 0x65, 0x17, 0x82, 0xd6, 0x75, + 0xa8, 0x97, 0x1f, 0x87, 0x34, 0xa0, 0x92, 0xf6, 0x55, 0xd6, 0x74, 0xe9, 0x27, 0x39, 0x0d, 0x27, + 0x86, 0x2c, 0x48, 0x30, 0xef, 0xb5, 0xec, 0x70, 0x7d, 0xfe, 0x73, 0xe3, 0xf6, 0xc2, 0x72, 0xad, + 0x51, 0x6f, 0xff, 0xb1, 0x00, 0xf5, 0x72, 0x9d, 0x90, 0x2d, 0x58, 0x0c, 0x58, 0x0f, 0x03, 0x49, + 0x0d, 0x5d, 0x1b, 0x97, 0x8e, 0x28, 0x2c, 0x6b, 0x57, 0xa3, 0xb3, 0xe2, 0xc8, 0xa9, 0xc4, 0x86, + 0x1a, 0x8b, 0x22, 0xae, 0x58, 0x9a, 0x1e, 0x49, 0xe7, 0xb5, 0xa5, 0x4f, 0x8e, 0xb2, 0xb4, 0x59, + 0x50, 0x32, 0x73, 0x65, 0x23, 0xe4, 0x4b, 0xa8, 0x0a, 0x94, 0x3c, 0x11, 0x2e, 0x4a, 0x3d, 0x11, + 0x66, 0x17, 0xbd, 0x9d, 0x63, 0x6c, 0x7c, 0x2c, 0xed, 0x82, 0x41, 0xee, 0x41, 0x3d, 0xe2, 0x1e, + 0xee, 0x61, 0x56, 0x1e, 0x74, 0x41, 0xdf, 0xe9, 0xf2, 0x51, 0x77, 0xba, 0x5b, 0xe2, 0x64, 0x97, + 0x3a, 0x60, 0x86, 0xdc, 0x84, 0x9a, 0xe2, 0x41, 0x3a, 0x62, 0x74, 0xa4, 0x27, 0xb4, 0xd5, 0xf3, + 0x33, 0xac, 0xfe, 0x30, 0x45, 0xd9, 0x65, 0x46, 0xeb, 0x1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0xfe, 0x1d, 0x9b, 0xc6, 0x7f, 0x63, 0x73, 0xee, 0xe5, 0xd8, 0x34, 0x7e, 0xd9, 0x37, 0xe7, 0x9e, + 0xed, 0x9b, 0x73, 0xcf, 0xf7, 0xcd, 0xb9, 0x07, 0x2b, 0x07, 0x93, 0xd4, 0x5b, 0xd4, 0x2d, 0xf0, + 0xe9, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x5b, 0x21, 0x56, 0xab, 0x0a, 0x00, 0x00, } func (this *VizierSpec) Equal(that interface{}) bool { @@ -727,6 +819,14 @@ func (this *PodPolicyReq) Equal(that interface{}) bool { return false } } + if len(this.Tolerations) != len(that1.Tolerations) { + return false + } + for i := range this.Tolerations { + if !this.Tolerations[i].Equal(that1.Tolerations[i]) { + return false + } + } return true } func (this *ResourceReqs) Equal(that interface{}) bool { @@ -756,6 +856,42 @@ func (this *ResourceReqs) Equal(that interface{}) bool { } return true } +func (this *Toleration) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Toleration) + if !ok { + that2, ok := that.(Toleration) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Key != that1.Key { + return false + } + if this.Operator != that1.Operator { + return false + } + if this.Value != that1.Value { + return false + } + if this.Effect != that1.Effect { + return false + } + if !this.TolerationSeconds.Equal(that1.TolerationSeconds) { + return false + } + return true +} func (this *ResourceList) Equal(that interface{}) bool { if that == nil { return this == nil @@ -917,7 +1053,7 @@ func (this *PodPolicyReq) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 8) + s := make([]string, 0, 9) s = append(s, "&vizierconfigpb.PodPolicyReq{") keysForLabels := make([]string, 0, len(this.Labels)) for k, _ := range this.Labels { @@ -961,6 +1097,9 @@ func (this *PodPolicyReq) GoString() string { if this.NodeSelector != nil { s = append(s, "NodeSelector: "+mapStringForNodeSelector+",\n") } + if this.Tolerations != nil { + s = append(s, "Tolerations: "+fmt.Sprintf("%#v", this.Tolerations)+",\n") + } s = append(s, "}") return strings.Join(s, "") } @@ -979,6 +1118,22 @@ func (this *ResourceReqs) GoString() string { s = append(s, "}") return strings.Join(s, "") } +func (this *Toleration) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 9) + s = append(s, "&vizierconfigpb.Toleration{") + s = append(s, "Key: "+fmt.Sprintf("%#v", this.Key)+",\n") + s = append(s, "Operator: "+fmt.Sprintf("%#v", this.Operator)+",\n") + s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") + s = append(s, "Effect: "+fmt.Sprintf("%#v", this.Effect)+",\n") + if this.TolerationSeconds != nil { + s = append(s, "TolerationSeconds: "+fmt.Sprintf("%#v", this.TolerationSeconds)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} func (this *ResourceList) GoString() string { if this == nil { return "nil" @@ -1266,6 +1421,20 @@ func (m *PodPolicyReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Tolerations) > 0 { + for iNdEx := len(m.Tolerations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tolerations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVizierTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } if len(m.NodeSelector) > 0 { for k := range m.NodeSelector { v := m.NodeSelector[k] @@ -1385,6 +1554,69 @@ func (m *ResourceReqs) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Toleration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Toleration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Toleration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TolerationSeconds != nil { + { + size, err := m.TolerationSeconds.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVizierTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Effect) > 0 { + i -= len(m.Effect) + copy(dAtA[i:], m.Effect) + i = encodeVarintVizierTypes(dAtA, i, uint64(len(m.Effect))) + i-- + dAtA[i] = 0x22 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintVizierTypes(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x1a + } + if len(m.Operator) > 0 { + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintVizierTypes(dAtA, i, uint64(len(m.Operator))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintVizierTypes(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *ResourceList) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1671,6 +1903,12 @@ func (m *PodPolicyReq) Size() (n int) { n += mapEntrySize + 1 + sovVizierTypes(uint64(mapEntrySize)) } } + if len(m.Tolerations) > 0 { + for _, e := range m.Tolerations { + l = e.Size() + n += 1 + l + sovVizierTypes(uint64(l)) + } + } return n } @@ -1691,6 +1929,35 @@ func (m *ResourceReqs) Size() (n int) { return n } +func (m *Toleration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovVizierTypes(uint64(l)) + } + l = len(m.Operator) + if l > 0 { + n += 1 + l + sovVizierTypes(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovVizierTypes(uint64(l)) + } + l = len(m.Effect) + if l > 0 { + n += 1 + l + sovVizierTypes(uint64(l)) + } + if m.TolerationSeconds != nil { + l = m.TolerationSeconds.Size() + n += 1 + l + sovVizierTypes(uint64(l)) + } + return n +} + func (m *ResourceList) Size() (n int) { if m == nil { return 0 @@ -1808,6 +2075,11 @@ func (this *PodPolicyReq) String() string { if this == nil { return "nil" } + repeatedStringForTolerations := "[]*Toleration{" + for _, f := range this.Tolerations { + repeatedStringForTolerations += strings.Replace(f.String(), "Toleration", "Toleration", 1) + "," + } + repeatedStringForTolerations += "}" keysForLabels := make([]string, 0, len(this.Labels)) for k, _ := range this.Labels { keysForLabels = append(keysForLabels, k) @@ -1843,6 +2115,7 @@ func (this *PodPolicyReq) String() string { `Annotations:` + mapStringForAnnotations + `,`, `Resources:` + strings.Replace(this.Resources.String(), "ResourceReqs", "ResourceReqs", 1) + `,`, `NodeSelector:` + mapStringForNodeSelector + `,`, + `Tolerations:` + repeatedStringForTolerations + `,`, `}`, }, "") return s @@ -1858,6 +2131,20 @@ func (this *ResourceReqs) String() string { }, "") return s } +func (this *Toleration) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Toleration{`, + `Key:` + fmt.Sprintf("%v", this.Key) + `,`, + `Operator:` + fmt.Sprintf("%v", this.Operator) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `Effect:` + fmt.Sprintf("%v", this.Effect) + `,`, + `TolerationSeconds:` + strings.Replace(fmt.Sprintf("%v", this.TolerationSeconds), "Int64Value", "types.Int64Value", 1) + `,`, + `}`, + }, "") + return s +} func (this *ResourceList) String() string { if this == nil { return "nil" @@ -3071,6 +3358,40 @@ func (m *PodPolicyReq) Unmarshal(dAtA []byte) error { } m.NodeSelector[mapkey] = mapvalue iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tolerations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVizierTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVizierTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVizierTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tolerations = append(m.Tolerations, &Toleration{}) + if err := m.Tolerations[len(m.Tolerations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipVizierTypes(dAtA[iNdEx:]) @@ -3214,6 +3535,220 @@ func (m *ResourceReqs) Unmarshal(dAtA []byte) error { } return nil } +func (m *Toleration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVizierTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Toleration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Toleration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVizierTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVizierTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVizierTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVizierTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVizierTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVizierTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVizierTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVizierTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVizierTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Effect", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVizierTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVizierTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVizierTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Effect = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TolerationSeconds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVizierTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVizierTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVizierTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TolerationSeconds == nil { + m.TolerationSeconds = &types.Int64Value{} + } + if err := m.TolerationSeconds.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVizierTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthVizierTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ResourceList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/src/api/proto/vizierconfigpb/vizier_types.proto b/src/api/proto/vizierconfigpb/vizier_types.proto index a6268a744ff..99054cf221a 100644 --- a/src/api/proto/vizierconfigpb/vizier_types.proto +++ b/src/api/proto/vizierconfigpb/vizier_types.proto @@ -23,6 +23,7 @@ package px.vizierconfigpb; option go_package = "vizierconfigpb"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "google/protobuf/wrappers.proto"; // Note: Any changes to this file should be in sync with operatpro/api/v1alpha1/vizier_types.go. // VizierSpec defines the desired state of Vizier @@ -90,6 +91,9 @@ message PodPolicyReq { // NodeSelector is a selector which must be true for the pod to fit on a node. // This field cannot be updated once the cluster is created. map nodeSelector = 4; + // NodeSelector allows scheduling pods on nodes with matching taints. + // This field cannot be updated once the cluster is created. + repeated Toleration tolerations = 5; } // ResourceReqs is copied from the k8s api: @@ -100,6 +104,16 @@ message ResourceReqs { ResourceList requests = 2; } +// Toleration is copied from the k8s api: +// https://pkg.go.dev/k8s.io/api/core/v1#Toleration +message Toleration { + string key = 1; + string operator = 2; + string value = 3; + string effect = 4; + google.protobuf.Int64Value toleration_seconds = 5; +} + // ResourceList is copied from the k8s api: https://pkg.go.dev/k8s.io/api/core/v1#ResourceList message ResourceList { map resource_list = 1; diff --git a/src/operator/apis/px.dev/v1alpha1/vizier_types.go b/src/operator/apis/px.dev/v1alpha1/vizier_types.go index 073253825fd..8956b75374e 100644 --- a/src/operator/apis/px.dev/v1alpha1/vizier_types.go +++ b/src/operator/apis/px.dev/v1alpha1/vizier_types.go @@ -187,6 +187,10 @@ type PodPolicy struct { // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ // This field cannot be updated once the cluster is created. NodeSelector map[string]string `json:"nodeSelector,omitempty"` + // Tolerations allows scheduling pods on nodes with matching taints. + // More info: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/: + // This field cannot be updated once the cluster is created. + Tolerations []v1.Toleration `json:"tolerations,omitempty"` // The securityContext which should be set on non-privileged pods. All pods which require privileged permissions // will still require a privileged securityContext. SecurityContext *PodSecurityContext `json:"securityContext,omitempty"` diff --git a/src/operator/apis/px.dev/v1alpha1/zz_generated.deepcopy.go b/src/operator/apis/px.dev/v1alpha1/zz_generated.deepcopy.go index 2c788afb7b8..d64a8011688 100644 --- a/src/operator/apis/px.dev/v1alpha1/zz_generated.deepcopy.go +++ b/src/operator/apis/px.dev/v1alpha1/zz_generated.deepcopy.go @@ -6,6 +6,7 @@ package v1alpha1 import ( + "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" ) @@ -71,6 +72,13 @@ func (in *PodPolicy) DeepCopyInto(out *PodPolicy) { (*out)[key] = val } } + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]v1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } if in.SecurityContext != nil { in, out := &in.SecurityContext, &out.SecurityContext *out = new(PodSecurityContext) diff --git a/src/operator/controllers/BUILD.bazel b/src/operator/controllers/BUILD.bazel index 05d23024a97..9cf8d7ea59d 100644 --- a/src/operator/controllers/BUILD.bazel +++ b/src/operator/controllers/BUILD.bazel @@ -38,6 +38,7 @@ go_library( "//src/utils/shared/k8s", "@com_github_blang_semver//:semver", "@com_github_cenkalti_backoff_v4//:backoff", + "@com_github_gogo_protobuf//types", "@com_github_sirupsen_logrus//:logrus", "@io_k8s_api//apps/v1:apps", "@io_k8s_api//core/v1:core", diff --git a/src/operator/controllers/vizier_controller.go b/src/operator/controllers/vizier_controller.go index 22077418cfe..96ae01fe558 100644 --- a/src/operator/controllers/vizier_controller.go +++ b/src/operator/controllers/vizier_controller.go @@ -31,6 +31,7 @@ import ( "github.com/blang/semver" "github.com/cenkalti/backoff/v4" + "github.com/gogo/protobuf/types" log "github.com/sirupsen/logrus" "google.golang.org/grpc" appsv1 "k8s.io/api/apps/v1" @@ -784,7 +785,7 @@ func updateResourceConfiguration(resource *k8s.Resource, vz *v1alpha1.Vizier) er addKeyValueMapToResource("labels", vz.Spec.Pod.Labels, resource.Object.Object) addKeyValueMapToResource("annotations", vz.Spec.Pod.Annotations, resource.Object.Object) updateResourceRequirements(vz.Spec.Pod.Resources, resource.Object.Object) - updatePodSpec(vz.Spec.Pod.NodeSelector, vz.Spec.Pod.SecurityContext, resource.Object.Object) + updatePodSpec(vz.Spec.Pod.NodeSelector, vz.Spec.Pod.Tolerations, vz.Spec.Pod.SecurityContext, resource.Object.Object) return nil } @@ -830,6 +831,7 @@ func generateVizierYAMLsConfig(ctx context.Context, ns string, k8sVersion string Requests: convertResourceType(vz.Spec.Pod.Resources.Requests), }, NodeSelector: vz.Spec.Pod.NodeSelector, + Tolerations: convertTolerations(vz.Spec.Pod.Tolerations), }, Patches: vz.Spec.Patches, Registry: vz.Spec.Registry, @@ -956,7 +958,25 @@ func updateResourceRequirements(requirements v1.ResourceRequirements, res map[st castedContainer["resources"] = resources } } -func updatePodSpec(nodeSelector map[string]string, securityCtx *v1alpha1.PodSecurityContext, res map[string]interface{}) { + +func convertTolerations(tolerations []v1.Toleration) []*vizierconfigpb.Toleration { + var castedTolerations []*vizierconfigpb.Toleration + for _, toleration := range tolerations { + castedToleration := &vizierconfigpb.Toleration{ + Key: toleration.Key, + Operator: string(toleration.Operator), + Value: toleration.Value, + Effect: string(toleration.Effect), + } + if toleration.TolerationSeconds != nil { + castedToleration.TolerationSeconds = &types.Int64Value{Value: *toleration.TolerationSeconds} + } + castedTolerations = append(castedTolerations, castedToleration) + } + return castedTolerations +} + +func updatePodSpec(nodeSelector map[string]string, tolerations []v1.Toleration, securityCtx *v1alpha1.PodSecurityContext, res map[string]interface{}) { podSpec := make(map[string]interface{}) md, ok, err := unstructured.NestedFieldNoCopy(res, "spec", "template", "spec") if ok && err == nil { @@ -977,6 +997,7 @@ func updatePodSpec(nodeSelector map[string]string, securityCtx *v1alpha1.PodSecu castedNodeSelector[k] = v } podSpec["nodeSelector"] = castedNodeSelector + podSpec["tolerations"] = tolerations // Add securityContext only if enabled. if securityCtx == nil || !securityCtx.Enabled {