{"id":379,"date":"2022-01-01T18:33:21","date_gmt":"2022-01-01T17:33:21","guid":{"rendered":"http:\/\/daisy-street.fr\/?p=379"},"modified":"2022-01-06T01:03:09","modified_gmt":"2022-01-06T00:03:09","slug":"monitoring","status":"publish","type":"post","link":"https:\/\/daisy-street.fr\/index.php\/2022\/01\/01\/monitoring\/","title":{"rendered":"Monitoring"},"content":{"rendered":"\n<p>Installer Helm<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>helm repo add prometheus-community https:\/\/prometheus-community.github.io\/helm-charts\nhelm repo update\n\nkubectl delete namespace monitoring\nkubectl delete crd alertmanagerconfigs.monitoring.coreos.com\nkubectl delete crd alertmanagers.monitoring.coreos.com\nkubectl delete crd podmonitors.monitoring.coreos.com\nkubectl delete crd probes.monitoring.coreos.com\nkubectl delete crd prometheuses.monitoring.coreos.com\nkubectl delete crd prometheusrules.monitoring.coreos.com\nkubectl delete crd servicemonitors.monitoring.coreos.com\nkubectl delete crd thanosrulers.monitoring.coreos.com\n\nkubectl create namespace monitoring\nhelm install kube-prometheus-stack prometheus-community\/kube-prometheus-stack -n monitoring --debug --set prometheusOperator.admissionWebhooks.enabled=false --set prometheusOperator.tls.enabled=false<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Grafana<\/h3>\n\n\n\n<p>Recupere le user et mdp pour grafana<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo kubectl get secret --namespace monitoring prometheus-grafana -o yaml<\/code><\/pre>\n\n\n\n<p>Ajouter un service loadbalancer pour acces via lan<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: v1\nkind: Service\nmetadata:\n  name: grafana-web-service\n  namespace: monitoring  \nspec:\n  selector:\n    app: kube-prometheus-stack-grafana\n  ports:\n    - name: web\n      protocol: TCP\n      port: 80\n      targetPort: 80\n  type: LoadBalancer<\/code><\/pre>\n\n\n\n<p>If you are using&nbsp;<strong>Prometheus Operator<\/strong>&nbsp;then user\/pass is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>user: admin\npass: prom-operator<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Erreur<\/h3>\n\n\n\n<p>J&#8217;ai eu l&#8217;erreur<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Error: INSTALLATION FAILED: Kubernetes cluster unreachable: Get \"http:\/\/localhost:8080\/version?timeout=32s\": dial tcp &#91;::1]:8080: connect: connection refused\n<\/code><\/pre>\n\n\n\n<p>pour la coriger il faut que le user ai le parametre de  kube dans son home , pour ce faire :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl config view --raw &gt; ~\/.kube\/config\nchmod go-r ~\/.kube\/config\n\n<\/code><\/pre>\n\n\n\n<p>ce qui creera un fichier config tel que :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: v1\nclusters:\n- cluster:\n    certificate-authority-data: ---certif---\n    server: https:\/\/---ip---:---port---\n  name: microk8s-cluster\ncontexts:\n- context:\n    cluster: microk8s-cluster\n    user: ---nomuser---\n  name: microk8s\ncurrent-context: microk8s\nkind: Config\npreferences: {}\nusers:\n- name: ---nomuser---\n  user:\n    token: ---token---\n<\/code><\/pre>\n\n\n\n<p>source : <\/p>\n\n\n\n<p><a href=\"https:\/\/stash.run\/docs\/v2021.6.18\/guides\/latest\/monitoring\/prometheus_operator\/\">https:\/\/stash.run\/docs\/v2021.6.18\/guides\/latest\/monitoring\/prometheus_operator\/<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Setup Prometheus Monitoring on Kubernetes using Helm and Prometheus Operator | Part 1\" width=\"525\" height=\"295\" src=\"https:\/\/www.youtube.com\/embed\/QoDqxm7ybLc?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Installer Helm Grafana Recupere le user et mdp pour grafana Ajouter un service loadbalancer pour acces via lan If you are using&nbsp;Prometheus Operator&nbsp;then user\/pass is: Erreur J&#8217;ai eu l&#8217;erreur pour la coriger il faut que le user ai le parametre de kube dans son home , pour ce faire : ce qui creera un fichier &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/daisy-street.fr\/index.php\/2022\/01\/01\/monitoring\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Monitoring&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ub_ctt_via":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[1],"tags":[55,56,33,58,59,57],"class_list":["post-379","post","type-post","status-publish","format-standard","hentry","category-non-classe","tag-grafana","tag-helm","tag-kubernetes","tag-monitoring","tag-operator","tag-prometheus"],"jetpack_publicize_connections":[],"featured_image_src":null,"author_info":{"display_name":"admin9483","author_link":"https:\/\/daisy-street.fr\/index.php\/author\/admin9483\/"},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/posts\/379","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/comments?post=379"}],"version-history":[{"count":12,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/posts\/379\/revisions"}],"predecessor-version":[{"id":484,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/posts\/379\/revisions\/484"}],"wp:attachment":[{"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/media?parent=379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/categories?post=379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/tags?post=379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}