From 077e607a76989d0e9882095eef4abf76f7b8b94f Mon Sep 17 00:00:00 2001 From: Amund Tenstad Date: Tue, 13 Dec 2022 09:08:13 +0100 Subject: [PATCH] doc: k8s page (#96) --- .../Developers_Handbook/Kubernetes/_index.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 content/Developers_Handbook/Kubernetes/_index.md diff --git a/content/Developers_Handbook/Kubernetes/_index.md b/content/Developers_Handbook/Kubernetes/_index.md new file mode 100644 index 0000000..c7cd6c9 --- /dev/null +++ b/content/Developers_Handbook/Kubernetes/_index.md @@ -0,0 +1,29 @@ +--- +title: Kubernetes +weight: 11 +--- + +Kubectl alias (replace ``, ``, ``, and ``): + +```bash +alias kprod='gcloud config set project ; gcloud container clusters get-credentials --region ; kubectl config set-context --current --namespace=' +``` + +Delete all Trivy vulnerability reports: + +```bash +kubectl get vulnerabilityreports.aquasecurity.github.io | awk '{print $1}' | xargs kubectl delete vulnerabilityreports.aquasecurity.github.io +``` + +Search for specific vulnerability (replace ``): + +```bash +kubectl get vulnerabilityreports.aquasecurity.github.io -o json | jq -c .items[].report.vulnerabilities[] | grep | jq -rc "[.resource,.installedVersion,.title]" | sort | uniq +``` + +Set node label (replace `` and `