Container
apiVersion: v1 kind: ServiceAccount metadata: name: xormon namespace: default
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: xormon rules: - apiGroups: ["","metrics.k8s.io","apps","config.openshift.io","machine.openshift.io","machineconfiguration.openshift.io","monitoring.coreos.com","project.openshift.io","route.openshift.io","storage.k8s.io"] resources: ["*"] verbs: ["get", "watch", "list"] - nonResourceURLs: ["/metrics"] verbs: ["get"]
$ kubectl create serviceaccount xormon
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: xormon rules: - apiGroups: ["","metrics.k8s.io","apps","config.openshift.io","machine.openshift.io","machineconfiguration.openshift.io","monitoring.coreos.com","project.openshift.io","route.openshift.io","storage.k8s.io"] resources: ["*"] verbs: ["get", "watch", "list"] - nonResourceURLs: ["/metrics"] verbs: ["get"]Apply it by:
$ kubectl apply -f ClusterRole.yml
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: xormon subjects: - kind: ServiceAccount name: xormon namespace: default roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: xormonApply it by:
$ kubectl apply -f ClusterRoleBinding.yml
$ kubectl get serviceaccounts xormon -o yaml
$ kubectl describe secret xormon-token-fkkxp
$ kubectl config view
docker pull xorux/lpar2rrd-docker-agent
docker run --init -d --hostname $(hostname) --name lpar2rrd-docker-agent -v /var/run/docker.sock:/var/run/docker.sock:ro --env XORMON=<XorMon-NG_hostname/IP> xorux/lpar2rrd-docker-agent
kubectl get pods -n kube-system
$ kubectl create serviceaccount xormon
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: xormon 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
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: xormon subjects: - kind: ServiceAccount name: xormon namespace: default roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: xormonMake sure it is the same namespace as the serviceaccount like default above.
$ kubectl apply -f ClusterRoleBinding.yml
apiVersion: v1 kind: Secret metadata: name: xormon-token annotations: kubernetes.io/service-account.name: xormon type: kubernetes.io/service-account-tokenApply it by:
$ kubectl apply -f Lpar2rrdSecret.ymlGet xormon token:
$ kubectl describe secret xormon-token
$ kubectl config view