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
source env
source env.txt
kubectl -n pvc-reaper delete deploy pvc-reaper
ko apply -f config/
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
kind: Namespace
metadata:

View file

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

View file

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

View file

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

View file

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