Update longhorn-manager
Longhorn manager: 5871843d78168db37d156460a01c56d8620b6f8e Changes: 1. Complete rewrite of orchestration of Longhorn manager 2. Updated the deployment model of Longhorn driver This breaks the compatiability with previous version. Please clean up and re-deploy.
This commit is contained in:
parent
a917063ebc
commit
d4a4865fef
@ -21,10 +21,16 @@ rules:
|
|||||||
verbs:
|
verbs:
|
||||||
- "*"
|
- "*"
|
||||||
- apiGroups: [""]
|
- apiGroups: [""]
|
||||||
resources: ["pods"]
|
resources: ["pods", "events", "persistentvolumes", "persistentvolumeclaims", "nodes", "proxy/nodes"]
|
||||||
|
verbs: ["*"]
|
||||||
|
- apiGroups: ["extensions"]
|
||||||
|
resources: ["daemonsets"]
|
||||||
verbs: ["*"]
|
verbs: ["*"]
|
||||||
- apiGroups: ["batch"]
|
- apiGroups: ["batch"]
|
||||||
resources: ["jobs"]
|
resources: ["jobs", "cronjobs"]
|
||||||
|
verbs: ["*"]
|
||||||
|
- apiGroups: ["storage.k8s.io"]
|
||||||
|
resources: ["storageclasses"]
|
||||||
verbs: ["*"]
|
verbs: ["*"]
|
||||||
- apiGroups: ["longhorn.rancher.io"]
|
- apiGroups: ["longhorn.rancher.io"]
|
||||||
resources: ["nodes"]
|
resources: ["nodes"]
|
||||||
@ -32,15 +38,15 @@ rules:
|
|||||||
- apiGroups: ["longhorn.rancher.io"]
|
- apiGroups: ["longhorn.rancher.io"]
|
||||||
resources: ["volumes"]
|
resources: ["volumes"]
|
||||||
verbs: ["*"]
|
verbs: ["*"]
|
||||||
|
- apiGroups: ["longhorn.rancher.io"]
|
||||||
|
resources: ["engines"]
|
||||||
|
verbs: ["*"]
|
||||||
- apiGroups: ["longhorn.rancher.io"]
|
- apiGroups: ["longhorn.rancher.io"]
|
||||||
resources: ["replicas"]
|
resources: ["replicas"]
|
||||||
verbs: ["*"]
|
verbs: ["*"]
|
||||||
- apiGroups: ["longhorn.rancher.io"]
|
- apiGroups: ["longhorn.rancher.io"]
|
||||||
resources: ["settings"]
|
resources: ["settings"]
|
||||||
verbs: ["*"]
|
verbs: ["*"]
|
||||||
- apiGroups: ["longhorn.rancher.io"]
|
|
||||||
resources: ["controllers"]
|
|
||||||
verbs: ["*"]
|
|
||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
@ -59,35 +65,17 @@ apiVersion: apiextensions.k8s.io/v1beta1
|
|||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
longhorn-manager: Controller
|
longhorn-manager: Engine
|
||||||
name: controllers.longhorn.rancher.io
|
name: engines.longhorn.rancher.io
|
||||||
spec:
|
spec:
|
||||||
group: longhorn.rancher.io
|
group: longhorn.rancher.io
|
||||||
names:
|
names:
|
||||||
kind: Controller
|
kind: Engine
|
||||||
listKind: ControllerList
|
listKind: EngineList
|
||||||
plural: controllers
|
plural: engines
|
||||||
shortNames:
|
shortNames:
|
||||||
- lhc
|
- lhe
|
||||||
singular: controller
|
singular: engine
|
||||||
scope: Namespaced
|
|
||||||
version: v1alpha1
|
|
||||||
---
|
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
|
||||||
kind: CustomResourceDefinition
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
longhorn-manager: Node
|
|
||||||
name: nodes.longhorn.rancher.io
|
|
||||||
spec:
|
|
||||||
group: longhorn.rancher.io
|
|
||||||
names:
|
|
||||||
kind: Node
|
|
||||||
listKind: NodeList
|
|
||||||
plural: nodes
|
|
||||||
shortNames:
|
|
||||||
- lhn
|
|
||||||
singular: node
|
|
||||||
scope: Namespaced
|
scope: Namespaced
|
||||||
version: v1alpha1
|
version: v1alpha1
|
||||||
---
|
---
|
||||||
@ -160,20 +148,27 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: init-container
|
- name: init-container
|
||||||
image: rancher/longhorn-engine:8c8289f
|
image: rancher/longhorn-engine:de88734
|
||||||
command: ['sh', '-c', 'cp /usr/local/bin/* /data/']
|
command: ['sh', '-c', 'cp /usr/local/bin/* /data/']
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: execbin
|
- name: execbin
|
||||||
mountPath: /data/
|
mountPath: /data/
|
||||||
containers:
|
containers:
|
||||||
- name: longhorn-manager
|
- name: longhorn-manager
|
||||||
image: rancher/longhorn-manager:ea71bd3
|
image: rancher/longhorn-manager:7d61273
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
command: ["launch-manager", "-d",
|
command:
|
||||||
"--orchestrator", "kubernetes",
|
- longhorn-manager
|
||||||
"--engine-image", "rancher/longhorn-engine:8c8289f"]
|
- -d
|
||||||
|
- daemon
|
||||||
|
- --engine-image
|
||||||
|
- rancher/longhorn-engine:de88734
|
||||||
|
- --manager-image
|
||||||
|
- rancher/longhorn-manager:7d61273
|
||||||
|
- --service-account
|
||||||
|
- longhorn-service-account
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 9500
|
- containerPort: 9500
|
||||||
name: manager
|
name: manager
|
||||||
@ -250,7 +245,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: longhorn-ui
|
- name: longhorn-ui
|
||||||
image: rancher/longhorn-ui:99622cb
|
image: rancher/longhorn-ui:9f5874c
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8000
|
- containerPort: 8000
|
||||||
name: longhorn-ui
|
name: longhorn-ui
|
||||||
@ -273,58 +268,41 @@ spec:
|
|||||||
port: 80
|
port: 80
|
||||||
targetPort: longhorn-ui
|
targetPort: longhorn-ui
|
||||||
type: LoadBalancer
|
type: LoadBalancer
|
||||||
sessionAffinity: ClientIP
|
|
||||||
---
|
---
|
||||||
apiVersion: extensions/v1beta1
|
apiVersion: extensions/v1beta1
|
||||||
kind: DaemonSet
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: longhorn-driver
|
name: longhorn-flexvolume-driver-deployer
|
||||||
namespace: longhorn-system
|
namespace: longhorn-system
|
||||||
spec:
|
spec:
|
||||||
|
replicas: 1
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
name: longhorn-driver
|
|
||||||
labels:
|
labels:
|
||||||
app: longhorn-driver
|
app: longhorn-flexvolume-driver-deployer
|
||||||
spec:
|
spec:
|
||||||
initContainers:
|
|
||||||
- name: init-container
|
|
||||||
image: rancher/longhorn-driver:ea71bd3
|
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
||||||
command: ["/checkdependency.sh"]
|
|
||||||
volumeMounts:
|
|
||||||
- name: host-proc-mount
|
|
||||||
mountPath: /host/proc/
|
|
||||||
containers:
|
containers:
|
||||||
- image: rancher/longhorn-driver:ea71bd3
|
- name: longhorn-flexvolume-driver-deployer
|
||||||
|
image: rancher/longhorn-manager:7d61273
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
name: longhorn-driver-container
|
command:
|
||||||
command: ["/entrypoint.sh"]
|
- longhorn-manager
|
||||||
securityContext:
|
- -d
|
||||||
privileged: true
|
- deploy-flexvolume-driver
|
||||||
volumeMounts:
|
- --manager-image
|
||||||
- mountPath: /flexmnt
|
- rancher/longhorn-manager:7d61273
|
||||||
name: flexvolume-longhorn-mount
|
|
||||||
- mountPath: /binmnt
|
|
||||||
name: usr-local-bin-mount
|
|
||||||
env:
|
env:
|
||||||
- name: LONGHORN_BACKEND_SVC
|
- name: POD_NAMESPACE
|
||||||
value: "longhorn-backend"
|
valueFrom:
|
||||||
- name: NODE_NAME
|
fieldRef:
|
||||||
valueFrom:
|
fieldPath: metadata.namespace
|
||||||
fieldRef:
|
- name: NODE_NAME
|
||||||
fieldPath: spec.nodeName
|
valueFrom:
|
||||||
volumes:
|
fieldRef:
|
||||||
- name: usr-local-bin-mount
|
fieldPath: spec.nodeName
|
||||||
hostPath:
|
- name: FLEXVOLUME_DIR
|
||||||
path: /usr/local/bin/
|
value: ""
|
||||||
- name: host-proc-mount
|
|
||||||
hostPath:
|
|
||||||
path: /proc/
|
|
||||||
- name: flexvolume-longhorn-mount
|
|
||||||
hostPath:
|
|
||||||
path: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/
|
|
||||||
#FOR GKE
|
#FOR GKE
|
||||||
#path: /home/kubernetes/flexvolume/
|
#value: "/home/kubernetes/flexvolume/"
|
||||||
|
serviceAccountName: longhorn-service-account
|
||||||
---
|
---
|
||||||
|
31
examples/pvc.yaml
Normal file
31
examples/pvc.yaml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: longhorn-volv-pvc
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
storageClassName: longhorn
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 2Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: volume-test
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: volume-test
|
||||||
|
image: nginx
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
volumeMounts:
|
||||||
|
- name: volv
|
||||||
|
mountPath: /data
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
volumes:
|
||||||
|
- name: volv
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: longhorn-volv-pvc
|
Loading…
Reference in New Issue
Block a user