1

As per the documentation, monitoring is shipped with OKD.

OKD ships with a pre-configured and self-updating monitoring stack that is based on the Prometheus open source project and its wider eco-system. It provides monitoring of cluster components and ships with a set of alerts to immediately notify the cluster administrator about any occurring problems and a set of Grafana dashboards.

Further, as per the documentation, this command should show links for various monitoring tools. oc -n openshift-monitoring get routes

When I run the oc command with system user, I get a message as: No resources found.

The installation does not go through.

git clone https://github.com/openshift/cluster-monitoring-operator
cd cluster-monitoring-operator
oc apply -f manifests/

Error messages:

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"

So, how do we enable monitoring with minishift?

cogitoergosum
  • 2,309
  • 4
  • 38
  • 62

1 Answers1

0

You can follow this to install prometheus in minishift: https://github.com/minishift/minishift-addons/tree/master/add-ons/prometheus

Be sure that you login as admin. If you encounter problem to login as admin, you can follow these steps:

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 ~]$ exit

oc login -u admin -p admin

oc whoami

You will see you login as admin.

When I enter the command to apply the prometheus, I encountered this problem:

minishift addons apply prometheus --addon-env namespace=kube-system

-- Applying addon 'prometheus':.Error applying the add-on: Error executing command 'oc new-app -f prometheus.yaml -p NAMESPACE=#{namespace} -n #{namespace}'.

Solution:

  1. login Minishift as admin using "oc login -u admin -p admin".
  2. go to the namespace "kube-system" by "oc project kube-system".
  3. click on "Add to project" -> "import YAML/JSON".
  4. clone the prometheus addon in your local machine from https://github.com/minishift/minishift-addons.git
  5. import the ../minishift-addons/add-ons/prometheus/prometheus.yml into the "kube-system" namespace.

Afterwards, the prometheus will be deployed. You can access the prometheus graph UI: https://prometheus-kube-system.$minishift-host-ip-address.nip.io.