feat(cadvisor): add support for basic auth#758
feat(cadvisor): add support for basic auth#758pdesgarets wants to merge 1 commit intoprometheus-community:mainfrom
Conversation
Docs Build 📝Thank you for contributing!✨ The docs for this PR have been published here: You can compare to the docs for the The docsite for this PR is also available for download as an artifact from this run: File changes: Click to see the diff comparison.NOTE: only file modifications are shown here. New and deleted files are excluded. diff --git a/home/runner/work/ansible/ansible/docsbuild/base/cadvisor_role.html b/home/runner/work/ansible/ansible/docsbuild/head/cadvisor_role.html
index a5aba2d..689f3a2 100644
--- a/home/runner/work/ansible/ansible/docsbuild/base/cadvisor_role.html
+++ b/home/runner/work/ansible/ansible/docsbuild/head/cadvisor_role.html
@@ -178,6 +178,15 @@ To check whether it is installed, run <code class="code docutils literal notrans
</thead>
<tbody>
<tr class="row-even"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-main--cadvisor_basic_auth_users"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-cadvisor-role-parameter-main-cadvisor-basic-auth-users"><strong>cadvisor_basic_auth_users</strong></p>
+<a class="ansibleOptionLink" href="#parameter-main--cadvisor_basic_auth_users" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">dictionary</span></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>Dictionary of username / password for HTTP basic authentication</p>
+<p>Warning : The endpoints `/api/*` and `/metrics` are exposed without authentication. See <a class="reference external" href="https://github.com/google/cadvisor/blob/master/docs/web.md#web-ui-authentication">https://github.com/google/cadvisor/blob/master/docs/web.md#web-ui-authentication</a> and <a class="reference external" href="https://github.com/google/cadvisor/issues/3401">https://github.com/google/cadvisor/issues/3401</a> for more details.</p>
+<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">{}</span></code></p>
+</div></td>
+</tr>
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-main--cadvisor_binary_install_dir"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-cadvisor-role-parameter-main-cadvisor-binary-install-dir"><strong>cadvisor_binary_install_dir</strong></p>
<a class="ansibleOptionLink" href="#parameter-main--cadvisor_binary_install_dir" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -186,7 +195,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">"/usr/local/bin"</span></code></p>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-main--cadvisor_binary_url"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-cadvisor-role-parameter-main-cadvisor-binary-url"><strong>cadvisor_binary_url</strong></p>
<a class="ansibleOptionLink" href="#parameter-main--cadvisor_binary_url" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -194,6 +203,14 @@ To check whether it is installed, run <code class="code docutils literal notrans
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">"https://github.com/{{</span> <span class="pre">_cadvisor_repo</span> <span class="pre">}}/releases/download/v{{</span> <span class="pre">cadvisor_version</span> <span class="pre">}}/cadvisor-v{{</span> <span class="pre">cadvisor_version</span> <span class="pre">}}-{{</span> <span class="pre">ansible_facts['system']</span> <span class="pre">|</span> <span class="pre">lower</span> <span class="pre">}}-{{</span> <span class="pre">_cadvisor_go_ansible_arch</span> <span class="pre">}}"</span></code></p>
</div></td>
</tr>
+<tr class="row-odd"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-main--cadvisor_config_dir"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-cadvisor-role-parameter-main-cadvisor-config-dir"><strong>cadvisor_config_dir</strong></p>
+<a class="ansibleOptionLink" href="#parameter-main--cadvisor_config_dir" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>Directory for cAdvisor configuration files</p>
+<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">"/etc/cadvisor"</span></code></p>
+</div></td>
+</tr>
<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-main--cadvisor_disable_metrics"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-cadvisor-role-parameter-main-cadvisor-disable-metrics"><strong>cadvisor_disable_metrics</strong></p>
<a class="ansibleOptionLink" href="#parameter-main--cadvisor_disable_metrics" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">list</span> / <span class="ansible-option-elements">elements=string</span></p>
|
SuperQ
left a comment
There was a problem hiding this comment.
Nice, would you mind adding a basic auth user and test to roles/cadvisor/molecule/alternative/molecule.yml and roles/cadvisor/molecule/alternative/tests/test_alternative.py?
gardar
left a comment
There was a problem hiding this comment.
Thanks, looks good, just need to make sure the tasks are tagged for those that want to be able to skip or only run the config tasks.
And perhaps it would be worth noting in the argument specs that unlike the other exporters the basic auth does not secure the /metrics endpoint google/cadvisor#3401
😭 description:
- "Dictionary of username / password for HTTP basic authentication"
- >-
Warning : The endpoints `/api/*` and `/metrics` are exposed without authentication. See https://github.com/google/cadvisor/blob/master/docs/web.md#web-ui-authentication and https://github.com/google/cadvisor/issues/3401 for more details. |
Yep, kind of defeating the purpose IMHO 😞 But yeah that looks fine. |
|
Can you please rebase ? |
Signed-off-by: Paul des Garets <pdesgarets@users.noreply.github.com>
Configure basic auth for CAdvisor with appropriate runtime options