diff --git a/README.md b/README.md index b84c0e1..e3c5202 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ You can read more technical details of Longhorn [here](http://rancher.com/micros ## Current status -The latest release of Longhorn is **v1.0.0**. +The latest release of Longhorn is **v1.0.1**. ## Source code Longhorn is 100% open source software. Project source code is spread across a number of repos: diff --git a/chart/Chart.yaml b/chart/Chart.yaml index 97e6368..d69784c 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: longhorn -version: 1.0.0 -appVersion: v1.0.0 +version: 1.0.1 +appVersion: v1.0.1 kubeVersion: ">=v1.14.0-r0" description: Longhorn is a distributed block storage system for Kubernetes. keywords: diff --git a/chart/questions.yml b/chart/questions.yml index c196bfa..781f7a0 100644 --- a/chart/questions.yml +++ b/chart/questions.yml @@ -17,7 +17,7 @@ questions: label: Longhorn Manager Image Name group: "Longhorn Images Settings" - variable: image.longhorn.managerTag - default: v1.0.0 + default: v1.0.1 description: "Specify Longhorn Manager Image Tag" type: string label: Longhorn Manager Image Tag @@ -29,7 +29,7 @@ questions: label: Longhorn Engine Image Name group: "Longhorn Images Settings" - variable: image.longhorn.engineTag - default: v1.0.0 + default: v1.0.1 description: "Specify Longhorn Engine Image Tag" type: string label: Longhorn Engine Image Tag @@ -41,7 +41,7 @@ questions: label: Longhorn UI Image Name group: "Longhorn Images Settings" - variable: image.longhorn.uiTag - default: v1.0.0 + default: v1.0.1 description: "Specify Longhorn UI Image Tag" type: string label: Longhorn UI Image Tag @@ -70,11 +70,11 @@ questions: type: string label: Longhorn CSI Provisioner Image group: "Longhorn CSI Driver Images" - - variable: csi.driverRegistrarImage + - variable: csi.nodeDriverRegistrarImage default: - description: "Specify CSI Driver Registrar image. Leave blank to autodetect." + description: "Specify CSI Node Driver Registrar image. Leave blank to autodetect." type: string - label: Longhorn CSI Driver Registrar Image + label: Longhorn CSI Node Driver Registrar Image group: "Longhorn CSI Driver Images" - variable: csi.resizerImage default: @@ -239,6 +239,12 @@ WARNING: DO NOT CHANGE THIS SETTING WITH ATTACHED VOLUMES.' group: "Longhorn Default Settings" type: string default: "" + - variable: defaultSettings.priorityClass + label: Priority Class + description: "The name of the Priority Class to set on the Longhorn workloads. This can help prevent Longhorn workloads from being evicted under Node Pressure. WARNING: DO NOT CHANGE THIS SETTING WITH ATTACHED VOLUMES." + group: "Longhorn Default Settings" + type: string + default: "" - variable: defaultSettings.autoSalvage label: Automatic salvage description: "If enabled, volumes will be automatically salvaged when all the replicas become faulty e.g. due to network disconnection. Longhorn will try to figure out which replica(s) are usable, then use them for the volume. By default true." @@ -299,7 +305,7 @@ WARNING: DO NOT CHANGE THIS SETTING WITH ATTACHED VOLUMES.' show_if: "ingress.enabled=false" group: "Services and Load Balancing" show_subquestion_if: "NodePort" - subquestions: + subquestions: - variable: service.ui.nodePort default: "" description: "NodePort port number(to set explicitly, choose port between 30000-32767)" diff --git a/chart/templates/clusterrole.yaml b/chart/templates/clusterrole.yaml index bc257e1..491c3e6 100644 --- a/chart/templates/clusterrole.yaml +++ b/chart/templates/clusterrole.yaml @@ -22,6 +22,9 @@ rules: - apiGroups: ["batch"] resources: ["jobs", "cronjobs"] verbs: ["*"] +- apiGroups: ["scheduling.k8s.io"] + resources: ["priorityclasses"] + verbs: ["watch", "list"] - apiGroups: ["storage.k8s.io"] resources: ["storageclasses", "volumeattachments", "csinodes", "csidrivers"] verbs: ["*"] diff --git a/chart/templates/default-setting.yaml b/chart/templates/default-setting.yaml index 60d7f45..2eb10b4 100644 --- a/chart/templates/default-setting.yaml +++ b/chart/templates/default-setting.yaml @@ -19,6 +19,7 @@ data: default-longhorn-static-storage-class: {{ .Values.defaultSettings.defaultLonghornStaticStorageClass }} backupstore-poll-interval: {{ .Values.defaultSettings.backupstorePollInterval }} taint-toleration: {{ .Values.defaultSettings.taintToleration }} + priority-class: {{ .Values.defaultSettings.priorityClass }} registry-secret: {{ .Values.defaultSettings.registrySecret }} auto-salvage: {{ .Values.defaultSettings.autoSalvage }} disable-scheduling-on-cordoned-node: {{ .Values.defaultSettings.disableSchedulingOnCordonedNode }} diff --git a/chart/values.yaml b/chart/values.yaml index ed98402..a1a7d26 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -4,11 +4,11 @@ image: longhorn: engine: longhornio/longhorn-engine - engineTag: v1.0.0 + engineTag: v1.0.1 manager: longhornio/longhorn-manager - managerTag: v1.0.0 + managerTag: v1.0.1 ui: longhornio/longhorn-ui - uiTag: v1.0.0 + uiTag: v1.0.1 instanceManager: longhornio/longhorn-instance-manager instanceManagerTag: v1_20200514 pullPolicy: IfNotPresent @@ -49,6 +49,7 @@ defaultSettings: defaultLonghornStaticStorageClass: ~ backupstorePollInterval: ~ taintToleration: ~ + priorityClass: ~ registrySecret: ~ autoSalvage: ~ disableSchedulingOnCordonedNode: ~ diff --git a/deploy/longhorn-images.txt b/deploy/longhorn-images.txt new file mode 100644 index 0000000..3ad6943 --- /dev/null +++ b/deploy/longhorn-images.txt @@ -0,0 +1,8 @@ +longhornio/longhorn-engine:v1.0.1 +longhornio/longhorn-instance-manager:v1_20200514 +longhornio/longhorn-manager:v1.0.1 +longhornio/longhorn-ui:v1.0.1 +longhornio/csi-attacher:v2.0.0 +longhornio/csi-node-driver-registrar:v1.2.0 +longhornio/csi-provisioner:v1.4.0 +longhornio/csi-resizer:v0.3.0 diff --git a/deploy/longhorn.yaml b/deploy/longhorn.yaml index 3f505a1..f780921 100644 --- a/deploy/longhorn.yaml +++ b/deploy/longhorn.yaml @@ -32,6 +32,9 @@ rules: - apiGroups: ["batch"] resources: ["jobs", "cronjobs"] verbs: ["*"] +- apiGroups: ["scheduling.k8s.io"] + resources: ["priorityclasses"] + verbs: ["watch", "list"] - apiGroups: ["storage.k8s.io"] resources: ["storageclasses", "volumeattachments", "csinodes", "csidrivers"] verbs: ["*"] @@ -217,6 +220,7 @@ data: default-longhorn-static-storage-class: backupstore-poll-interval: taint-toleration: + priority-class: registry-secret: auto-salvage: disable-scheduling-on-cordoned-node: @@ -242,8 +246,8 @@ spec: spec: containers: - name: longhorn-manager - image: longhornio/longhorn-manager:v1.0.0 - imagePullPolicy: Always + image: longhornio/longhorn-manager:v1.0.1 + imagePullPolicy: IfNotPresent securityContext: privileged: true command: @@ -251,11 +255,11 @@ spec: - -d - daemon - --engine-image - - longhornio/longhorn-engine:v1.0.0 + - longhornio/longhorn-engine:v1.0.1 - --instance-manager-image - longhornio/longhorn-instance-manager:v1_20200514 - --manager-image - - longhornio/longhorn-manager:v1.0.0 + - longhornio/longhorn-manager:v1.0.1 - --service-account - longhorn-service-account ports: @@ -351,8 +355,8 @@ spec: spec: containers: - name: longhorn-ui - image: longhornio/longhorn-ui:v1.0.0 - imagePullPolicy: Always + image: longhornio/longhorn-ui:v1.0.1 + imagePullPolicy: IfNotPresent securityContext: runAsUser: 0 ports: @@ -398,18 +402,18 @@ spec: spec: initContainers: - name: wait-longhorn-manager - image: longhornio/longhorn-manager:v1.0.0 + image: longhornio/longhorn-manager:v1.0.1 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:v1.0.0 - imagePullPolicy: Always + image: longhornio/longhorn-manager:v1.0.1 + imagePullPolicy: IfNotPresent command: - longhorn-manager - -d - deploy-driver - --manager-image - - longhornio/longhorn-manager:v1.0.0 + - longhornio/longhorn-manager:v1.0.1 - --manager-url - http://longhorn-backend:9500/v1 env: diff --git a/deploy/release-images.txt b/deploy/release-images.txt new file mode 100644 index 0000000..03bd6e9 --- /dev/null +++ b/deploy/release-images.txt @@ -0,0 +1,8 @@ +longhornio/longhorn-engine:v1.0.1 +longhornio/longhorn-instance-manager:v1_20200514 +longhornio/longhorn-manager:v1.0.1 +longhornio/longhorn-ui:v1.0.1 +quay.io/k8scsi/csi-attacher:v2.0.0 +quay.io/k8scsi/csi-node-driver-registrar:v1.2.0 +quay.io/k8scsi/csi-provisioner:v1.4.0 +quay.io/k8scsi/csi-resizer:v0.3.0 diff --git a/scripts/load-images.sh b/scripts/load-images.sh new file mode 100755 index 0000000..f9eaef1 --- /dev/null +++ b/scripts/load-images.sh @@ -0,0 +1,73 @@ +#!/bin/bash +list="longhorn-images.txt" + +POSITIONAL=() +while [[ $# -gt 0 ]]; do + key="$1" + case $key in + -r|--registry) + reg="$2" + shift # past argument + shift # past value + ;; + -l|--image-list) + list="$2" + shift # past argument + shift # past value + ;; + -i|--images) + images="$2" + shift # past argument + shift # past value + ;; + -h|--help) + help="true" + shift + ;; + *) + echo "Error! invalid flag: ${key}" + help="true" + break + ;; + esac +done + +usage () { + echo "USAGE: $0 [--image-list longhorn-images.txt] [--images longhorn-images.tar.gz] --registry my.registry.com:5000" + echo " [-l|--images-list path] text file with list of images. 1 per line." + echo " [-i|--images path] tar.gz generated by docker save. If empty, the script will try to find images in local docker images" + echo " [-r|--registry registry:port] target private registry:port. By default, registry is Docker Hub" + echo " [-h|--help] Usage message" +} + +if [[ $help ]]; then + usage + exit 0 +fi + +if [[ -n $reg ]]; then + reg+="/" +fi + +set -e -x + +if [[ $images ]]; then + docker load --input ${images} +fi + +for i in $(cat ${list}); do + case $i in + */*/*) + docker tag ${i} ${reg}longhornio/${i#*/*/} + docker push ${reg}longhornio/${i#*/*/} + ;; + */*) + docker tag ${i} ${reg}longhornio/${i#*/} + docker push ${reg}longhornio/${i#*/} + ;; + *) + docker tag ${i} ${reg}longhornio/${i} + docker push ${reg}longhornio/${i} + ;; + esac +done \ No newline at end of file diff --git a/scripts/save-images.sh b/scripts/save-images.sh new file mode 100755 index 0000000..69a28c5 --- /dev/null +++ b/scripts/save-images.sh @@ -0,0 +1,50 @@ +#!/bin/bash +list="longhorn-images.txt" + +POSITIONAL=() +while [[ $# -gt 0 ]]; do + key="$1" + case $key in + -i|--images) + images="$2" + shift # past argument + shift # past value + ;; + -l|--image-list) + list="$2" + shift # past argument + shift # past value + ;; + -h|--help) + help="true" + shift + ;; + *) + echo "Error! invalid flag: ${key}" + help="true" + break + ;; + esac +done + +usage () { + echo "USAGE: $0 [--image-list longhorn-images.txt] [--images longhorn-images.tar.gz]" + echo " [-l|--images-list path] text file with list of images. 1 per line." + echo " [-i|--images path] tar.gz generated by docker save. If this flag is empty, the script does not export images to a tar.gz file" + echo " [-h|--help] Usage message" +} + +if [[ $help ]]; then + usage + exit 0 +fi + +set -e -x + +for i in $(cat ${list}); do + docker pull ${i} +done + +if [[ $images ]]; then + docker save $(cat ${list} | tr '\n' ' ') | gzip -c > ${images} +fi \ No newline at end of file diff --git a/uninstall/uninstall.yaml b/uninstall/uninstall.yaml index 75898fd..48fde05 100644 --- a/uninstall/uninstall.yaml +++ b/uninstall/uninstall.yaml @@ -24,6 +24,9 @@ rules: - apiGroups: ["batch"] resources: ["jobs", "cronjobs"] verbs: ["*"] + - apiGroups: ["scheduling.k8s.io"] + resources: ["priorityclasses"] + verbs: ["watch", "list"] - apiGroups: ["storage.k8s.io"] resources: ["csidrivers"] verbs: ["*"] @@ -58,7 +61,7 @@ spec: spec: containers: - name: longhorn-uninstall - image: longhornio/longhorn-manager:v1.0.0 + image: longhornio/longhorn-manager:v1.0.1 imagePullPolicy: Always command: - longhorn-manager