added readme

This commit is contained in:
ston1th 2019-12-01 01:04:29 +01:00
commit 523fdec5ce
8 changed files with 22 additions and 7 deletions

2
.gitignore vendored
View file

@ -1 +1 @@
env env.txt

11
README.md Normal file
View file

@ -0,0 +1,11 @@
# pvc-reaper
The PersistentVolumeClaim Reaper cleans up `PersistentVolumes` created by Tekton Pipelines that are stuck in the `terminating` state.
# Build and run
```
echo KO_DOCKER_REPO='gcr.io/my-gcloud-project-name' >env.txt
./build.sh
```

View file

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
source env source env.txt
kubectl -n pvc-reaper delete deploy pvc-reaper
ko apply -f config/ ko apply -f config/
sleep 5 sleep 5
kubectl -n pvc-reaper logs -f $(kubectl -n pvc-reaper get pod -ojsonpath='{.items[*].metadata.name}') kubectl -n pvc-reaper logs -f $(kubectl -n pvc-reaper get pod -ojsonpath='{.items[0].metadata.name}')

View file

@ -1,3 +1,4 @@
---
apiVersion: v1 apiVersion: v1
kind: Namespace kind: Namespace
metadata: metadata:

View file

@ -1,3 +1,4 @@
---
apiVersion: policy/v1beta1 apiVersion: policy/v1beta1
kind: PodSecurityPolicy kind: PodSecurityPolicy
metadata: metadata:

View file

@ -1,3 +1,4 @@
---
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
@ -10,12 +11,9 @@ metadata:
name: pvc-reaper name: pvc-reaper
namespace: pvc-reaper namespace: pvc-reaper
rules: rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get"]
- apiGroups: [""] - apiGroups: [""]
resources: ["persistentvolumes", "persistentvolumeclaims"] resources: ["persistentvolumes", "persistentvolumeclaims"]
verbs: ["get", "list", "watch", "update", "patch", "delete"] verbs: ["get", "list", "watch", "patch"]
- apiGroups: ["policy"] - apiGroups: ["policy"]
resources: ["podsecuritypolicies"] resources: ["podsecuritypolicies"]
resourceNames: ["pvc-reaper"] resourceNames: ["pvc-reaper"]

View file

@ -1,3 +1,4 @@
---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:

View file

@ -1,3 +1,5 @@
// Copyright (C) 2019 Marius Schellenberger
package main package main
import ( import (