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
|
#!/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}')
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
apiVersion: policy/v1beta1
|
apiVersion: policy/v1beta1
|
||||||
kind: PodSecurityPolicy
|
kind: PodSecurityPolicy
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
||||||
|
|
@ -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"]
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
||||||
2
main.go
2
main.go
|
|
@ -1,3 +1,5 @@
|
||||||
|
// Copyright (C) 2019 Marius Schellenberger
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue