longhorn/uninstall/uninstall.yaml
Sheng Yang ffeac6836b Sync with manager:
commit 7d4c3fb00e259e98fe2fd8f9a69976e541884a9a
Author: Sheng Yang <sheng@yasker.org>
Date:   Sat May 18 11:57:06 2019 -0700

    Longhorn v0.5.0 release
2019-05-18 12:42:15 -07:00

67 lines
1.6 KiB
YAML

apiVersion: v1
kind: ServiceAccount
metadata:
name: longhorn-uninstall-service-account
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: longhorn-uninstall-role
rules:
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- "*"
- apiGroups: [""]
resources: ["pods", "persistentvolumes", "persistentvolumeclaims"]
verbs: ["*"]
- apiGroups: ["apps"]
resources: ["daemonsets", "statefulsets", "deployments"]
verbs: ["*"]
- apiGroups: ["batch"]
resources: ["jobs", "cronjobs"]
verbs: ["*"]
- apiGroups: ["longhorn.rancher.io"]
resources: ["volumes", "engines", "replicas", "settings", "engineimages", "nodes"]
verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: longhorn-uninstall-bind
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: longhorn-uninstall-role
subjects:
- kind: ServiceAccount
name: longhorn-uninstall-service-account
namespace: default
---
apiVersion: batch/v1
kind: Job
metadata:
name: longhorn-uninstall
spec:
activeDeadlineSeconds: 900
backoffLimit: 1
template:
metadata:
name: longhorn-uninstall
spec:
containers:
- name: longhorn-uninstall
image: rancher/longhorn-manager:v0.5.0
imagePullPolicy: Always
command:
- longhorn-manager
- uninstall
- --force
env:
- name: LONGHORN_NAMESPACE
value: longhorn-system
restartPolicy: OnFailure
serviceAccountName: longhorn-uninstall-service-account