Skip to content

Commit

Permalink
doc: k8s page (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
tenstad authored Dec 13, 2022
1 parent 00f202a commit 077e607
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions content/Developers_Handbook/Kubernetes/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Kubernetes
weight: 11
---

Kubectl alias (replace `<project>`, `<project>`, `<region>`, and `<namespace>`):

```bash
alias kprod='gcloud config set project <project>; gcloud container clusters get-credentials <project> --region <region>; kubectl config set-context --current --namespace=<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 `<vuln-to-search-for>`):

```bash
kubectl get vulnerabilityreports.aquasecurity.github.io -o json | jq -c .items[].report.vulnerabilities[] | grep <vuln-to-search-for> | jq -rc "[.resource,.installedVersion,.title]" | sort | uniq
```

Set node label (replace `<nodename>` and `<label>` (eg `app=static-rdf`)):

```bash
kubectl get nodes --show-labels
kubectl label nodes <nodename> <label>
```

0 comments on commit 077e607

Please sign in to comment.