-
Print containers of a pod
oc get pod <pod_name> -o jsonpath='{.spec.containers[*].name}{"\n"}' | tr ' ' '\n'
-
IBM Chart repo URI
export ibm_entitled_charts=$(cloudctl catalog repos --json | jq '.[] | select(.name=="ibm-entitled-charts").URL')
-
Export secret without
--export
Insprired by https://stackoverflow.com/a/62002935/837530
With yq
oc -n <from-ns> get secret <name-of-secret> -o yaml | yq d - metadata | yq w - metadata.name <name-of-secret> | oc -n <to-ns> create -f -
with jq
oc -n <from-ns> get secret <name-of-secret> -o json | jq 'del(.metadata) | .metadata.name="<name-of-secret>"' | oc -n <to-ns> create -f -
-
Get names of resource by custom columns
oc get tr -o=custom-columns=':metadata.name'
Last active
December 1, 2021 15:16
-
-
Save saadlu/0bd2b8874efe48c23a08a86b64bb5a01 to your computer and use it in GitHub Desktop.
useful kubectl/oc jsonpaths
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment