Difference between revisions of "Export POD NAME"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Tags: Mobile web edit, Mobile edit
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{lc}}
 
{{lc}}
  
 +
 +
 +
 +
== Example with errors: Unable to find "/v1, Resource=pods" that match [[label selector]] ==
 
<pre>
 
<pre>
 
export POD_NAME=$(kubectl get pods -n default -l "app.kubernetes.io/name=kubernetes- dashboard,app.kubernetes.io/instance=my-release" -o jsonpath="{.items[0].metadata.name}")
 
export POD_NAME=$(kubectl get pods -n default -l "app.kubernetes.io/name=kubernetes- dashboard,app.kubernetes.io/instance=my-release" -o jsonpath="{.items[0].metadata.name}")
Line 13: Line 17:
 
== Related ==
 
== Related ==
 
* <code>[[helm install my-release kubernetes-dashboard/kubernetes-dashboard]]</code>
 
* <code>[[helm install my-release kubernetes-dashboard/kubernetes-dashboard]]</code>
 +
* <code>[[kubectl get pods]]</code>
  
 +
== See also ==
 +
* {{Kubernetes dashboard}}
  
 
+
[[Category:K8s]]
== See also ==
 
* [[Kubernetes dashboard]]
 

Latest revision as of 18:59, 11 June 2022



Example with errors: Unable to find "/v1, Resource=pods" that match label selector[edit]

export POD_NAME=$(kubectl get pods -n default -l "app.kubernetes.io/name=kubernetes- dashboard,app.kubernetes.io/instance=my-release" -o jsonpath="{.items[0].metadata.name}")
Error from server (BadRequest): Unable to find "/v1, Resource=pods" that match label selector "app.kubernetes.io/name=kubernetes- dashboard,app.kubernetes.io/instance=my-release", field selector "": unable to parse requirement: values[0][app.kubernetes.io/name]: Invalid value: "kubernetes-": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue',  or 'my_value',  or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')
error executing jsonpath "{.items[0].metadata.name}": Error executing template: array index out of bounds: index 0, length 0. Printing more information for debugging the template:
	template was:
		{.items[0].metadata.name}
	object given to jsonpath engine was:
		map[string]interface {}{"apiVersion":"v1", "items":[]interface {}{}, "kind":"List", "metadata":map[string]interface {}{"resourceVersion":""}}

Related[edit]

See also[edit]

Advertising: