longhorn/uninstall/uninstall.yaml
Sheng Yang 1d2b339fc2 Sync with Longhorn manager
commit 30e9e775c0e70e91fb306fd0ef2b556508be5e2e
Author: Sheng Yang <sheng.yang@rancher.com>
Date:   Mon Oct 7 17:15:09 2019 -0700

    Longhorn v0.6.2-rc1 release

Signed-off-by: Sheng Yang <sheng.yang@rancher.com>
2019-10-07 17:26:01 -07:00

69 lines
1.7 KiB
YAML

apiVersion: v1
kind: ServiceAccount
metadata:
name: longhorn-uninstall-service-account
namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: longhorn-uninstall-role
rules:
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- "*"
- apiGroups: [""]
resources: ["pods", "persistentvolumes", "persistentvolumeclaims", "nodes"]
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", "instancemanagers"]
verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1
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
namespace: default
spec:
activeDeadlineSeconds: 900
backoffLimit: 1
template:
metadata:
name: longhorn-uninstall
spec:
containers:
- name: longhorn-uninstall
image: longhornio/longhorn-manager:v0.6.2-rc1
imagePullPolicy: Always
command:
- longhorn-manager
- uninstall
- --force
env:
- name: LONGHORN_NAMESPACE
value: longhorn-system
restartPolicy: OnFailure
serviceAccountName: longhorn-uninstall-service-account