From 0fdbb22ed7e83bb0489d0e054090dc2d4996cf6e Mon Sep 17 00:00:00 2001 From: emmanueltouzery Date: Tue, 4 Jun 2024 14:47:42 +0200 Subject: [PATCH 1/5] Fix high IO after sudden filebeat stop (#35893) (#39392) In case of corrupted log file (which has good chances to happen in case of sudden unclean system shutdown), we set a flag which causes us to checkpoint immediately, but never do anything else besides that. This causes Filebeat to just checkpoint on each log operation (therefore causing a high IO load on the server and also causing Filebeat to fall behind). This change resets the logInvalid flag after a successful checkpointing. Co-authored-by: Tiago Queiroz (cherry picked from commit 217f5a626498623bb8b7c04f71a7b1f13d1afa19) # Conflicts: # libbeat/statestore/backend/memlog/diskstore.go --- CHANGELOG.next.asciidoc | 29 ++++++++++ .../statestore/backend/memlog/diskstore.go | 17 +++++- .../statestore/backend/memlog/store_test.go | 55 +++++++++++++++++++ 3 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 libbeat/statestore/backend/memlog/store_test.go diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 3e09a9efc06..25ec2cdeade 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -15,6 +15,35 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d *Filebeat* +- Convert netflow input to API v2 and disable event normalisation {pull}37901[37901] +- Removed deprecated ZScaler from Beats. Use the https://docs.elastic.co/integrations/zscaler_zia[Zscaler Internet Access] Elastic integration instead. {pull}38037[38037] +- Removed deprecated Tomcat from Beats. Use the https://docs.elastic.co/integrations/apache_tomcat[Apache Tomcat] Elastic integration instead. {pull}38037[38037] +- Removed deprecated Squid from Beats. See <> for migration options. {pull}38037[38037] +- Removed deprecated SonicWall from Beats. Use the https://docs.elastic.co/integrations/sonicwall[SonicWall Firewall] Elastic integration instead. {pull}38037[38037] +- Removed deprecated Sonicwall from Beats. Use the https://docs.elastic.co/integrations/sonicwall[SonicWall Firewall] Elastic integration instead. {pull}38037[38037] +- Removed deprecated Snort from Beats. Use the https://docs.elastic.co/integrations/snort[Snort] Elastic integration instead. {pull}38037[38037] +- Removed deprecated Radware from Beats. See <> for migration options. {pull}38037[38037] +- Removed deprecated Proofpoint from Beats. Use the https://docs.elastic.co/integrations/proofpoint_tap[Proofpoint TAP] Elastic integration instead. {pull}38037[38037] +- Removed deprecated Netscout from Beats. See <> for migration options. {pull}38037[38037] +- Removed deprecated Microsoft DHCP from Beats. Use the https://docs.elastic.co/integrations/microsoft_dhcp[Microsoft DHCP] Elastic integration instead. {pull}38037[38037] +- Removed deprecated Juniper Junos from Beats. Use the https://docs.elastic.co/integrations/juniper_srx[Juniper SRX] Elastic integration instead. {pull}38037[38037] +- Removed deprecated Juniper Netscreen from Beats. See <> for migration options. {pull}38037[38037] +- Removed deprecated Infoblox from Beats. Use the https://docs.elastic.co/integrations/infoblox_nios[Infoblox NIOS] Elastic integration instead. {pull}38037[38037] +- Removed deprecated Impreva from Beats. See <> for migration options. {pull}38037[38037] +- Removed deprecated Fortinet Client Endpoint from Beats. Use the https://docs.elastic.co/integrations/fortinet_forticlient[Fortinet FortiClient Logs] Elastic integration instead. {pull}38037[38037] +- Removed deprecated Fortinet Fortimail from Beats. Use the https://docs.elastic.co/integrations/fortinet_fortimail[Fortinet FortiMail] Elastic integration instead. {pull}38037[38037] +- Removed deprecated Fortinet Fortimanager from Beats. Use the https://docs.elastic.co/integrations/fortinet_fortimanager[Fortinet FortiManager Logs] Elastic integration instead. {pull}38037[38037] +- Removed deprecated F5 from Beats. Use the https://docs.elastic.co/integrations/f5_bigip[F5 BIG-IP] Elastic integration instead. {pull}38037[38037] +- Removed deprecated Cylance from Beats. See <> for migration options. {pull}38037[38037] +- Removed deprecated Cisco Meraki from Beats. Use the https://docs.elastic.co/integrations/cisco_meraki[Cisco Meraki] Elastic integration instead. {pull}38037[38037] +- Removed deprecated Cisco Nexus from Beats. Use the https://docs.elastic.co/integrations/cisco_nexus[Cisco Nexus] Elastic integration instead. {pull}38037[38037] +- Removed deprecated Bluecoat from Beats. See <> for migration options. {pull}38037[38037] +- Removed deprecated Barracuda from Beats. Use the https://docs.elastic.co/integrations/barracuda[Barracuda Web Application Firewall] Elastic integration instead. {pull}38037[38037] +- Removed deprecated Sophos UTM from Beats. Use the https://docs.elastic.co/integrations/sophos[Sophos] Elastic integration instead. {pull}38037[38037] +- Introduce input/netmetrics and refactor netflow input metrics {pull}38055[38055] +- Update Salesforce module to use new Salesforce input. {pull}37509[37509] +- Fix high IO and handling of a corrupted registry log file. {pull}35893[35893] + *Heartbeat* *Metricbeat* diff --git a/libbeat/statestore/backend/memlog/diskstore.go b/libbeat/statestore/backend/memlog/diskstore.go index 84a398e0bd7..f50898a5984 100644 --- a/libbeat/statestore/backend/memlog/diskstore.go +++ b/libbeat/statestore/backend/memlog/diskstore.go @@ -21,7 +21,11 @@ import ( "bufio" "encoding/json" "fmt" +<<<<<<< HEAD "io/ioutil" +======= + "io" +>>>>>>> 217f5a6264 (Fix high IO after sudden filebeat stop (#35893) (#39392)) "os" "path/filepath" "sort" @@ -180,7 +184,7 @@ func (s *diskstore) tryOpenLog() error { f.Close() }) - _, err = f.Seek(0, os.SEEK_END) + _, err = f.Seek(0, io.SeekEnd) if err != nil { return err } @@ -399,7 +403,12 @@ func (s *diskstore) checkpointClearLog() { err := s.logFile.Truncate(0) if err == nil { +<<<<<<< HEAD _, err = s.logFile.Seek(0, os.SEEK_SET) +======= + _, err = s.logFile.Seek(0, io.SeekStart) + s.logInvalid = false +>>>>>>> 217f5a6264 (Fix high IO after sudden filebeat stop (#35893) (#39392)) } if err != nil { @@ -436,7 +445,7 @@ func updateActiveMarker(log *logp.Logger, homePath, checkpointFilePath string) e log.Errorf("Failed to remove old temporary active.dat.tmp file: %v", err) return err } - if err := ioutil.WriteFile(tmpLink, []byte(checkpointFilePath), 0600); err != nil { + if err := os.WriteFile(tmpLink, []byte(checkpointFilePath), 0600); err != nil { log.Errorf("Failed to write temporary pointer file: %v", err) return err } @@ -534,7 +543,11 @@ func readDataFile(path string, fn func(string, common.MapStr)) error { var states []map[string]interface{} dec := json.NewDecoder(f) if err := dec.Decode(&states); err != nil { +<<<<<<< HEAD return fmt.Errorf("corrupted data file: %v", err) +======= + return fmt.Errorf("%w: %w", ErrCorruptStore, err) +>>>>>>> 217f5a6264 (Fix high IO after sudden filebeat stop (#35893) (#39392)) } for _, state := range states { diff --git a/libbeat/statestore/backend/memlog/store_test.go b/libbeat/statestore/backend/memlog/store_test.go new file mode 100644 index 00000000000..d0bc650db19 --- /dev/null +++ b/libbeat/statestore/backend/memlog/store_test.go @@ -0,0 +1,55 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you 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. + +package memlog + +import ( + "os" + "path/filepath" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/elastic/elastic-agent-libs/logp" + "github.com/elastic/elastic-agent-libs/mapstr" +) + +func TestRecoverFromCorruption(t *testing.T) { + path := t.TempDir() + logp.DevelopmentSetup() + + if err := copyPath(path, "testdata/1/logfile_incomplete/"); err != nil { + t.Fatalf("Failed to copy test file to the temporary directory: %v", err) + } + + store, err := openStore(logp.NewLogger("test"), path, 0660, 4096, false, func(_ uint64) bool { + return false + }) + require.NoError(t, err, "openStore must succeed") + require.True(t, store.disk.logInvalid, "expecting the log file to be invalid") + + err = store.logOperation(&opSet{K: "key", V: mapstr.M{ + "field": 42, + }}) + require.NoError(t, err, "logOperation must succeed") + require.False(t, store.disk.logInvalid, "log file must be valid") + require.FileExistsf(t, filepath.Join(path, "7.json"), "expecting the checkpoint file to have been created") + + file, err := os.Stat(filepath.Join(path, "log.json")) + require.NoError(t, err, "Stat on the log file must succeed") + require.Equal(t, int64(0), file.Size(), "expecting the log file to be truncated") +} From 429d3419657679a2b7277c489da3eb151d2cd40c Mon Sep 17 00:00:00 2001 From: Tiago Queiroz Date: Fri, 7 Jun 2024 09:25:01 -0400 Subject: [PATCH 2/5] Fix backport merge conflicts --- CHANGELOG.next.asciidoc | 27 ------------------- .../statestore/backend/memlog/diskstore.go | 15 +++-------- .../statestore/backend/memlog/store_test.go | 6 ++--- 3 files changed, 6 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 25ec2cdeade..a478fe28ea3 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -15,33 +15,6 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d *Filebeat* -- Convert netflow input to API v2 and disable event normalisation {pull}37901[37901] -- Removed deprecated ZScaler from Beats. Use the https://docs.elastic.co/integrations/zscaler_zia[Zscaler Internet Access] Elastic integration instead. {pull}38037[38037] -- Removed deprecated Tomcat from Beats. Use the https://docs.elastic.co/integrations/apache_tomcat[Apache Tomcat] Elastic integration instead. {pull}38037[38037] -- Removed deprecated Squid from Beats. See <> for migration options. {pull}38037[38037] -- Removed deprecated SonicWall from Beats. Use the https://docs.elastic.co/integrations/sonicwall[SonicWall Firewall] Elastic integration instead. {pull}38037[38037] -- Removed deprecated Sonicwall from Beats. Use the https://docs.elastic.co/integrations/sonicwall[SonicWall Firewall] Elastic integration instead. {pull}38037[38037] -- Removed deprecated Snort from Beats. Use the https://docs.elastic.co/integrations/snort[Snort] Elastic integration instead. {pull}38037[38037] -- Removed deprecated Radware from Beats. See <> for migration options. {pull}38037[38037] -- Removed deprecated Proofpoint from Beats. Use the https://docs.elastic.co/integrations/proofpoint_tap[Proofpoint TAP] Elastic integration instead. {pull}38037[38037] -- Removed deprecated Netscout from Beats. See <> for migration options. {pull}38037[38037] -- Removed deprecated Microsoft DHCP from Beats. Use the https://docs.elastic.co/integrations/microsoft_dhcp[Microsoft DHCP] Elastic integration instead. {pull}38037[38037] -- Removed deprecated Juniper Junos from Beats. Use the https://docs.elastic.co/integrations/juniper_srx[Juniper SRX] Elastic integration instead. {pull}38037[38037] -- Removed deprecated Juniper Netscreen from Beats. See <> for migration options. {pull}38037[38037] -- Removed deprecated Infoblox from Beats. Use the https://docs.elastic.co/integrations/infoblox_nios[Infoblox NIOS] Elastic integration instead. {pull}38037[38037] -- Removed deprecated Impreva from Beats. See <> for migration options. {pull}38037[38037] -- Removed deprecated Fortinet Client Endpoint from Beats. Use the https://docs.elastic.co/integrations/fortinet_forticlient[Fortinet FortiClient Logs] Elastic integration instead. {pull}38037[38037] -- Removed deprecated Fortinet Fortimail from Beats. Use the https://docs.elastic.co/integrations/fortinet_fortimail[Fortinet FortiMail] Elastic integration instead. {pull}38037[38037] -- Removed deprecated Fortinet Fortimanager from Beats. Use the https://docs.elastic.co/integrations/fortinet_fortimanager[Fortinet FortiManager Logs] Elastic integration instead. {pull}38037[38037] -- Removed deprecated F5 from Beats. Use the https://docs.elastic.co/integrations/f5_bigip[F5 BIG-IP] Elastic integration instead. {pull}38037[38037] -- Removed deprecated Cylance from Beats. See <> for migration options. {pull}38037[38037] -- Removed deprecated Cisco Meraki from Beats. Use the https://docs.elastic.co/integrations/cisco_meraki[Cisco Meraki] Elastic integration instead. {pull}38037[38037] -- Removed deprecated Cisco Nexus from Beats. Use the https://docs.elastic.co/integrations/cisco_nexus[Cisco Nexus] Elastic integration instead. {pull}38037[38037] -- Removed deprecated Bluecoat from Beats. See <> for migration options. {pull}38037[38037] -- Removed deprecated Barracuda from Beats. Use the https://docs.elastic.co/integrations/barracuda[Barracuda Web Application Firewall] Elastic integration instead. {pull}38037[38037] -- Removed deprecated Sophos UTM from Beats. Use the https://docs.elastic.co/integrations/sophos[Sophos] Elastic integration instead. {pull}38037[38037] -- Introduce input/netmetrics and refactor netflow input metrics {pull}38055[38055] -- Update Salesforce module to use new Salesforce input. {pull}37509[37509] - Fix high IO and handling of a corrupted registry log file. {pull}35893[35893] *Heartbeat* diff --git a/libbeat/statestore/backend/memlog/diskstore.go b/libbeat/statestore/backend/memlog/diskstore.go index f50898a5984..3d08f9a8772 100644 --- a/libbeat/statestore/backend/memlog/diskstore.go +++ b/libbeat/statestore/backend/memlog/diskstore.go @@ -20,12 +20,9 @@ package memlog import ( "bufio" "encoding/json" + "errors" "fmt" -<<<<<<< HEAD - "io/ioutil" -======= "io" ->>>>>>> 217f5a6264 (Fix high IO after sudden filebeat stop (#35893) (#39392)) "os" "path/filepath" "sort" @@ -110,6 +107,8 @@ const ( keyField = "_key" ) +var ErrCorruptStore = errors.New("corrupted data file") + // newDiskStore initializes the disk store stucture only. The store must have // been opened already. It tries to open the update log file for append // operations. If opening the update log file fails, it is marked as @@ -403,12 +402,8 @@ func (s *diskstore) checkpointClearLog() { err := s.logFile.Truncate(0) if err == nil { -<<<<<<< HEAD - _, err = s.logFile.Seek(0, os.SEEK_SET) -======= _, err = s.logFile.Seek(0, io.SeekStart) s.logInvalid = false ->>>>>>> 217f5a6264 (Fix high IO after sudden filebeat stop (#35893) (#39392)) } if err != nil { @@ -543,11 +538,7 @@ func readDataFile(path string, fn func(string, common.MapStr)) error { var states []map[string]interface{} dec := json.NewDecoder(f) if err := dec.Decode(&states); err != nil { -<<<<<<< HEAD - return fmt.Errorf("corrupted data file: %v", err) -======= return fmt.Errorf("%w: %w", ErrCorruptStore, err) ->>>>>>> 217f5a6264 (Fix high IO after sudden filebeat stop (#35893) (#39392)) } for _, state := range states { diff --git a/libbeat/statestore/backend/memlog/store_test.go b/libbeat/statestore/backend/memlog/store_test.go index d0bc650db19..7aa40f27710 100644 --- a/libbeat/statestore/backend/memlog/store_test.go +++ b/libbeat/statestore/backend/memlog/store_test.go @@ -24,8 +24,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/elastic/elastic-agent-libs/logp" - "github.com/elastic/elastic-agent-libs/mapstr" + "github.com/elastic/beats/v7/libbeat/common" + "github.com/elastic/beats/v7/libbeat/logp" ) func TestRecoverFromCorruption(t *testing.T) { @@ -42,7 +42,7 @@ func TestRecoverFromCorruption(t *testing.T) { require.NoError(t, err, "openStore must succeed") require.True(t, store.disk.logInvalid, "expecting the log file to be invalid") - err = store.logOperation(&opSet{K: "key", V: mapstr.M{ + err = store.logOperation(&opSet{K: "key", V: common.MapStr{ "field": 42, }}) require.NoError(t, err, "logOperation must succeed") From 38119b8b12a688e21de186ae0452ae3f9624afde Mon Sep 17 00:00:00 2001 From: Tiago Queiroz Date: Fri, 7 Jun 2024 09:54:53 -0400 Subject: [PATCH 3/5] Fix lint warnings Fix lint warning without changing behaviour, all errors that were not handled are only logged. --- .../statestore/backend/memlog/diskstore.go | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/libbeat/statestore/backend/memlog/diskstore.go b/libbeat/statestore/backend/memlog/diskstore.go index 3d08f9a8772..b41a3c9af25 100644 --- a/libbeat/statestore/backend/memlog/diskstore.go +++ b/libbeat/statestore/backend/memlog/diskstore.go @@ -103,13 +103,11 @@ const ( checkpointTmpFileName = "checkpoint.new" storeVersion = "1" - - keyField = "_key" ) var ErrCorruptStore = errors.New("corrupted data file") -// newDiskStore initializes the disk store stucture only. The store must have +// newDiskStore initializes the disk store structure only. The store must have // been opened already. It tries to open the update log file for append // operations. If opening the update log file fails, it is marked as // 'corrupted', triggering a checkpoint operation on the first update to the store. @@ -264,12 +262,16 @@ func (s *diskstore) LogOperation(op op) error { if err := enc.Encode(logAction{Op: op.name(), ID: s.nextTxID}); err != nil { return err } - writer.WriteByte('\n') + if err := writer.WriteByte('\n'); err != nil { + s.log.Errorf("could not write to registry log file: %s", err) + } if err := enc.Encode(op); err != nil { return err } - writer.WriteByte('\n') + if err := writer.WriteByte('\n'); err != nil { + s.log.Errorf("could not write to registry log file: %s", err) + } if err := writer.Flush(); err != nil { return err @@ -330,7 +332,10 @@ func (s *diskstore) WriteCheckpoint(state map[string]entry) error { } // delete old transaction files - updateActiveMarker(s.log, s.home, s.activeDataFile.path) + if err := updateActiveMarker(s.log, s.home, s.activeDataFile.path); err != nil { + s.log.Warnf("could not update active marker: %s", err) + } + s.removeOldDataFiles() trySyncPath(s.home) @@ -559,7 +564,7 @@ func readDataFile(path string, fn func(string, common.MapStr)) error { // memStore. // The txid is the transaction ID of the last known valid data file. // Transactions older then txid will be ignored. -// loadLogFile returns the last commited txid in logTxid and the total number +// loadLogFile returns the last committed txid in logTxid and the total number // of operations in logCount. func loadLogFile( store *memstore, @@ -683,7 +688,7 @@ func readMetaFile(home string) (storeMeta, error) { dec := json.NewDecoder(f) if err := dec.Decode(&meta); err != nil { - return meta, fmt.Errorf("can not read store meta file: %v", err) + return meta, fmt.Errorf("can not read store meta file: %w", err) } return meta, nil From 20ad844e9614d2fee568ecbb64f68096fb5099cf Mon Sep 17 00:00:00 2001 From: Tiago Queiroz Date: Fri, 7 Jun 2024 10:37:44 -0400 Subject: [PATCH 4/5] fix lint warning --- libbeat/statestore/backend/memlog/store_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libbeat/statestore/backend/memlog/store_test.go b/libbeat/statestore/backend/memlog/store_test.go index 7aa40f27710..5230b45b6fc 100644 --- a/libbeat/statestore/backend/memlog/store_test.go +++ b/libbeat/statestore/backend/memlog/store_test.go @@ -30,7 +30,7 @@ import ( func TestRecoverFromCorruption(t *testing.T) { path := t.TempDir() - logp.DevelopmentSetup() + logp.DevelopmentSetup() //nolint: errcheck // it's a test and we don't rely on the logs if err := copyPath(path, "testdata/1/logfile_incomplete/"); err != nil { t.Fatalf("Failed to copy test file to the temporary directory: %v", err) From 0cf9cd1c27bbc0cdb819a1fa7e033a31f00719fc Mon Sep 17 00:00:00 2001 From: Tiago Queiroz Date: Thu, 13 Jun 2024 17:48:00 -0400 Subject: [PATCH 5/5] Update deprecated Kubernets API and improve error reporting This commit improves error reporting in Go integration tests, when a module fails, its name and error are collected and printed at the end. The deprecated `batch/v1beta1` is replaced by `batch/v1` in Kubernetes manifests. --- dev-tools/mage/gotest.go | 19 ++++++++++++++++--- .../_meta/test/docs/02_objects/cronjob.yaml | 4 ++-- metricbeat/module/kubernetes/kubernetes.yml | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/dev-tools/mage/gotest.go b/dev-tools/mage/gotest.go index c21ac3eaa89..019f624a271 100644 --- a/dev-tools/mage/gotest.go +++ b/dev-tools/mage/gotest.go @@ -142,8 +142,12 @@ func GoTestIntegrationForModule(ctx context.Context) error { return err } + type moduleErr struct { + name string + err error + } foundModule := false - failedModules := []string{} + failedModules := []moduleErr{} for _, fi := range modulesFileInfo { if !fi.IsDir() { continue @@ -169,14 +173,23 @@ func GoTestIntegrationForModule(ctx context.Context) error { }) if err != nil { // err will already be report to stdout, collect failed module to report at end - failedModules = append(failedModules, fi.Name()) + failedModules = append(failedModules, moduleErr{ + name: fi.Name(), + err: err, + }) } } if module != "" && !foundModule { return fmt.Errorf("no module %s", module) } if len(failedModules) > 0 { - return fmt.Errorf("failed modules: %s", strings.Join(failedModules, ", ")) + errMsg := strings.Builder{} + names := []string{} + for _, m := range failedModules { + fmt.Fprintf(&errMsg, "Module: %s\nError: %s\n", m.name, m.err.Error()) + names = append(names, m.name) + } + return fmt.Errorf("failed modules: %s.\n%s", strings.Join(names, ", "), errMsg.String()) } return nil } diff --git a/metricbeat/module/kubernetes/_meta/test/docs/02_objects/cronjob.yaml b/metricbeat/module/kubernetes/_meta/test/docs/02_objects/cronjob.yaml index eba346cf155..8f334648489 100644 --- a/metricbeat/module/kubernetes/_meta/test/docs/02_objects/cronjob.yaml +++ b/metricbeat/module/kubernetes/_meta/test/docs/02_objects/cronjob.yaml @@ -1,7 +1,7 @@ # Cronjob that will execute each minute. # It will print a message and sleep (reporting being active) for 5 seconds -apiVersion: batch/v1beta1 +apiVersion: batch/v1 kind: CronJob metadata: name: mycronjob @@ -19,4 +19,4 @@ spec: restartPolicy: OnFailure terminationGracePeriodSeconds: 0 - concurrencyPolicy: Allow \ No newline at end of file + concurrencyPolicy: Allow diff --git a/metricbeat/module/kubernetes/kubernetes.yml b/metricbeat/module/kubernetes/kubernetes.yml index d87cb4f5f9b..7c4ffb58ae9 100644 --- a/metricbeat/module/kubernetes/kubernetes.yml +++ b/metricbeat/module/kubernetes/kubernetes.yml @@ -108,7 +108,7 @@ spec: requests: storage: 1Mi --- -apiVersion: batch/v1beta1 +apiVersion: batch/v1 kind: CronJob metadata: name: basic-cronjob