2022-10-11 05:21:30 +00:00
|
|
|
#apiVersion: policy/v1beta1
|
|
|
|
#kind: PodSecurityPolicy
|
|
|
|
#metadata:
|
|
|
|
# name: longhorn-uninstall-psp
|
|
|
|
#spec:
|
|
|
|
# privileged: true
|
|
|
|
# allowPrivilegeEscalation: true
|
|
|
|
# requiredDropCapabilities:
|
|
|
|
# - NET_RAW
|
|
|
|
# allowedCapabilities:
|
|
|
|
# - SYS_ADMIN
|
|
|
|
# hostNetwork: false
|
|
|
|
# hostIPC: false
|
|
|
|
# hostPID: true
|
|
|
|
# runAsUser:
|
|
|
|
# rule: RunAsAny
|
|
|
|
# seLinux:
|
|
|
|
# rule: RunAsAny
|
|
|
|
# fsGroup:
|
|
|
|
# rule: RunAsAny
|
|
|
|
# supplementalGroups:
|
|
|
|
# rule: RunAsAny
|
|
|
|
# volumes:
|
|
|
|
# - configMap
|
|
|
|
# - downwardAPI
|
|
|
|
# - emptyDir
|
|
|
|
# - secret
|
|
|
|
# - projected
|
|
|
|
# - hostPath
|
|
|
|
#---
|
2019-05-14 16:01:32 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: ServiceAccount
|
|
|
|
metadata:
|
|
|
|
name: longhorn-uninstall-service-account
|
2022-10-11 05:21:30 +00:00
|
|
|
namespace: longhorn-system
|
2019-05-14 16:01:32 +00:00
|
|
|
---
|
2019-09-21 21:39:49 +00:00
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
2019-05-14 16:01:32 +00:00
|
|
|
kind: ClusterRole
|
|
|
|
metadata:
|
|
|
|
name: longhorn-uninstall-role
|
|
|
|
rules:
|
|
|
|
- apiGroups:
|
|
|
|
- apiextensions.k8s.io
|
|
|
|
resources:
|
|
|
|
- customresourcedefinitions
|
|
|
|
verbs:
|
|
|
|
- "*"
|
|
|
|
- apiGroups: [""]
|
2020-12-15 04:07:24 +00:00
|
|
|
resources: ["pods", "persistentvolumes", "persistentvolumeclaims", "nodes", "configmaps", "secrets", "services", "endpoints"]
|
2019-05-14 16:01:32 +00:00
|
|
|
verbs: ["*"]
|
|
|
|
- apiGroups: ["apps"]
|
|
|
|
resources: ["daemonsets", "statefulsets", "deployments"]
|
|
|
|
verbs: ["*"]
|
|
|
|
- apiGroups: ["batch"]
|
|
|
|
resources: ["jobs", "cronjobs"]
|
|
|
|
verbs: ["*"]
|
2020-12-06 18:27:46 +00:00
|
|
|
- apiGroups: ["policy"]
|
|
|
|
resources: ["poddisruptionbudgets"]
|
|
|
|
verbs: ["*"]
|
2020-07-11 00:39:23 +00:00
|
|
|
- apiGroups: ["scheduling.k8s.io"]
|
|
|
|
resources: ["priorityclasses"]
|
|
|
|
verbs: ["watch", "list"]
|
2019-11-08 06:37:50 +00:00
|
|
|
- apiGroups: ["storage.k8s.io"]
|
2022-08-11 18:19:47 +00:00
|
|
|
resources: ["csidrivers", "storageclasses", "volumeattachments"]
|
2019-11-08 06:37:50 +00:00
|
|
|
verbs: ["*"]
|
|
|
|
- apiGroups: ["longhorn.io"]
|
2022-05-17 01:51:57 +00:00
|
|
|
resources: ["volumes", "engines", "replicas", "settings", "engineimages", "nodes", "instancemanagers", "sharemanagers",
|
|
|
|
"backingimages", "backingimagemanagers", "backingimagedatasources", "backuptargets", "backupvolumes", "backups",
|
2023-06-27 04:08:49 +00:00
|
|
|
"recurringjobs", "orphans", "snapshots", "supportbundles", "systembackups", "systemrestores", "volumeattachments"]
|
2019-05-14 16:01:32 +00:00
|
|
|
verbs: ["*"]
|
2020-12-06 18:27:46 +00:00
|
|
|
- apiGroups: ["coordination.k8s.io"]
|
|
|
|
resources: ["leases"]
|
|
|
|
verbs: ["*"]
|
2022-10-11 05:21:30 +00:00
|
|
|
# - apiGroups: ["policy"]
|
|
|
|
# resources: ["podsecuritypolicies"]
|
|
|
|
# verbs: ["use"]
|
|
|
|
# resourceNames: ["longhorn-uninstall-psp"]
|
2022-03-28 11:05:25 +00:00
|
|
|
- apiGroups: ["admissionregistration.k8s.io"]
|
|
|
|
resources: ["mutatingwebhookconfigurations", "validatingwebhookconfigurations"]
|
|
|
|
verbs: ["get", "delete"]
|
2019-05-14 16:01:32 +00:00
|
|
|
---
|
2019-09-21 21:39:49 +00:00
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
2019-05-14 16:01:32 +00:00
|
|
|
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
|
2022-10-11 05:21:30 +00:00
|
|
|
namespace: longhorn-system
|
2019-05-14 16:01:32 +00:00
|
|
|
---
|
2019-01-11 19:08:02 +00:00
|
|
|
apiVersion: batch/v1
|
|
|
|
kind: Job
|
|
|
|
metadata:
|
|
|
|
name: longhorn-uninstall
|
2022-10-11 05:21:30 +00:00
|
|
|
namespace: longhorn-system
|
2019-01-11 19:08:02 +00:00
|
|
|
spec:
|
|
|
|
activeDeadlineSeconds: 900
|
|
|
|
backoffLimit: 1
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
name: longhorn-uninstall
|
|
|
|
spec:
|
|
|
|
containers:
|
2022-10-11 05:21:30 +00:00
|
|
|
- name: longhorn-uninstall
|
|
|
|
image: longhornio/longhorn-manager:master-head
|
|
|
|
imagePullPolicy: IfNotPresent
|
|
|
|
command:
|
|
|
|
- longhorn-manager
|
|
|
|
- uninstall
|
|
|
|
- --force
|
|
|
|
env:
|
|
|
|
- name: LONGHORN_NAMESPACE
|
|
|
|
value: longhorn-system
|
2022-11-02 05:22:04 +00:00
|
|
|
restartPolicy: Never
|
2019-05-14 16:01:32 +00:00
|
|
|
serviceAccountName: longhorn-uninstall-service-account
|
2021-04-20 16:30:52 +00:00
|
|
|
# imagePullSecrets:
|
|
|
|
# - name: ""
|
|
|
|
# priorityClassName:
|
|
|
|
# tolerations:
|
|
|
|
# - key: "key"
|
|
|
|
# operator: "Equal"
|
|
|
|
# value: "value"
|
|
|
|
# effect: "NoSchedule"
|
|
|
|
# nodeSelector:
|
|
|
|
# label-key1: "label-value1"
|
2021-08-11 17:03:23 +00:00
|
|
|
# label-key2: "label-value2"
|