根据documentation,OKD附带了监视功能。
OKD附带了基于Prometheus开源项目及其更广泛的生态系统的预配置和自我更新的监视堆栈。它提供了对群集组件的监视功能,并附带了一组警报,可将任何出现的问题立即通知群集管理员,并提供一组Grafana仪表板。
此外,根据documentation,此命令应显示各种监视工具的链接。 oc -n openshift-monitoring get routes
当我与oc
用户一起运行system
命令时,收到如下消息:No resources found.
安装无法完成。
git clone https://github.com/openshift/cluster-monitoring-operator
cd cluster-monitoring-operator
oc apply -f manifests/
错误消息:
namespace "openshift-monitoring" created
serviceaccount "cluster-monitoring-operator" created
unable to decode "manifests/0000_50_cluster_monitoring_operator_02-role.yaml": no kind "ClusterRole" is registered for version "rbac.authorization.k8s.io/v1beta1"
unable to decode "manifests/0000_50_cluster_monitoring_operator_03-role-binding.yaml": no kind "ClusterRoleBinding" is registered for version "rbac.authorization.k8s.io/v1beta1"
unable to decode "manifests/0000_50_cluster_monitoring_operator_04-deployment.yaml": no kind "Deployment" is registered for version "apps/v1"
unable to decode "manifests/0000_50_cluster_monitoring_operator_05-clusteroperator.yaml": no kind "ClusterOperator" is registered for version "config.openshift.io/v1"
unable to decode "manifests/0000_90_cluster_monitoring_operator_00-operatorgroup.yaml": no kind "OperatorGroup" is registered for version "operators.coreos.com/v1"
那么,如何使用minishift
启用监视?
答案 0 :(得分:0)
您可以按照以下步骤在 minishift 中安装 prometheus: https://github.com/minishift/minishift-addons/tree/master/add-ons/prometheus
请确保您以管理员身份登录。如果您在以管理员身份登录时遇到问题,您可以按照以下步骤操作:
minishift ssh
[docker@example ~]$ sudo su
[root@example ~]# export KUBECONFIG=/var/lib/minishift/base/openshift-apiserver/admin.kubeconfig PATH="$PATH:/var/lib/minishift/bin"
[root@example ~]# oc adm policy add-cluster-role-to-user cluster-admin admin
[root@example ~]# exit
[docker@example ~]$ 退出
oc 登录 -u admin -p admin
oc whoami
您将看到您以管理员身份登录。
当我输入命令应用prometheus时,遇到了这个问题:
minishift 插件应用 prometheus --addon-env namespace=kube-system
-- 应用插件'prometheus':.错误应用插件:错误执行命令'oc new-app -f prometheus.yaml -p NAMESPACE=#{namespace} -n #{namespace}'。>
解决方案:
之后,将部署普罗米修斯。 您可以访问 prometheus 图 UI:https://prometheus-kube-system.$minishift-host-ip-address.nip.io。