longhorn/uninstall/uninstall.yaml
Sheng Yang fc04775b45 Sync with Longhorn manager
Author: Sheng Yang <sheng.yang@rancher.com>
Date:   Sat Feb 29 18:29:21 2020 -0800

    example: Explain the magic number of staleReplicaTimeout

    Signed-off-by: Sheng Yang <sheng.yang@rancher.com>

Signed-off-by: Sheng Yang <sheng.yang@rancher.com>
2020-02-29 18:42:08 -08:00

72 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: ["storage.k8s.io"]
resources: ["csidrivers"]
verbs: ["*"]
- apiGroups: ["longhorn.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.8.0-rc1
imagePullPolicy: Always
command:
- longhorn-manager
- uninstall
- --force
env:
- name: LONGHORN_NAMESPACE
value: longhorn-system
restartPolicy: OnFailure
serviceAccountName: longhorn-uninstall-service-account