---
apiVersion: v1
kind: ServiceAccount
metadata:
name: sa-api-account
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: deployment-role
rules:
- apiGroups: ["apps"]
resources: ["deployments"]
verbs: ["get", "update", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: sa-api-account-deployment-role-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: deployment-role
subjects:
- kind: ServiceAccount
name: sa-api-account
---
apiVersion: v1
kind: Secret
metadata:
name: sa-api-account-token
annotations:
kubernetes.io/service-account.name: sa-api-account
type: kubernetes.io/service-account-token