Implementation is agentless, all data is gathered from Kubernetes API & Kubernetes Metrics server API
Check if you have metrics-server installed
kubectl get pods -n kube-system
Create a lpar2rrd serviceaccount
$ kubectl create serviceaccount lpar2rrd
Create a clusterrole
Create file ClusterRole.yml with this content:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: lpar2rrd
rules:
- apiGroups: ["","metrics.k8s.io"]
resources: ["pods","nodes","services","nodes/proxy", "endpoints", "namespaces"]
verbs: ["get", "watch", "list"]
- nonResourceURLs: ["/metrics"]
verbs: ["get"]
Apply it by:
$ kubectl apply -f ClusterRole.yml
Create a clusterrolebinding
Create file ClusterRoleBinding.yml with this content:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: lpar2rrd
subjects:
- kind: ServiceAccount
name: lpar2rrd
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: lpar2rrd
Make sure it is the same namespace as the serviceaccount like
default above.
Apply it by:
$ kubectl apply -f ClusterRoleBinding.yml
Get lpar2rrd token
Create file Lpar2rrdSecret.yml with this content:
apiVersion: v1
kind: Secret
metadata:
name: lpar2rrd-token
annotations:
kubernetes.io/service-account.name: lpar2rrd
type: kubernetes.io/service-account-token
Apply it by:
$ kubectl apply -f Lpar2rrdSecret.yml
Get lpar2rrd token:
$ kubectl describe secret lpar2rrd-token
Get cluster endpoint
$ kubectl config view
Configure Kubernetes in LPAR2RRD
-
LPAR2RRD UI ➡ Settings icon ➡ Kubernetes ➡ New
- Make sure cron job for Kubernetes is in place (upgrade script might do it for you automatically)
Skip this step if you install the Virtual Appliance - it is already taken care of.
$ crontab -l | grep "load_kubernetes.sh"
$
Add following lines to crontab if necessary
$ crontab -e
# Kubernetes support
0,20,40 * * * * /home/lpar2rrd/lpar2rrd/load_kubernetes.sh > /home/lpar2rrd/lpar2rrd/load_kubernetes.out 2>&1
- Wait 30 minutes and then go to the web UI: http://<your web server>/lpar2rrd/
Use Ctrl-F5 to refresh the web browser cache.