Skip to content

Instantly share code, notes, and snippets.

@cmaster11
Created July 6, 2021 11:31
Show Gist options
  • Save cmaster11/dce11e4819c91751f74d26fd90e7d24e to your computer and use it in GitHub Desktop.
Save cmaster11/dce11e4819c91751f74d26fd90e7d24e to your computer and use it in GitHub Desktop.
Markdium-Restart Kubernetes deployments using HTTP requests
apiVersion: v1
kind: ServiceAccount
metadata:
name: restart-helper
---
# Allows the service account to:
#
# - Get namespaces.
# - Get/patch our deployments and statefulsets, to allow the
# "restart rollout" command to work.
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: restart-helper
rules:
- apiGroups: [ "" ]
resources: [ "namespaces" ]
verbs: [ "get" ]
- apiGroups: [ "apps", "extensions" ]
resources: [ "deployments", "statefulsets" ]
verbs: [ "get", "patch" ]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: restart-helper
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: restart-helper
subjects:
- kind: ServiceAccount
name: restart-helper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment