Authorizing the data collector to access Kubernetes resources
To monitor applications that are running in IBM® Cloud Private, the service account that you use to configure the runtime data collector must have access to Kubernetes resources through Kubernetes API. Otherwise, you must authorize the service account with appropriate access before you configure the data collector.
About this task
The service account that you use to install and configure the data collector must have access to
Kubernetes resources. To determine whether the data collector has access to resources, you can use
this service account to run the following commands on the Kubernetes master
node:
kubectl auth can-i list nodes --all-namespaces --as system:serviceaccount:namespace:service_account_name
kubectl auth can-i get nodes --all-namespaces --as system:serviceaccount:namespace:service_account_name
kubectl auth can-i get pods --all-namespaces --as system:serviceaccount:namespace:service_account_name
kubectl auth can-i list services --all-namespaces --as system:serviceaccount:namespace:service_account_name
kubectl auth can-i get services --all-namespaces --as system:serviceaccount:namespace:service_account_name
kubectl auth can-i get configmaps --all-namespaces --as system:serviceaccount:namespace:service_account_name
kubectl auth can-i get deployments --all-namespaces --as system:serviceaccount:namespace:service_account_nameWhere
namespace is the namespace of your environment and
service_account_name is the name of the service account that you use to configure
the data collector. By default, the service_account_name is
default. You must change the namespace and
service_account_name with the values that you use.Tip: To
determine the existing service_account_name of a pod, you can run the command
kubectl get po my_pod_name -o yaml | grep serviceAccount, where
my_pod_name is the name of the running pod.
See the following
example:
kubectl auth can-i list nodes --all-namespaces --as system:serviceaccount:ops-am:default
kubectl auth can-i get nodes --all-namespaces --as system:serviceaccount:ops-am:default
kubectl auth can-i get pods --all-namespaces --as system:serviceaccount:ops-am:default
kubectl auth can-i list services --all-namespaces --as system:serviceaccount:ops-am:default
kubectl auth can-i get services --all-namespaces --as system:serviceaccount:ops-am:default
kubectl auth can-i get configmaps --all-namespaces --as system:serviceaccount:ops-am:default
kubectl auth can-i get deployments --all-namespaces --as system:serviceaccount:ops-am:defaultIf you get at least one response of the commands to be no, it means that you do
not have required permissions. Do the following steps to grant required service account that is
used to set up your application.