mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-19 00:31:00 +00:00
Merge pull request #37634 from Crassirostris/gcl-e2e-debugging
Automatic merge from submit-queue (batch tested with PRs 38076, 38137, 36882, 37634, 37558) Make logging for gcl e2e test more verbose To help debug https://github.com/kubernetes/kubernetes/issues/37241 CC @piosz
This commit is contained in:
commit
637a5703f6
@ -31,12 +31,20 @@ import (
|
|||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
increaseFluentdVerbosityCommand = "sudo sed -i 's/-q/-vv/g' /etc/kubernetes/manifests/fluentd-gcp.yaml;" +
|
||||||
|
" sudo sed -i 's/-q/-vv/g' /etc/kubernetes/manifests/fluentd-gcp-gci.yaml"
|
||||||
|
)
|
||||||
|
|
||||||
var _ = framework.KubeDescribe("Cluster level logging using GCL", func() {
|
var _ = framework.KubeDescribe("Cluster level logging using GCL", func() {
|
||||||
f := framework.NewDefaultFramework("gcl-logging")
|
f := framework.NewDefaultFramework("gcl-logging")
|
||||||
|
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
// TODO (crassirostris): Expand to GKE once the test is stable
|
// TODO (crassirostris): Expand to GKE once the test is stable
|
||||||
framework.SkipUnlessProviderIs("gce")
|
framework.SkipUnlessProviderIs("gce")
|
||||||
|
|
||||||
|
// TODO (crassirostris): Remove once the test is stable
|
||||||
|
increaseFluentdVerbosity(f)
|
||||||
})
|
})
|
||||||
|
|
||||||
It("should check that logs from containers are ingested in GCL", func() {
|
It("should check that logs from containers are ingested in GCL", func() {
|
||||||
@ -134,3 +142,36 @@ func readFilteredEntriesFromGcl(filter string) ([]string, error) {
|
|||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func increaseFluentdVerbosity(f *framework.Framework) error {
|
||||||
|
masters, nodeList := framework.GetMasterAndWorkerNodesOrDie(f.ClientSet)
|
||||||
|
|
||||||
|
for master := range masters {
|
||||||
|
if err := increaseFluentdVerbosityOnNode(f, master); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, node := range nodeList.Items {
|
||||||
|
if err := increaseFluentdVerbosityOnNode(f, node.Name); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func increaseFluentdVerbosityOnNode(f *framework.Framework, nodeName string) error {
|
||||||
|
argList := []string{"compute",
|
||||||
|
"ssh",
|
||||||
|
nodeName,
|
||||||
|
"--project",
|
||||||
|
framework.TestContext.CloudConfig.ProjectID,
|
||||||
|
"--zone",
|
||||||
|
framework.TestContext.CloudConfig.Zone,
|
||||||
|
"--command",
|
||||||
|
increaseFluentdVerbosityCommand,
|
||||||
|
}
|
||||||
|
|
||||||
|
return exec.Command("gcloud", argList...).Run()
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user