kube-psp-advisor icon indicating copy to clipboard operation
kube-psp-advisor copied to clipboard

please consider adding --context support for specific cluster targeting.

Open caleyg opened this issue 5 years ago • 2 comments
trafficstars

Is your feature request related to a problem? Please describe. When running the inspect tool against a target cluster, without splitting my kubeconfig files into many, which there are many clusters. I must run a kubectl --context target_cluster_alias api-resources or something similar so that my current context session is set correctly. And then I can run my inspection normally against my target cluster using my default kubeconfig kubectl advise-psp inspect -n test_namespace -g with expected results.

Describe the solution you'd like The ability to use --context similar to how kubectl does.

caleyg avatar Oct 19 '20 21:10 caleyg

@caleyg thank you for the suggestion. I think that makes a lot sense and will add it soon.

Kaizhe avatar Oct 22 '20 18:10 Kaizhe

@caleyg

Usage:
  kube-psp-advisor inspect [flags]

Flags:
      --deny-by-default              (optional) OPA default rule: use this option if OPA default rule is Deny ALL
  -e, --exclude-namespaces strings   (optional) comma separated list of namespaces to exclude
  -g, --grant                        (optional) return with pod security policies, roles and rolebindings
  -h, --help                         help for inspect
      --kubeconfig string            (optional) absolute path to the kubeconfig file (default "/Users/Kaizhe/.kube/config")
  -n, --namespace string             (optional) namespace
  -p, --policy string                set policy type, valid policy types: psp and opa (default "psp")
  -r, --report                       (optional) return with detail report

Global Flags:
      --level string   Log level (default "info")

the --kubeconfig parameter should be able to help.

Kaizhe avatar Sep 23 '21 04:09 Kaizhe