aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Niehoff <nick.niehoff@canonical.com>2020-06-04 14:56:20 -0600
committerJake Hunsaker <jhunsake@redhat.com>2020-06-08 12:45:31 -0400
commit9d572eb4caf4dfd39aaab8fce28f6ad60f238733 (patch)
treee62b1e791d2081e31583428c712f49af29c95c94
parentfc831f0072c8f751f8fc2f46eb5c3e6aa9eba0a9 (diff)
downloadsos-9d572eb4caf4dfd39aaab8fce28f6ad60f238733.tar.gz
[kubernetes] Adding support for alternate Ubuntu deployments
This plugin is only executed if Kubernetes is deployed using Canonical's Charmed Distribution of Kubernetes. The plugin should also be run if other deployment methods are used. Also adding service names if the Ubuntu Snaps are used for the kubernetes control plane. Closes: #2103 Signed-off-by: Nick Niehoff <nick.niehoff@canonical.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/report/plugins/kubernetes.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/sos/report/plugins/kubernetes.py b/sos/report/plugins/kubernetes.py
index 3717c4c6..03f2c498 100644
--- a/sos/report/plugins/kubernetes.py
+++ b/sos/report/plugins/kubernetes.py
@@ -53,7 +53,12 @@ class Kubernetes(Plugin):
'kube-apiserver',
'kube-proxy',
'kube-scheduler',
- 'kube-controller-manager'
+ 'kube-controller-manager',
+ 'snap.kubelet.daemon',
+ 'snap.kube-apiserver.daemon',
+ 'snap.kube-proxy.daemon',
+ 'snap.kube-scheduler.daemon',
+ 'snap.kube-controller-manager.daemon'
]
for svc in svcs:
@@ -196,7 +201,10 @@ class RedHatKubernetes(Kubernetes, RedHatPlugin):
class UbuntuKubernetes(Kubernetes, UbuntuPlugin):
packages = ('kubernetes',)
- files = ('/root/cdk/kubeproxyconfig',)
- kube_cmd = "kubectl --kubeconfig=/root/cdk/kubeproxyconfig"
+ files = ('/root/cdk/kubeproxyconfig', '/etc/kubernetes')
+ if path.exists('/root/cdk/kubeproxyconfig'):
+ kube_cmd = "kubectl --kubeconfig=/root/cdk/kubeproxyconfig"
+ elif path.exists('/etc/kubernetes/admin.conf'):
+ kube_cmd = "kubectl --kubeconfig=/etc/kubernetes/admin.conf"
# vim: et ts=5 sw=4