diff --git a/deploy/longhorn.yaml b/deploy/longhorn.yaml index df82fb6..2651360 100644 --- a/deploy/longhorn.yaml +++ b/deploy/longhorn.yaml @@ -240,7 +240,7 @@ spec: spec: containers: - name: longhorn-manager - image: longhornio/longhorn-manager:v0.7.0-rc1 + image: longhornio/longhorn-manager:v0.7.0-rc2 imagePullPolicy: Always securityContext: privileged: true @@ -249,9 +249,9 @@ spec: - -d - daemon - --engine-image - - longhornio/longhorn-engine:v0.7.0-rc1 + - longhornio/longhorn-engine:v0.7.0-rc2 - --manager-image - - longhornio/longhorn-manager:v0.7.0-rc1 + - longhornio/longhorn-manager:v0.7.0-rc2 - --service-account - longhorn-service-account ports: @@ -267,7 +267,7 @@ spec: mountPath: /var/lib/rancher/longhorn/ mountPropagation: Bidirectional - name: longhorn-default-setting - mountPath: /var/lib/longhorn/setting/ + mountPath: /var/lib/longhorn-setting/ env: - name: POD_NAMESPACE valueFrom: @@ -283,7 +283,7 @@ spec: fieldPath: spec.nodeName # Should be: mount path of the volume longhorn-default-setting + the key of the configmap data in 04-default-setting.yaml - name: DEFAULT_SETTING_PATH - value: /var/lib/longhorn/setting/default-setting.yaml + value: /var/lib/longhorn-setting/default-setting.yaml volumes: - name: dev hostPath: @@ -336,7 +336,7 @@ spec: spec: containers: - name: longhorn-ui - image: longhornio/longhorn-ui:v0.7.0-rc1 + image: longhornio/longhorn-ui:v0.7.0-rc2 ports: - containerPort: 8000 env: @@ -376,26 +376,20 @@ spec: spec: initContainers: - name: wait-longhorn-manager - image: longhornio/longhorn-manager:v0.7.0-rc1 + image: longhornio/longhorn-manager:v0.7.0-rc2 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: - name: longhorn-driver-deployer - image: longhornio/longhorn-manager:v0.7.0-rc1 + image: longhornio/longhorn-manager:v0.7.0-rc2 imagePullPolicy: Always command: - longhorn-manager - -d - deploy-driver - --manager-image - - longhornio/longhorn-manager:v0.7.0-rc1 + - longhornio/longhorn-manager:v0.7.0-rc2 - --manager-url - http://longhorn-backend:9500/v1 - # manually choose "flexvolume" or "csi" - #- --driver - #- flexvolume - # manually set root directory for flexvolume - #- --flexvolume-dir - #- /usr/libexec/kubernetes/kubelet-plugins/volume/exec/ # manually set root directory for csi #- --kubelet-root-dir #- /var/lib/rancher/k3s/agent/kubelet @@ -418,11 +412,20 @@ spec: valueFrom: fieldRef: fieldPath: spec.serviceAccountName - # For auto detection, leave this parameter unset - #- name: FLEXVOLUME_DIR - # FOR RKE - #value: "/var/lib/kubelet/volumeplugins" - # FOR GKE - #value: "/home/kubernetes/flexvolume/" serviceAccountName: longhorn-service-account --- +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: longhorn +provisioner: driver.longhorn.io +parameters: + numberOfReplicas: "3" + staleReplicaTimeout: "2880" + fromBackup: "" +# diskSelector: "ssd,fast" +# nodeSelector: "storage,fast" +# recurringJobs: '[{"name":"snap", "task":"snapshot", "cron":"*/1 * * * *", "retain":1}, +# {"name":"backup", "task":"backup", "cron":"*/2 * * * *", "retain":1, +# "labels": {"interval":"2m"}}]' +--- diff --git a/examples/csi/example_pv.yaml b/examples/csi/example_pv.yaml index 2e68b40..b901dd1 100644 --- a/examples/csi/example_pv.yaml +++ b/examples/csi/example_pv.yaml @@ -9,6 +9,7 @@ spec: accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Delete + storageClassName: longhorn csi: driver: driver.longhorn.io fsType: ext4 @@ -28,17 +29,26 @@ spec: requests: storage: 2Gi volumeName: longhorn-vol-pv + storageClassName: longhorn --- apiVersion: v1 kind: Pod metadata: - name: volume-test + name: volume-pv-test namespace: default spec: + restartPolicy: Always containers: - - name: volume-test + - name: volume-pv-test image: nginx:stable-alpine imagePullPolicy: IfNotPresent + livenessProbe: + exec: + command: + - ls + - /data/lost+found + initialDelaySeconds: 5 + periodSeconds: 5 volumeMounts: - name: vol mountPath: /data diff --git a/examples/deployment.yaml b/examples/deployment.yaml index bb20480..fffe4da 100644 --- a/examples/deployment.yaml +++ b/examples/deployment.yaml @@ -40,9 +40,17 @@ spec: labels: app: mysql spec: + restartPolicy: Always containers: - image: mysql:5.6 name: mysql + livenessProbe: + exec: + command: + - ls + - /var/lib/mysql/lost+found + initialDelaySeconds: 5 + periodSeconds: 5 env: - name: MYSQL_ROOT_PASSWORD value: changeme diff --git a/examples/example_storageclass.yaml b/examples/example_storageclass.yaml deleted file mode 100644 index 0f60338..0000000 --- a/examples/example_storageclass.yaml +++ /dev/null @@ -1,41 +0,0 @@ -apiVersion: storage.k8s.io/v1 -kind: StorageClass -metadata: - name: longhorn -provisioner: rancher.io/longhorn -parameters: - numberOfReplicas: '3' - staleReplicaTimeout: '2880' -reclaimPolicy: Delete ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: longhorn-vol-pvc -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 2Gi - storageClassName: longhorn ---- -apiVersion: v1 -kind: Pod -metadata: - name: volume-test - namespace: default -spec: - containers: - - name: volume-test - image: nginx:stable-alpine - imagePullPolicy: IfNotPresent - volumeMounts: - - name: vol - mountPath: /data - ports: - - containerPort: 80 - volumes: - - name: vol - persistentVolumeClaim: - claimName: longhorn-vol-pvc diff --git a/examples/flexvolume/example.yaml b/examples/flexvolume/example.yaml deleted file mode 100644 index 92b3775..0000000 --- a/examples/flexvolume/example.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: volume-test - namespace: default -spec: - containers: - - name: volume-test - image: nginx:stable-alpine - imagePullPolicy: IfNotPresent - volumeMounts: - - name: voll - mountPath: /data - ports: - - containerPort: 80 - volumes: - - name: voll - flexVolume: - driver: "rancher.io/longhorn" - fsType: "ext4" - options: - size: "2Gi" - numberOfReplicas: "3" - staleReplicaTimeout: "20" - fromBackup: "" diff --git a/examples/flexvolume/example_pv.yaml b/examples/flexvolume/example_pv.yaml deleted file mode 100644 index 6ed583a..0000000 --- a/examples/flexvolume/example_pv.yaml +++ /dev/null @@ -1,50 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: longhorn-volv-pv -spec: - capacity: - storage: 2Gi - accessModes: - - ReadWriteOnce - storageClassName: longhorn - flexVolume: - driver: "rancher.io/longhorn" - fsType: "ext4" - options: - size: "2Gi" - numberOfReplicas: "3" - staleReplicaTimeout: "20" - fromBackup: "" ---- -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:stable-alpine - imagePullPolicy: IfNotPresent - volumeMounts: - - name: volv - mountPath: /data - ports: - - containerPort: 80 - volumes: - - name: volv - persistentVolumeClaim: - claimName: longhorn-volv-pvc diff --git a/examples/pvc.yaml b/examples/pvc.yaml index b3e5009..4e172be 100644 --- a/examples/pvc.yaml +++ b/examples/pvc.yaml @@ -16,10 +16,18 @@ metadata: name: volume-test 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 diff --git a/examples/statefulset.yaml b/examples/statefulset.yaml index 5fdfcec..9926b93 100644 --- a/examples/statefulset.yaml +++ b/examples/statefulset.yaml @@ -27,10 +27,18 @@ spec: labels: app: nginx # has to match .spec.selector.matchLabels spec: + restartPolicy: Always terminationGracePeriodSeconds: 10 containers: - name: nginx image: k8s.gcr.io/nginx-slim:0.8 + livenessProbe: + exec: + command: + - ls + - /usr/share/nginx/html/lost+found + initialDelaySeconds: 5 + periodSeconds: 5 ports: - containerPort: 80 name: web diff --git a/uninstall/uninstall.yaml b/uninstall/uninstall.yaml index 37e336b..c6ad9b9 100644 --- a/uninstall/uninstall.yaml +++ b/uninstall/uninstall.yaml @@ -58,7 +58,7 @@ spec: spec: containers: - name: longhorn-uninstall - image: longhornio/longhorn-manager:v0.7.0-rc1 + image: longhornio/longhorn-manager:v0.7.0-rc2 imagePullPolicy: Always command: - longhorn-manager