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>
This commit is contained in:
parent
99fd9dea43
commit
fc04775b45
@ -21,7 +21,7 @@ rules:
|
|||||||
verbs:
|
verbs:
|
||||||
- "*"
|
- "*"
|
||||||
- apiGroups: [""]
|
- apiGroups: [""]
|
||||||
resources: ["pods", "events", "persistentvolumes", "persistentvolumeclaims", "nodes", "proxy/nodes", "pods/log", "secrets", "services", "endpoints", "configmaps"]
|
resources: ["pods", "events", "persistentvolumes", "persistentvolumeclaims","persistentvolumeclaims/status", "nodes", "proxy/nodes", "pods/log", "secrets", "services", "endpoints", "configmaps"]
|
||||||
verbs: ["*"]
|
verbs: ["*"]
|
||||||
- apiGroups: [""]
|
- apiGroups: [""]
|
||||||
resources: ["namespaces"]
|
resources: ["namespaces"]
|
||||||
@ -240,7 +240,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: longhorn-manager
|
- name: longhorn-manager
|
||||||
image: longhornio/longhorn-manager:v0.7.0
|
image: longhornio/longhorn-manager:v0.8.0-rc1
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
@ -249,13 +249,18 @@ spec:
|
|||||||
- -d
|
- -d
|
||||||
- daemon
|
- daemon
|
||||||
- --engine-image
|
- --engine-image
|
||||||
- longhornio/longhorn-engine:v0.7.0
|
- longhornio/longhorn-engine:v0.8.0-rc1
|
||||||
|
- --instance-manager-image
|
||||||
|
- longhornio/longhorn-instance-manager:v1_20200301
|
||||||
- --manager-image
|
- --manager-image
|
||||||
- longhornio/longhorn-manager:v0.7.0
|
- longhornio/longhorn-manager:v0.8.0-rc1
|
||||||
- --service-account
|
- --service-account
|
||||||
- longhorn-service-account
|
- longhorn-service-account
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 9500
|
- containerPort: 9500
|
||||||
|
readinessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: 9500
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: dev
|
- name: dev
|
||||||
mountPath: /host/dev/
|
mountPath: /host/dev/
|
||||||
@ -264,7 +269,7 @@ spec:
|
|||||||
- name: varrun
|
- name: varrun
|
||||||
mountPath: /var/run/
|
mountPath: /var/run/
|
||||||
- name: longhorn
|
- name: longhorn
|
||||||
mountPath: /var/lib/rancher/longhorn/
|
mountPath: /var/lib/longhorn/
|
||||||
mountPropagation: Bidirectional
|
mountPropagation: Bidirectional
|
||||||
- name: longhorn-default-setting
|
- name: longhorn-default-setting
|
||||||
mountPath: /var/lib/longhorn-setting/
|
mountPath: /var/lib/longhorn-setting/
|
||||||
@ -296,11 +301,14 @@ spec:
|
|||||||
path: /var/run/
|
path: /var/run/
|
||||||
- name: longhorn
|
- name: longhorn
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /var/lib/rancher/longhorn/
|
path: /var/lib/longhorn/
|
||||||
- name: longhorn-default-setting
|
- name: longhorn-default-setting
|
||||||
configMap:
|
configMap:
|
||||||
name: longhorn-default-setting
|
name: longhorn-default-setting
|
||||||
serviceAccountName: longhorn-service-account
|
serviceAccountName: longhorn-service-account
|
||||||
|
updateStrategy:
|
||||||
|
rollingUpdate:
|
||||||
|
maxUnavailable: "100%"
|
||||||
---
|
---
|
||||||
kind: Service
|
kind: Service
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
@ -336,7 +344,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: longhorn-ui
|
- name: longhorn-ui
|
||||||
image: longhornio/longhorn-ui:v0.7.0
|
image: longhornio/longhorn-ui:v0.8.0-rc1
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8000
|
- containerPort: 8000
|
||||||
env:
|
env:
|
||||||
@ -357,7 +365,8 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- port: 80
|
- port: 80
|
||||||
targetPort: 8000
|
targetPort: 8000
|
||||||
type: LoadBalancer
|
nodePort: null
|
||||||
|
type: ClusterIP
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
@ -376,18 +385,18 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: wait-longhorn-manager
|
- name: wait-longhorn-manager
|
||||||
image: longhornio/longhorn-manager:v0.7.0
|
image: longhornio/longhorn-manager:v0.8.0-rc1
|
||||||
command: ['sh', '-c', 'while [ $(curl -m 1 -s -o /dev/null -w "%{http_code}" http://longhorn-backend:9500/v1) != "200" ]; do echo waiting; sleep 2; done']
|
command: ['sh', '-c', 'while [ $(curl -m 1 -s -o /dev/null -w "%{http_code}" http://longhorn-backend:9500/v1) != "200" ]; do echo waiting; sleep 2; done']
|
||||||
containers:
|
containers:
|
||||||
- name: longhorn-driver-deployer
|
- name: longhorn-driver-deployer
|
||||||
image: longhornio/longhorn-manager:v0.7.0
|
image: longhornio/longhorn-manager:v0.8.0-rc1
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
command:
|
command:
|
||||||
- longhorn-manager
|
- longhorn-manager
|
||||||
- -d
|
- -d
|
||||||
- deploy-driver
|
- deploy-driver
|
||||||
- --manager-image
|
- --manager-image
|
||||||
- longhornio/longhorn-manager:v0.7.0
|
- longhornio/longhorn-manager:v0.8.0-rc1
|
||||||
- --manager-url
|
- --manager-url
|
||||||
- http://longhorn-backend:9500/v1
|
- http://longhorn-backend:9500/v1
|
||||||
# manually set root directory for csi
|
# manually set root directory for csi
|
||||||
@ -419,9 +428,10 @@ apiVersion: storage.k8s.io/v1
|
|||||||
metadata:
|
metadata:
|
||||||
name: longhorn
|
name: longhorn
|
||||||
provisioner: driver.longhorn.io
|
provisioner: driver.longhorn.io
|
||||||
|
allowVolumeExpansion: true
|
||||||
parameters:
|
parameters:
|
||||||
numberOfReplicas: "3"
|
numberOfReplicas: "3"
|
||||||
staleReplicaTimeout: "2880" # 48 hours in minutes
|
staleReplicaTimeout: "2880"
|
||||||
fromBackup: ""
|
fromBackup: ""
|
||||||
# diskSelector: "ssd,fast"
|
# diskSelector: "ssd,fast"
|
||||||
# nodeSelector: "storage,fast"
|
# nodeSelector: "storage,fast"
|
||||||
|
27
examples/simple_pod.yaml
Normal file
27
examples/simple_pod.yaml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: longhorn-simple-pod
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
restartPolicy: Always
|
||||||
|
containers:
|
||||||
|
- name: volume-test
|
||||||
|
image: nginx:stable-alpine
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
livenessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- ls
|
||||||
|
- /data/lost+found
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 5
|
||||||
|
volumeMounts:
|
||||||
|
- name: volv
|
||||||
|
mountPath: /data
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
volumes:
|
||||||
|
- name: volv
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: longhorn-simple-pvc
|
11
examples/simple_pvc.yaml
Normal file
11
examples/simple_pvc.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: longhorn-simple-pvc
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
storageClassName: longhorn
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
@ -3,6 +3,7 @@ apiVersion: storage.k8s.io/v1
|
|||||||
metadata:
|
metadata:
|
||||||
name: longhorn
|
name: longhorn
|
||||||
provisioner: driver.longhorn.io
|
provisioner: driver.longhorn.io
|
||||||
|
allowVolumeExpansion: true
|
||||||
parameters:
|
parameters:
|
||||||
numberOfReplicas: "3"
|
numberOfReplicas: "3"
|
||||||
staleReplicaTimeout: "2880" # 48 hours in minutes
|
staleReplicaTimeout: "2880" # 48 hours in minutes
|
||||||
|
@ -58,7 +58,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: longhorn-uninstall
|
- name: longhorn-uninstall
|
||||||
image: longhornio/longhorn-manager:v0.7.0-rc2
|
image: longhornio/longhorn-manager:v0.8.0-rc1
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
command:
|
command:
|
||||||
- longhorn-manager
|
- longhorn-manager
|
||||||
|
Loading…
Reference in New Issue
Block a user