Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit cbbfcc4

Browse files
ericchiangdiegs
authored andcommitted
checkpointer: update image and drop permissions from ClusterRole to Role
The checkpointer now only watches pods in kube-system (#774), so it doesn't need cluster wide permissions.
1 parent 7f449aa commit cbbfcc4

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

cmd/checkpoint/README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,15 @@ Once it reaches the API server and finds out that it's no longer being scheduled
8888
### RBAC Requirements
8989

9090
By default, the pod checkpoint runs with service account credentials, checkpointing its own
91-
service account secret for reboots. That service account must be bound to a ClusterRole that
92-
lets the pod checkpoint watch for Pods with the checkpoint annotation, then save ConfigMaps and
93-
Secrets referenced by those Pods.
91+
service account secret for reboots. That service account must be bound to a Role that lets the
92+
pod checkpoint watch for Pods with the checkpoint annotation, then save ConfigMaps and Secrets
93+
referenced by those Pods.
9494

9595
```yaml
96-
kind: ClusterRole
96+
kind: Role
9797
metadata:
9898
name: pod-checkpointer
99+
namespace: kube-system
99100
rules:
100101
- apiGroups: [""] # "" indicates the core API group
101102
resources: ["pods"]
@@ -104,6 +105,3 @@ rules:
104105
resources: ["secrets", "configmaps"]
105106
verbs: ["get"]
106107
```
107-
108-
Currently the pod checkpoint watches all pods in all namespaces, and requires a ClusterRole and
109-
ClusterRoleBinding. In the future the pod checkpoint may be restricted to `kube-system`.

pkg/asset/images.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ var DefaultImages = ImageVersions{
1313
KubeDNS: "gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.5",
1414
KubeDNSMasq: "gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.5",
1515
KubeDNSSidecar: "gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.5",
16-
PodCheckpointer: "quay.io/coreos/pod-checkpointer:e22cc0e3714378de92f45326474874eb602ca0ac",
16+
PodCheckpointer: "quay.io/coreos/pod-checkpointer:08fa021813231323e121ecca7383cc64c4afe888",
1717
}

pkg/asset/internal/templates.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,11 @@ metadata:
332332
name: pod-checkpointer
333333
`)
334334

335-
// TODO: Drop checkpointer RBAC resources to a Role and RoleBinding if
336-
// the checkpoint switches to only watching kube-system.
337-
338335
var CheckpointerRole = []byte(`apiVersion: rbac.authorization.k8s.io/v1
339-
kind: ClusterRole
336+
kind: Role
340337
metadata:
341338
name: pod-checkpointer
339+
namespace: kube-system
342340
rules:
343341
- apiGroups: [""] # "" indicates the core API group
344342
resources: ["pods"]
@@ -349,12 +347,13 @@ rules:
349347
`)
350348

351349
var CheckpointerRoleBinding = []byte(`apiVersion: rbac.authorization.k8s.io/v1
352-
kind: ClusterRoleBinding
350+
kind: RoleBinding
353351
metadata:
354352
name: pod-checkpointer
353+
namespace: kube-system
355354
roleRef:
356355
apiGroup: rbac.authorization.k8s.io
357-
kind: ClusterRole
356+
kind: Role
358357
name: pod-checkpointer
359358
subjects:
360359
- kind: ServiceAccount

0 commit comments

Comments
 (0)