Skip to content

Commit

Permalink
Finish pod-rebalancer-v0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
norseto committed Dec 12, 2019
2 parents 91b8191 + 63554f6 commit ac709d3
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/work/microk8s/evicted-cleaner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
containers:
- name: evicted-cleaner
image: localhost:32000/norseto/evicted-cleaner:latest
imagePullPolicy: IfNotPresent
imagePullPolicy: Always
restartPolicy: OnFailure
activeDeadlineSeconds: 60
---
2 changes: 1 addition & 1 deletion .devcontainer/work/microk8s/pod-rebalancer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
containers:
- name: pod-rebalancer
image: localhost:32000/norseto/pod-rebalancer:latest
imagePullPolicy: IfNotPresent
imagePullPolicy: Always
restartPolicy: OnFailure
activeDeadlineSeconds: 60
---
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Delete a pod that is scheduled to be biased to a specific node.

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

### Limitation
Expand Down
2 changes: 1 addition & 1 deletion cmd/pod-rebalancer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func getCandidatePods(c *kubernetes.Clientset, ns string, nodes []v1.Node, rslis
continue
}
node := nodeMap[po.Spec.NodeName]
postat := podState{pod: &po, node: &node}
postat := podState{pod: po, node: node}
rstat, ok := rsmap[rs.ObjectMeta.UID]
if !ok {
rstat = &replicaState{replicaset: &rs, nodes: nodes}
Expand Down
6 changes: 3 additions & 3 deletions cmd/pod-rebalancer/rebalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ type replicaState struct {
}

type podState struct {
pod *v1.Pod
node *v1.Node
pod v1.Pod
node v1.Node
}

type rebalancer struct {
Expand Down Expand Up @@ -61,7 +61,7 @@ func (r *rebalancer) deleteNodePod(c *kubernetes.Clientset, node string) error {
for _, s := range r.current.podState {
if s.node.Name == node {
log.Debug("Deleting pod " + s.pod.Name + " in " + node)
return k8sutils.DeletePod(c, *s.pod)
return k8sutils.DeletePod(c, s.pod)
}
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion pod-rebalancer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
- amd64
containers:
- name: pod-rebalancer
image: docker.io/norseto/pod-rebalancer:0.1.0
image: docker.io/norseto/pod-rebalancer:0.1.1
imagePullPolicy: IfNotPresent
restartPolicy: OnFailure
activeDeadlineSeconds: 60
Expand Down

0 comments on commit ac709d3

Please sign in to comment.