diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2016-06-01 19:21:27 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2016-06-02 16:11:40 +0100 |
commit | 31945750fc318d93e314126df8d85cfca71983e5 (patch) | |
tree | 7d14d56427b18c7e492e32180f284105df998846 | |
parent | 5df6fa7dab865ea238304724e762a5b8d3fb3362 (diff) | |
download | sos-31945750fc318d93e314126df8d85cfca71983e5.tar.gz |
[kubernetes] convert to add_journal interface
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/kubernetes.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sos/plugins/kubernetes.py b/sos/plugins/kubernetes.py index 3399b2ed..32857a81 100644 --- a/sos/plugins/kubernetes.py +++ b/sos/plugins/kubernetes.py @@ -35,11 +35,19 @@ class kubernetes(Plugin, RedHatPlugin): self.add_cmd_output("kubectl get -o json services") self.add_cmd_output("kubectl get -o json replicationController") self.add_cmd_output("kubectl get -o json events") - self.add_cmd_output("journalctl -u kubelet") - self.add_cmd_output("journalctl -u kube-apiserver") - self.add_cmd_output("journalctl -u kube-controller-manager") - self.add_cmd_output("journalctl -u kube-scheduler") - self.add_cmd_output("journalctl -u kube-proxy") + + # This could use a single call: + # + # add_journal(units=["kubelet", "kube-apiserver", ... ]) + # + # But this would merge all units into a single text stream - to + # preserve existing file layout in archives keep these as + # separate journalctl calls. + self.add_journal(units="kubelet") + self.add_journal(units="kube-apiserver") + self.add_journal(units="kube-controller-manager") + self.add_journal(units="kube-scheduler") + self.add_journal(units="kube-proxy") if self.get_option('podslog'): result = self.get_command_output("kubectl get pods") |