This plugin collects runtime metrics from Kubernetes masters and nodes within its cluster. It gathers information about resource usage and performance characteristics.
This plugin is currently only available for x86_64 Linux.
kubernetes plugin is included with the AppOptics host agent by default, please follow the directions below to enable it on a given host (each Kubernetes Master).
This plugin requires that the host agent user
appoptics has access to a valid kubeconfig and kube-apiserver.
A kubeconfig file is used to configure access to Kubernetes clusters and is commonly found in
~/.kube/config. kubeconfig is a generic way of referring to the Kubernetes configuration files.
There are different ways to give the host agent access to Kubernetes clusters (to the Kubernetes API). One method is to copy your
~/.kube folder to
$ cd /opt/appoptics/etc $ sudo cp -r ~/.kube . $ sudo chown -R appoptics:appoptics .kube
To check that the host agent has access to the Kubernetes API, you can run the following command as the
appoptics user, which retrieves the list of all pods in the current namespace:
$ sudo -u appoptics kubectl get pods --kubeconfig /opt/appoptics/etc/.kube/config
- If the command does not execute successfully, ensure:
- both the symlinks and source files are owned by the appoptics group and user.
- the configured kubeconfigpath is valid.
The host agent provides an example configuration file to help you get started quickly. It defines the plugin and task file to be loaded by the agent, but requires you to provide the correct settings for your Kubernetes deployment. To enable the plugin:
- Make a copy of the kubernetes example configuration file
/opt/appoptics/etc/plugins.d/kubernetes.yaml.example, renaming it to
$ sudo cp /opt/appoptics/etc/plugins.d/kubernetes.yaml.example /opt/appoptics/etc/plugins.d/kubernetes.yaml
- Update the
/opt/appoptics/etc/plugins.d/kubernetes.yamlconfiguration file with settings specific to your Kubernetes deployment, for example:
collector: kubernetes: all: incluster: false kubeconfigpath: "/opt/appoptics/etc/.kube/config"
inclustermust be set to false (set to true only when running as a pod or daemonset).
kubeconfigpatha valid path to Kubernetes config files (e.g. ~/.kube/config).
- Restart the host agent:
$ sudo service appoptics-snapteld restart
Enable the Kubernetes plugin in the AppOptics UI
Select the Kubernetes plugin to open the configuration menu in the UI, and enable the plugin.
You should soon see the
kubernetesmetrics reported to your dashboard.