apiVersion: v1
kind: ServiceAccount
metadata:
  namespace: kube-system
  name: ecr-renew
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: ecr-renew
rules:
  - apiGroups: [""]
    resources: ["secrets"]
    verbs: ["create", "update", "get", "delete"]
  - apiGroups: [""]
    resources: ["namespaces"]
    verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  namespace: kube-system
  name: ecr-renew
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: ecr-renew
subjects:
  - kind: ServiceAccount
    name: ecr-renew
    namespace: kube-system
