<h2>Kubernetes Discovery fails with error 401 - Invalid username/password combo</h2><br/><div style="overflow-x:auto"><article><div ><h3 >Description</h3><section><ul style="list-style-position: inside;"><li>During the Kubernetes discovery, the resources like namespace, service, pods throw the below error in the pattern log, though the Curl command provides the expected output using the bearer token.</li></ul> <pre style="padding-left: 40px;">Response has error. Status code is 401 . error code: 3 . error message: Method failed: (/api/v1/namespaces) with code: 401 - Invalid username/password combo<br />HTTP response: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Unauthorized","reason":"Unauthorized","code":401}<br />setAttribute(response,[{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Unauthorized","reason":"Unauthorized","code":401</pre></section></div><div ><h3 >Release or Environment</h3><section><ul style="list-style-position: inside;"><li>Instance with Discovery and Service Mapping Patterns plugin with version 1.0.53+</li></ul></section></div><div ><h3 >Cause</h3><section><ul style="list-style-position: inside;"><li>The credential configured for Kubernetes discovery will have both "User name/Password" and "Bearer Token" combo.</li></ul> <p style="padding-left: 40px;"><img style="align: baseline;" src="sys_attachment.do?sys_id=acd375cd93d95210101833527cba1031" width="1050" height="450" align="baseline" /></p></section></div><div ><h3 >Resolution</h3><section><ul style="list-style-position: inside;"><li>In general, we require either "User name/Password" or "Bearer Token" and not the both.</li><li>Either empty the "User name" field or "Bearer Token" field to resolve the issue. </li></ul></section></div><div ><h3 >Additional Information</h3><section><ul style="list-style-position: inside;"><li>Refer <a title="Kubernetes discovery" href="https://docs.servicenow.com/csh?topicname=kubernetes-discovery.html&version=latest" target="_blank" rel="noopener noreferrer">Kubernetes discovery</a> document for more insights.</li></ul> <div> </div></section></div></article></div>