Skip to content

Longhorn #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Sources/longhorn/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: longhorn-ingress
namespace: longhorn-system
annotations:
cert-manager.io/cluster-issuer: "ingress"
kubernetes.io/ingress.class: nginx
spec:
rules:
- host: longhorn.vejlupek.org
http:
paths:
- backend:
serviceName: longhorn-frontend
servicePort: 80
path: /
tls:
- hosts:
- longhorn.vejlupek.org
secretName: tls-secret-le-longhorn
31 changes: 31 additions & 0 deletions Sources/longhorn/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/longhorn.yaml
- ingress.yaml
namespace: longhorn
images:
- name: longhornio/longhorn-manager
newName: vsellier/longhorn-manager
newTag: v1.0.1
- name: longhornio/longhorn-ui
newName: vsellier/longhorn-ui
newTag: v1.0.1
patches:
- path: patch_csi.yaml
target:
group: apps
version: v1
kind: Deployment
name: longhorn-driver-deployer
- path: patch_daemonset.yaml
target:
group: apps
version: v1
kind: DaemonSet
name: longhorn-manager
- path: patch-default-settings-configmap.yaml
target:
version: v1
kind: ConfigMap
name: longhorn-default-setting
24 changes: 24 additions & 0 deletions Sources/longhorn/patch-default-settings-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
- op: replace
path: /data/default-setting.yaml
value: |-
backup-target:
backup-target-credential-secret:
create-default-disk-labeled-nodes: true
default-data-path: /media/disk0
replica-soft-anti-affinity:
storage-over-provisioning-percentage:
storage-minimal-available-percentage:
upgrade-checker:
default-replica-count: 3
guaranteed-engine-cpu: 0.125
default-longhorn-static-storage-class:
backupstore-poll-interval:
taint-toleration:
priority-class:
registry-secret:
auto-salvage:
disable-scheduling-on-cordoned-node:
replica-zone-soft-anti-affinity:
volume-attachment-recovery-policy:
mkfs-ext4-parameters:
28 changes: 28 additions & 0 deletions Sources/longhorn/patch_csi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
- op: replace
path: /spec/template/spec/containers/0/command/4
value: vsellier/longhorn-manager:v1.0.1

- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: CSI_ATTACHER_IMAGE
value: vsellier/csi-attacher:v2.0.0

- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: CSI_PROVISIONER_IMAGE
value: vsellier/csi-provisioner:v1.4.0

- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: CSI_NODE_DRIVER_REGISTRAR_IMAGE
value: vsellier/csi-node-driver-registrar:v1.2.0

- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: CSI_RESIZER_IMAGE
value: vsellier/csi-resizer:v0.3.0
12 changes: 12 additions & 0 deletions Sources/longhorn/patch_daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
- op: replace
path: /spec/template/spec/containers/0/command/4
value: vsellier/longhorn-engine:v1.0.1

- op: replace
path: /spec/template/spec/containers/0/command/6
value: vsellier/longhorn-instance-manager:v1_20200514_1

- op: replace
path: /spec/template/spec/containers/0/command/8
value: vsellier/longhorn-manager:v1.0.1
8 changes: 7 additions & 1 deletion manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fi
echo "Cleanup manifests folder"
rm -rf manifests && mkdir manifests

manifests="cert-manager ingress-nginx metallb-system monitoring-system"
manifests="cert-manager ingress-nginx metallb-system monitoring-system longhorn"

for service_namespace in ${manifests}
do
Expand All @@ -25,3 +25,9 @@ do
docker run -it --rm -e KUBECONFIG=/workdir/tmp/kube_config.yml -v ${PWD}:/workdir bitnami/kubectl:1.18.8 apply --wait --record=false -f /workdir/manifests/${service_namespace}.yml
done

for cluster_node in $(docker run -it --rm -e KUBECONFIG=/workdir/tmp/kube_config.yml -v ${PWD}:/workdir bitnami/kubectl:1.18.8 get no -o name)
do

docker run -it --rm -e KUBECONFIG=/workdir/tmp/kube_config.yml -v ${PWD}:/workdir bitnami/kubectl:1.18.8 label $(echo $cluster_node | tr -d '[:space:]') node.longhorn.io/create-default-disk=true --overwrite

done