From 46988b5a12f8ca69304470273de9cea838876f95 Mon Sep 17 00:00:00 2001 From: Joe Monk Date: Mon, 19 Aug 2024 01:11:18 +0100 Subject: [PATCH] Revert "Ok longhorn" This reverts commit 02bc749c241feb17aef5c115fa85b671ac5f719f. --- apps/sonarr/pvc.yaml | 2 +- clusters/kairos/longhorn/helmrelease.yaml | 23 ------------- clusters/kairos/longhorn/helmrepo.yaml | 7 ---- clusters/kairos/longhorn/ingress.yaml | 16 --------- clusters/kairos/longhorn/kustomization.yaml | 8 ----- clusters/kairos/longhorn/namespace.yaml | 4 --- .../monitoring/grafana/helmrelease.yaml | 2 +- .../kairos/monitoring/loki/helmrelease.yaml | 2 +- clusters/kairos/storage/kustomization.yaml | 5 +++ .../kairos/storage/localstorageconfigmap.yaml | 34 +++++++++++++++++++ clusters/kairos/storage/storageclass.yaml | 11 ++++++ 11 files changed, 53 insertions(+), 61 deletions(-) delete mode 100644 clusters/kairos/longhorn/helmrelease.yaml delete mode 100644 clusters/kairos/longhorn/helmrepo.yaml delete mode 100644 clusters/kairos/longhorn/ingress.yaml delete mode 100644 clusters/kairos/longhorn/kustomization.yaml delete mode 100644 clusters/kairos/longhorn/namespace.yaml create mode 100644 clusters/kairos/storage/kustomization.yaml create mode 100644 clusters/kairos/storage/localstorageconfigmap.yaml create mode 100644 clusters/kairos/storage/storageclass.yaml diff --git a/apps/sonarr/pvc.yaml b/apps/sonarr/pvc.yaml index 0108abf..b4320c6 100644 --- a/apps/sonarr/pvc.yaml +++ b/apps/sonarr/pvc.yaml @@ -5,7 +5,7 @@ metadata: spec: accessModes: - ReadWriteOncePod - storageClassName: longhorn + storageClassName: local-storage resources: requests: storage: 5Gi \ No newline at end of file diff --git a/clusters/kairos/longhorn/helmrelease.yaml b/clusters/kairos/longhorn/helmrelease.yaml deleted file mode 100644 index 995852e..0000000 --- a/clusters/kairos/longhorn/helmrelease.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: helm.toolkit.fluxcd.io/v2 -kind: HelmRelease -metadata: - name: longhorn -spec: - chart: - spec: - chart: longhorn - reconcileStrategy: ChartVersion - sourceRef: - kind: HelmRepository - name: longhorn-repo - version: 1.6.2 - interval: 1m0s - targetNamespace: longhorn - values: - defaultSettings: - defaultReplicaCount: 1 - defaultDataPath: /usr/local/longhorn/ - longhornUI: - replicas: 1 - persistence: - defaultClassReplicaCount: 1 \ No newline at end of file diff --git a/clusters/kairos/longhorn/helmrepo.yaml b/clusters/kairos/longhorn/helmrepo.yaml deleted file mode 100644 index 5da584a..0000000 --- a/clusters/kairos/longhorn/helmrepo.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: source.toolkit.fluxcd.io/v1 -kind: HelmRepository -metadata: - name: longhorn-repo -spec: - interval: 1m0s - url: https://charts.longhorn.io diff --git a/clusters/kairos/longhorn/ingress.yaml b/clusters/kairos/longhorn/ingress.yaml deleted file mode 100644 index bd65ee5..0000000 --- a/clusters/kairos/longhorn/ingress.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: traefik.io/v1alpha1 -kind: IngressRoute -metadata: - name: longhorn -spec: - entryPoints: - - web - routes: - - match: Host(`longhorn.k3s`) - kind: Rule - services: - - name: longhorn-frontend - namespace: longhorn - nativeLB: true - kind: Service - port: 80 \ No newline at end of file diff --git a/clusters/kairos/longhorn/kustomization.yaml b/clusters/kairos/longhorn/kustomization.yaml deleted file mode 100644 index 8b1afaa..0000000 --- a/clusters/kairos/longhorn/kustomization.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -namespace: longhorn -resources: -- namespace.yaml -- helmrepo.yaml -- helmrelease.yaml -- ingress.yaml diff --git a/clusters/kairos/longhorn/namespace.yaml b/clusters/kairos/longhorn/namespace.yaml deleted file mode 100644 index d6fc633..0000000 --- a/clusters/kairos/longhorn/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: longhorn \ No newline at end of file diff --git a/clusters/kairos/monitoring/grafana/helmrelease.yaml b/clusters/kairos/monitoring/grafana/helmrelease.yaml index f41ad15..ef35fcc 100644 --- a/clusters/kairos/monitoring/grafana/helmrelease.yaml +++ b/clusters/kairos/monitoring/grafana/helmrelease.yaml @@ -16,4 +16,4 @@ spec: values: persistence: enabled: true - storageClassName: longhorn \ No newline at end of file + storageClassName: local-storage \ No newline at end of file diff --git a/clusters/kairos/monitoring/loki/helmrelease.yaml b/clusters/kairos/monitoring/loki/helmrelease.yaml index f976928..96af506 100644 --- a/clusters/kairos/monitoring/loki/helmrelease.yaml +++ b/clusters/kairos/monitoring/loki/helmrelease.yaml @@ -45,7 +45,7 @@ spec: minio: enabled: true persistence: - storageClass: longhorn + storageClass: local-storage # Zero out replica counts of other deployment modes singleBinary: diff --git a/clusters/kairos/storage/kustomization.yaml b/clusters/kairos/storage/kustomization.yaml new file mode 100644 index 0000000..3cb9601 --- /dev/null +++ b/clusters/kairos/storage/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- localstorageconfigmap.yaml +- storageclass.yaml \ No newline at end of file diff --git a/clusters/kairos/storage/localstorageconfigmap.yaml b/clusters/kairos/storage/localstorageconfigmap.yaml new file mode 100644 index 0000000..01789c4 --- /dev/null +++ b/clusters/kairos/storage/localstorageconfigmap.yaml @@ -0,0 +1,34 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: local-path-config + namespace: kube-system +data: + config.json: |- + { + "nodePathMap":[ + { + "node":"DEFAULT_PATH_FOR_NON_LISTED_NODES", + "paths":["/usr/local"] + } + ] + } + helperPod.yaml: |- + apiVersion: v1 + kind: Pod + metadata: + name: helper-pod + spec: + containers: + - name: helper-pod + image: "rancher/mirrored-library-busybox:1.36.1" + imagePullPolicy: IfNotPresent + setup: |- + #!/bin/sh + set -eu + mkdir -m 0777 -p "${VOL_DIR}" + chmod 700 "${VOL_DIR}/.." + teardown: |- + #!/bin/sh + set -eu + rm -rf "${VOL_DIR}" \ No newline at end of file diff --git a/clusters/kairos/storage/storageclass.yaml b/clusters/kairos/storage/storageclass.yaml new file mode 100644 index 0000000..24ad121 --- /dev/null +++ b/clusters/kairos/storage/storageclass.yaml @@ -0,0 +1,11 @@ +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: local-storage + annotations: + storageclass.kubernetes.io/is-default-class: "true" +provisioner: rancher.io/local-path +parameters: + nodePath: /usr/local + pathPattern: "{{ .PVC.Namespace }}/{{ .PVC.Name }}" +reclaimPolicy: Retain \ No newline at end of file