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 available for x86_64 Linux and Windows platforms.
kubernetes plugin is included with the SolarWinds Snap Agent by default, please follow the directions below to enable it on a given host (each Kubernetes Master).
This plugin requires that the agent user
solarwinds 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 agent access to Kubernetes clusters (to the Kubernetes API). One method is to copy your
~/.kube folder to
$ cd /opt/SolarWinds/Snap/etc $ sudo cp -r ~/.kube . $ sudo chown -R solarwinds:solarwinds .kube
To check that the agent has access to the Kubernetes API, you can run the following command as the
solarwinds user, which retrieves the list of all pods in the current namespace:
$ sudo -u solarwinds kubectl get pods --kubeconfig /opt/SolarWinds/Snap/etc/.kube/config
- If the command does not execute successfully, ensure:
- both the symlinks and source files are owned by the solarwinds group and user.
- the configured kubeconfigpath is valid.
The 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/SolarWinds/Snap/etc/plugins.d/kubernetes.yaml.example, renaming it to
$ sudo cp /opt/SolarWinds/Snap/etc/plugins.d/kubernetes.yaml.example /opt/SolarWinds/Snap/etc/plugins.d/kubernetes.yaml
- Update the
/opt/SolarWinds/Snap/etc/plugins.d/kubernetes.yamlconfiguration file with settings specific to your Kubernetes deployment, for example:
collector: kubernetes: all: incluster: false kubeconfigpath: "/opt/SolarWinds/Snap/etc/.kube/config" interval: "60s" events: | # Embedded YAML (as a multiline string literal) filters: - namespace: default type: warning count: 2 - namespace: kube-system type: warning file: /var/log/SolarWinds/Snap/events.log
inclusterhas to be set to false unless when running as a pod or daemonset.
kubeconfigpatha valid path to Kubernetes config files (e.g. ~/.kube/config).
intervalsets time interval between subsequent metrics submissions (optional, defaults to
eventsenables Kubernetes Cluster Events collection (together with
filterssubfield). It’s an embedded YAML dictionary as string literal. It consists of:
filterslist of dictionaries that allows for events filtering based on equality check on following fields:
filespecifies filepath where the events will be written to, defaults to
- Restart the agent:
$ sudo service swisnapd 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.