Skip to content

Commit

Permalink
Merged release branch
Browse files Browse the repository at this point in the history
  • Loading branch information
norseto committed Dec 10, 2019
2 parents 55c8ad5 + abf81aa commit 91b8191
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This CronJos cleans "Evicted" pods.

### Installation
```
kubectl apply -f https://github.com/norseto/k8s-watchdogs/releases/download/evicted-cleaner-v0.1.0/evicted-cleaner.yaml
kubectl apply -f https://github.com/norseto/k8s-watchdogs/releases/download/evicted-cleaner-v0.1.1/evicted-cleaner.yaml
```

## Pod Rebalancer
Expand Down
2 changes: 1 addition & 1 deletion cmd/evicted-cleaner/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.13.4-alpine3.10 as BUILD
FROM golang:1.13-alpine as BUILD

RUN mkdir -p /build
RUN mkdir /dist
Expand Down
10 changes: 1 addition & 9 deletions cmd/evicted-cleaner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func main() {

deleted := 0
for _, pod := range evicteds {
if err := deletePod(clientset, pod); err != nil {
if err := k8sutils.DeletePod(clientset, pod); err != nil {
log.Info(err)
} else {
deleted = deleted + 1
Expand All @@ -55,11 +55,3 @@ func isEvicted(pod v1.Pod) bool {
}
return false
}

// deletePod delete the pod
func deletePod(c *kubernetes.Clientset, pod v1.Pod) error {
if err := c.CoreV1().Pods(pod.Namespace).Delete(pod.Name, &metav1.DeleteOptions{}); err != nil {
return errors.Wrap(err, "failed to delete Pod: "+pod.Name)
}
return nil
}
2 changes: 1 addition & 1 deletion evicted-cleaner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spec:
- amd64
containers:
- name: evicted-cleaner
image: docker.io/norseto/evicted-cleaner:0.1.0
image: docker.io/norseto/evicted-cleaner:0.1.1
imagePullPolicy: IfNotPresent
restartPolicy: OnFailure
activeDeadlineSeconds: 60
Expand Down

0 comments on commit 91b8191

Please sign in to comment.