diff --git a/Makefile b/Makefile index a62a65a2..401f8f0c 100644 --- a/Makefile +++ b/Makefile @@ -155,7 +155,7 @@ gen-crd-protos: --packages=-k8s.io/api/core/v1,kmodules.xyz/monitoring-agent-api/api/v1 .PHONY: gen -gen: clientset openapi gen-crd-protos +gen: clientset gen-crd-protos openapi fmt: $(BUILD_DIRS) @docker run \ diff --git a/agents/agents.go b/agents/agents.go index c312de28..73e05be7 100644 --- a/agents/agents.go +++ b/agents/agents.go @@ -28,7 +28,7 @@ import ( func New(at api.AgentType, k8sClient kubernetes.Interface, extClient ecs.ApiextensionsV1beta1Interface, promClient prom.MonitoringV1Interface) api.Agent { switch at { - case api.AgentPrometheusOperator, api.AgentCoreOSPrometheus, api.DeprecatedAgentCoreOSPrometheus: + case api.AgentPrometheus, api.AgentCoreOSPrometheus, api.DeprecatedAgentCoreOSPrometheus: return coreosprometheusoperator.New(at, k8sClient, extClient, promClient) case api.AgentPrometheusBuiltin: return prometheusbuiltin.New(k8sClient) diff --git a/api/v1/generated.pb.go b/api/v1/generated.pb.go index 3bffe5c1..fd05f78a 100644 --- a/api/v1/generated.pb.go +++ b/api/v1/generated.pb.go @@ -71,10 +71,38 @@ func (m *AgentSpec) XXX_DiscardUnknown() { var xxx_messageInfo_AgentSpec proto.InternalMessageInfo +func (m *PrometheusExporterSpec) Reset() { *m = PrometheusExporterSpec{} } +func (*PrometheusExporterSpec) ProtoMessage() {} +func (*PrometheusExporterSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_fdb8a0907217b332, []int{1} +} +func (m *PrometheusExporterSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PrometheusExporterSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PrometheusExporterSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_PrometheusExporterSpec.Merge(m, src) +} +func (m *PrometheusExporterSpec) XXX_Size() int { + return m.Size() +} +func (m *PrometheusExporterSpec) XXX_DiscardUnknown() { + xxx_messageInfo_PrometheusExporterSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_PrometheusExporterSpec proto.InternalMessageInfo + func (m *PrometheusSpec) Reset() { *m = PrometheusSpec{} } func (*PrometheusSpec) ProtoMessage() {} func (*PrometheusSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_fdb8a0907217b332, []int{1} + return fileDescriptor_fdb8a0907217b332, []int{2} } func (m *PrometheusSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -101,6 +129,7 @@ var xxx_messageInfo_PrometheusSpec proto.InternalMessageInfo func init() { proto.RegisterType((*AgentSpec)(nil), "kmodules.xyz.monitoring_agent_api.api.v1.AgentSpec") + proto.RegisterType((*PrometheusExporterSpec)(nil), "kmodules.xyz.monitoring_agent_api.api.v1.PrometheusExporterSpec") proto.RegisterType((*PrometheusSpec)(nil), "kmodules.xyz.monitoring_agent_api.api.v1.PrometheusSpec") proto.RegisterMapType((map[string]string)(nil), "kmodules.xyz.monitoring_agent_api.api.v1.PrometheusSpec.LabelsEntry") } @@ -110,42 +139,46 @@ func init() { } var fileDescriptor_fdb8a0907217b332 = []byte{ - // 553 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x6f, 0xd3, 0x4e, - 0x18, 0xc6, 0xe3, 0xd8, 0xa9, 0xea, 0xcb, 0x5f, 0x6d, 0xff, 0x07, 0x83, 0x15, 0x21, 0x3b, 0x2a, - 0x8b, 0x07, 0x6a, 0xd3, 0x4c, 0x29, 0x5b, 0x0d, 0x19, 0x90, 0x10, 0xaa, 0xae, 0x08, 0x09, 0x96, - 0xca, 0x71, 0x5f, 0x1c, 0x2b, 0xf6, 0x9d, 0x39, 0x9f, 0xad, 0x86, 0x89, 0x8f, 0xc0, 0xe7, 0x61, - 0x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, 0x7b, 0x7b, 0x55, 0x69, 0xa1, 0x75, 0x8d, 0x6c, 0x78, - 0xe3, 0x27, 0x48, 0xf3, 0x79, 0x98, 0x19, 0xea, 0x50, 0xb5, 0x75, 0x6f, 0xb7, 0x2a, 0x2d, 0xed, - 0x94, 0x87, 0x19, 0x91, 0x55, 0x7c, 0x82, 0x54, 0xa0, 0x85, 0xa1, 0x0d, 0x55, 0xbb, 0x3f, 0x1a, - 0x38, 0x4d, 0x72, 0x49, 0xa9, 0x93, 0xd7, 0xa8, 0x09, 0x2d, 0xde, 0xfb, 0xdc, 0xeb, 0xb7, 0x99, - 0xd4, 0x09, 0x2d, 0x48, 0xdd, 0x83, 0x3f, 0x20, 0x9d, 0x43, 0xc6, 0x72, 0x1e, 0x40, 0x66, 0xf4, - 0x64, 0x02, 0x7b, 0x9b, 0x01, 0x69, 0x45, 0x04, 0x3e, 0xe7, 0x11, 0x87, 0x04, 0xa8, 0xc8, 0xbc, - 0xff, 0x5b, 0x3b, 0xfd, 0xf6, 0x34, 0x23, 0x6b, 0x37, 0x3c, 0x45, 0xfb, 0x19, 0x04, 0x39, 0x8f, - 0xc4, 0xe2, 0x25, 0xa3, 0x02, 0xae, 0x84, 0xb1, 0x23, 0x01, 0x4f, 0xb7, 0x01, 0xce, 0xef, 0x4b, - 0xbd, 0x47, 0x55, 0x69, 0xed, 0x3f, 0x28, 0x92, 0x87, 0x86, 0x87, 0xdf, 0xbb, 0x68, 0xef, 0xfe, - 0x33, 0xe2, 0x21, 0xd2, 0x52, 0xc6, 0x9b, 0x29, 0xf6, 0xbc, 0xff, 0xda, 0x2b, 0x6a, 0x67, 0x8c, - 0x0b, 0x22, 0x4f, 0xb0, 0x8b, 0x74, 0xea, 0x27, 0x90, 0xa5, 0x7e, 0x00, 0x72, 0x6a, 0xfa, 0x3a, - 0xc9, 0xdb, 0xdb, 0x03, 0xb2, 0xd6, 0xe0, 0x18, 0xed, 0xc4, 0xfe, 0x14, 0xe2, 0xe6, 0xfd, 0xfb, - 0xa3, 0x57, 0xff, 0x3a, 0x63, 0xe7, 0x8d, 0xb4, 0x99, 0x50, 0xc1, 0x17, 0xde, 0x5e, 0xcb, 0xdc, - 0x69, 0x8a, 0xa4, 0x65, 0xe0, 0x67, 0x68, 0x37, 0xa2, 0x02, 0x78, 0xe1, 0xc7, 0x86, 0x26, 0x6f, - 0x77, 0xd0, 0x2a, 0x77, 0x5f, 0xb7, 0x75, 0x72, 0xa7, 0x18, 0x9c, 0xa0, 0xfe, 0x86, 0x29, 0x3e, - 0x40, 0xea, 0x1c, 0x16, 0xcd, 0x2f, 0x4c, 0xea, 0x25, 0x7e, 0x8c, 0x7a, 0x85, 0x1f, 0xe7, 0x6d, - 0x52, 0xd2, 0x6c, 0x5e, 0x74, 0xc7, 0x8a, 0x67, 0x2f, 0x57, 0x66, 0xe7, 0x7a, 0x65, 0x76, 0x6e, - 0x56, 0x66, 0xe7, 0x6b, 0x65, 0x2a, 0xcb, 0xca, 0x54, 0xae, 0x2b, 0x53, 0xb9, 0xa9, 0x4c, 0xe5, - 0x67, 0x65, 0x2a, 0xdf, 0x7e, 0x99, 0x9d, 0x8f, 0xdd, 0xe2, 0xf8, 0x4f, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x67, 0x35, 0x2d, 0x58, 0xe0, 0x03, 0x00, 0x00, + // 611 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x41, 0x6f, 0xd3, 0x30, + 0x18, 0x6d, 0x9a, 0x76, 0x6a, 0xdc, 0x69, 0x1b, 0x06, 0xa1, 0xaa, 0x42, 0x69, 0x35, 0x2e, 0x39, + 0xb0, 0x94, 0xed, 0xd4, 0x71, 0x62, 0x81, 0x1e, 0x90, 0x10, 0x9a, 0x3c, 0x84, 0x04, 0x97, 0x29, + 0xed, 0x3e, 0xb2, 0xb0, 0xc6, 0x0e, 0xb6, 0x13, 0xad, 0x9c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, 0xe4, 0xa1, + 0x05, 0x00, 0x00, } func (m *AgentSpec) Marshal() (dAtA []byte, err error) { @@ -233,6 +266,77 @@ func (m *AgentSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *PrometheusExporterSpec) 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 *PrometheusExporterSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PrometheusExporterSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SecurityContext != nil { + { + size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + { + size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.Env) > 0 { + for iNdEx := len(m.Env) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Env[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Args) > 0 { + for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Args[iNdEx]) + copy(dAtA[i:], m.Args[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Args[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + i = encodeVarintGenerated(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + func (m *PrometheusSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -253,6 +357,18 @@ func (m *PrometheusSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Exporter != nil { + { + size, err := m.Exporter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } i -= len(m.Interval) copy(dAtA[i:], m.Interval) i = encodeVarintGenerated(dAtA, i, uint64(len(m.Interval))) @@ -337,6 +453,34 @@ func (m *AgentSpec) Size() (n int) { return n } +func (m *PrometheusExporterSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.Port)) + if len(m.Args) > 0 { + for _, s := range m.Args { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Env) > 0 { + for _, e := range m.Env { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = m.Resources.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.SecurityContext != nil { + l = m.SecurityContext.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + func (m *PrometheusSpec) Size() (n int) { if m == nil { return 0 @@ -356,6 +500,10 @@ func (m *PrometheusSpec) Size() (n int) { } l = len(m.Interval) n += 1 + l + sovGenerated(uint64(l)) + if m.Exporter != nil { + l = m.Exporter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -385,6 +533,25 @@ func (this *AgentSpec) String() string { }, "") return s } +func (this *PrometheusExporterSpec) String() string { + if this == nil { + return "nil" + } + repeatedStringForEnv := "[]EnvVar{" + for _, f := range this.Env { + repeatedStringForEnv += fmt.Sprintf("%v", f) + "," + } + repeatedStringForEnv += "}" + s := strings.Join([]string{`&PrometheusExporterSpec{`, + `Port:` + fmt.Sprintf("%v", this.Port) + `,`, + `Args:` + fmt.Sprintf("%v", this.Args) + `,`, + `Env:` + repeatedStringForEnv + `,`, + `Resources:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Resources), "ResourceRequirements", "v1.ResourceRequirements", 1), `&`, ``, 1) + `,`, + `SecurityContext:` + strings.Replace(fmt.Sprintf("%v", this.SecurityContext), "SecurityContext", "v1.SecurityContext", 1) + `,`, + `}`, + }, "") + return s +} func (this *PrometheusSpec) String() string { if this == nil { return "nil" @@ -404,6 +571,7 @@ func (this *PrometheusSpec) String() string { `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, `Labels:` + mapStringForLabels + `,`, `Interval:` + fmt.Sprintf("%v", this.Interval) + `,`, + `Exporter:` + strings.Replace(this.Exporter.String(), "PrometheusExporterSpec", "PrometheusExporterSpec", 1) + `,`, `}`, }, "") return s @@ -672,6 +840,213 @@ func (m *AgentSpec) Unmarshal(dAtA []byte) error { } return nil } +func (m *PrometheusExporterSpec) 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 ErrIntOverflowGenerated + } + 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: PrometheusExporterSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PrometheusExporterSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + m.Port = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Port |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + 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 ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Args = append(m.Args, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Env", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Env = append(m.Env, v1.EnvVar{}) + if err := m.Env[len(m.Env)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecurityContext == nil { + m.SecurityContext = &v1.SecurityContext{} + } + if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *PrometheusSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -911,6 +1286,42 @@ func (m *PrometheusSpec) Unmarshal(dAtA []byte) error { } m.Interval = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Exporter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Exporter == nil { + m.Exporter = &PrometheusExporterSpec{} + } + if err := m.Exporter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/api/v1/generated.proto b/api/v1/generated.proto index 8d644006..38127fbd 100644 --- a/api/v1/generated.proto +++ b/api/v1/generated.proto @@ -40,40 +40,87 @@ message AgentSpec { // Cannot be updated. // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell // +optional + // Deprecated: use prometheus.exporter.args repeated string args = 3; // List of environment variables to set in the container. // Cannot be updated. + // Deprecated // +optional // +patchMergeKey=name // +patchStrategy=merge + // Deprecated: use prometheus.exporter.env repeated k8s.io.api.core.v1.EnvVar env = 4; // Compute Resources required by exporter container. // Cannot be updated. // More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ // +optional + // Deprecated: use prometheus.exporter.resources optional k8s.io.api.core.v1.ResourceRequirements resources = 5; // Security options the pod should run with. // More info: https://kubernetes.io/docs/concepts/policy/security-context/ // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ // +optional + // Deprecated: use prometheus.exporter.securityContext optional k8s.io.api.core.v1.SecurityContext securityContext = 6; } +message PrometheusExporterSpec { + // Port number for the exporter side car. + optional int32 port = 1; + + // Arguments to the entrypoint. + // The docker image's CMD is used if this is not provided. + // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable + // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax + // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, + // regardless of whether the variable exists or not. + // Cannot be updated. + // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell + // +optional + repeated string args = 2; + + // List of environment variables to set in the container. + // Cannot be updated. + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + repeated k8s.io.api.core.v1.EnvVar env = 3; + + // Compute Resources required by exporter container. + // Cannot be updated. + // More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + // +optional + optional k8s.io.api.core.v1.ResourceRequirements resources = 4; + + // Security options the pod should run with. + // More info: https://kubernetes.io/docs/concepts/policy/security-context/ + // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ + // +optional + optional k8s.io.api.core.v1.SecurityContext securityContext = 5; +} + message PrometheusSpec { // Port number for the exporter side car. + // Deprecated: use exporter.port optional int32 port = 1; // Namespace of Prometheus. Service monitors will be created in this namespace. + // Deprecated: will be removed in a future release optional string namespace = 2; // Labels are key value pairs that is used to select Prometheus instance via ServiceMonitor labels. // +optional + // Deprecated: will be removed in a future release map labels = 3; // Interval at which metrics should be scraped + // +optional + // Deprecated: will be removed in a future release optional string interval = 4; + + optional PrometheusExporterSpec exporter = 5; } diff --git a/api/v1/openapi_generated.go b/api/v1/openapi_generated.go index ea7e417c..5ea27b3c 100644 --- a/api/v1/openapi_generated.go +++ b/api/v1/openapi_generated.go @@ -29,8 +29,9 @@ import ( func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { return map[string]common.OpenAPIDefinition{ - "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec": schema_kmodulesxyz_monitoring_agent_api_api_v1_AgentSpec(ref), - "kmodules.xyz/monitoring-agent-api/api/v1.PrometheusSpec": schema_kmodulesxyz_monitoring_agent_api_api_v1_PrometheusSpec(ref), + "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec": schema_kmodulesxyz_monitoring_agent_api_api_v1_AgentSpec(ref), + "kmodules.xyz/monitoring-agent-api/api/v1.PrometheusExporterSpec": schema_kmodulesxyz_monitoring_agent_api_api_v1_PrometheusExporterSpec(ref), + "kmodules.xyz/monitoring-agent-api/api/v1.PrometheusSpec": schema_kmodulesxyz_monitoring_agent_api_api_v1_PrometheusSpec(ref), } } @@ -51,6 +52,72 @@ func schema_kmodulesxyz_monitoring_agent_api_api_v1_AgentSpec(ref common.Referen Ref: ref("kmodules.xyz/monitoring-agent-api/api/v1.PrometheusSpec"), }, }, + "args": { + SchemaProps: spec.SchemaProps{ + Description: "Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell Deprecated: use prometheus.exporter.args", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "env": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "List of environment variables to set in the container. Cannot be updated. Deprecated Deprecated: use prometheus.exporter.env", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.EnvVar"), + }, + }, + }, + }, + }, + "resources": { + SchemaProps: spec.SchemaProps{ + Description: "Compute Resources required by exporter container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ Deprecated: use prometheus.exporter.resources", + Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), + }, + }, + "securityContext": { + SchemaProps: spec.SchemaProps{ + Description: "Security options the pod should run with. More info: https://kubernetes.io/docs/concepts/policy/security-context/ More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ Deprecated: use prometheus.exporter.securityContext", + Ref: ref("k8s.io/api/core/v1.SecurityContext"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "kmodules.xyz/monitoring-agent-api/api/v1.PrometheusSpec"}, + } +} + +func schema_kmodulesxyz_monitoring_agent_api_api_v1_PrometheusExporterSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "port": { + SchemaProps: spec.SchemaProps{ + Description: "Port number for the exporter side car.", + Type: []string{"integer"}, + Format: "int32", + }, + }, "args": { SchemaProps: spec.SchemaProps{ Description: "Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", @@ -100,7 +167,7 @@ func schema_kmodulesxyz_monitoring_agent_api_api_v1_AgentSpec(ref common.Referen }, }, Dependencies: []string{ - "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "kmodules.xyz/monitoring-agent-api/api/v1.PrometheusSpec"}, + "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext"}, } } @@ -112,21 +179,21 @@ func schema_kmodulesxyz_monitoring_agent_api_api_v1_PrometheusSpec(ref common.Re Properties: map[string]spec.Schema{ "port": { SchemaProps: spec.SchemaProps{ - Description: "Port number for the exporter side car.", + Description: "Port number for the exporter side car. Deprecated: use exporter.port", Type: []string{"integer"}, Format: "int32", }, }, "namespace": { SchemaProps: spec.SchemaProps{ - Description: "Namespace of Prometheus. Service monitors will be created in this namespace.", + Description: "Namespace of Prometheus. Service monitors will be created in this namespace. Deprecated: will be removed in a future release", Type: []string{"string"}, Format: "", }, }, "labels": { SchemaProps: spec.SchemaProps{ - Description: "Labels are key value pairs that is used to select Prometheus instance via ServiceMonitor labels.", + Description: "Labels are key value pairs that is used to select Prometheus instance via ServiceMonitor labels. Deprecated: will be removed in a future release", Type: []string{"object"}, AdditionalProperties: &spec.SchemaOrBool{ Allows: true, @@ -141,13 +208,20 @@ func schema_kmodulesxyz_monitoring_agent_api_api_v1_PrometheusSpec(ref common.Re }, "interval": { SchemaProps: spec.SchemaProps{ - Description: "Interval at which metrics should be scraped", + Description: "Interval at which metrics should be scraped Deprecated: will be removed in a future release", Type: []string{"string"}, Format: "", }, }, + "exporter": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kmodules.xyz/monitoring-agent-api/api/v1.PrometheusExporterSpec"), + }, + }, }, }, }, + Dependencies: []string{ + "kmodules.xyz/monitoring-agent-api/api/v1.PrometheusExporterSpec"}, } } diff --git a/api/v1/types.go b/api/v1/types.go index 60be397b..4b7d12c2 100644 --- a/api/v1/types.go +++ b/api/v1/types.go @@ -30,9 +30,11 @@ const ( KeyAgent = "monitoring.appscode.com/agent" KeyService = "monitoring.appscode.com/service" - VendorPrometheus = "prometheus.io" - AgentPrometheusBuiltin AgentType = VendorPrometheus + "/builtin" - AgentPrometheusOperator AgentType = VendorPrometheus + "/operator" + VendorPrometheus = "prometheus.io" + + AgentPrometheus AgentType = VendorPrometheus + // Deprecated + AgentPrometheusBuiltin AgentType = VendorPrometheus + "/builtin" // Deprecated AgentCoreOSPrometheus AgentType = VendorPrometheus + "/coreos-operator" // Deprecated @@ -49,6 +51,7 @@ func (at AgentType) Vendor() string { type AgentSpec struct { Agent AgentType `json:"agent,omitempty" protobuf:"bytes,1,opt,name=agent,casttype=AgentType"` Prometheus *PrometheusSpec `json:"prometheus,omitempty" protobuf:"bytes,2,opt,name=prometheus"` + // Arguments to the entrypoint. // The docker image's CMD is used if this is not provided. // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable @@ -58,40 +61,88 @@ type AgentSpec struct { // Cannot be updated. // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell // +optional + // Deprecated: use prometheus.exporter.args Args []string `json:"args,omitempty" protobuf:"bytes,3,rep,name=args"` + // List of environment variables to set in the container. // Cannot be updated. + // Deprecated // +optional // +patchMergeKey=name // +patchStrategy=merge + // Deprecated: use prometheus.exporter.env Env []core.EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,4,rep,name=env"` + // Compute Resources required by exporter container. // Cannot be updated. // More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ // +optional + // Deprecated: use prometheus.exporter.resources Resources core.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,5,opt,name=resources"` + // Security options the pod should run with. // More info: https://kubernetes.io/docs/concepts/policy/security-context/ // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ // +optional + // Deprecated: use prometheus.exporter.securityContext SecurityContext *core.SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,6,opt,name=securityContext"` } type PrometheusSpec struct { // Port number for the exporter side car. + // Deprecated: use exporter.port Port int32 `json:"port,omitempty" protobuf:"varint,1,opt,name=port"` // Namespace of Prometheus. Service monitors will be created in this namespace. + // Deprecated: will be removed in a future release Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"` + // Labels are key value pairs that is used to select Prometheus instance via ServiceMonitor labels. // +optional + // Deprecated: will be removed in a future release Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,3,rep,name=labels"` // Interval at which metrics should be scraped + // +optional + // Deprecated: will be removed in a future release Interval string `json:"interval,omitempty" protobuf:"bytes,4,opt,name=interval"` - // Parameters are key value pairs that are passed as flags to exporters. - // Parameters map[string]string `json:"parameters,omitempty"` + Exporter *PrometheusExporterSpec `json:"exporter,omitempty" protobuf:"bytes,5,opt,name=exporter"` +} + +type PrometheusExporterSpec struct { + // Port number for the exporter side car. + Port int32 `json:"port,omitempty" protobuf:"varint,1,opt,name=port"` + + // Arguments to the entrypoint. + // The docker image's CMD is used if this is not provided. + // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable + // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax + // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, + // regardless of whether the variable exists or not. + // Cannot be updated. + // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell + // +optional + Args []string `json:"args,omitempty" protobuf:"bytes,2,rep,name=args"` + + // List of environment variables to set in the container. + // Cannot be updated. + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + Env []core.EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,3,rep,name=env"` + + // Compute Resources required by exporter container. + // Cannot be updated. + // More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + // +optional + Resources core.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,4,opt,name=resources"` + + // Security options the pod should run with. + // More info: https://kubernetes.io/docs/concepts/policy/security-context/ + // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ + // +optional + SecurityContext *core.SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,5,opt,name=securityContext"` } type Agent interface { diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index 83737914..7b9e26fb 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -63,6 +63,40 @@ func (in *AgentSpec) DeepCopy() *AgentSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrometheusExporterSpec) DeepCopyInto(out *PrometheusExporterSpec) { + *out = *in + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Env != nil { + in, out := &in.Env, &out.Env + *out = make([]corev1.EnvVar, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.Resources.DeepCopyInto(&out.Resources) + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(corev1.SecurityContext) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusExporterSpec. +func (in *PrometheusExporterSpec) DeepCopy() *PrometheusExporterSpec { + if in == nil { + return nil + } + out := new(PrometheusExporterSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PrometheusSpec) DeepCopyInto(out *PrometheusSpec) { *out = *in @@ -73,6 +107,11 @@ func (in *PrometheusSpec) DeepCopyInto(out *PrometheusSpec) { (*out)[key] = val } } + if in.Exporter != nil { + in, out := &in.Exporter, &out.Exporter + *out = new(PrometheusExporterSpec) + (*in).DeepCopyInto(*out) + } return }