added readme
This commit is contained in:
parent
5c5e8dcba1
commit
523fdec5ce
8 changed files with 22 additions and 7 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1 +1 @@
|
|||
env
|
||||
env.txt
|
||||
|
|
|
|||
11
README.md
Normal file
11
README.md
Normal 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
|
||||
```
|
||||
5
build.sh
5
build.sh
|
|
@ -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}')
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
---
|
||||
apiVersion: policy/v1beta1
|
||||
kind: PodSecurityPolicy
|
||||
metadata:
|
||||
|
|
|
|||
|
|
@ -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"]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
|
|
|
|||
2
main.go
2
main.go
|
|
@ -1,3 +1,5 @@
|
|||
// Copyright (C) 2019 Marius Schellenberger
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue