diff --git a/apps/sonarr/pvc.yaml b/apps/sonarr/pvc.yaml index b4320c6..550abf8 100644 --- a/apps/sonarr/pvc.yaml +++ b/apps/sonarr/pvc.yaml @@ -5,7 +5,7 @@ metadata: spec: accessModes: - ReadWriteOncePod - storageClassName: local-storage + storageClassName: local-path resources: requests: storage: 5Gi \ No newline at end of file diff --git a/clusters/kairos/local-path-provisioner/helmrelease.yaml b/clusters/kairos/local-path-provisioner/helmrelease.yaml new file mode 100644 index 0000000..60fcc6b --- /dev/null +++ b/clusters/kairos/local-path-provisioner/helmrelease.yaml @@ -0,0 +1,25 @@ + +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: local-path-repo + namespace: kube-system +spec: + interval: 5m + releaseName: local-path-repo + chart: + spec: + chart: local-path-provisioner + sourceRef: + kind: GitRepository + name: local-path-repo + values: + storageClass: + defaultClass: true + reclaimPolicy: Retain + nodePathMap: [ + { + node: DEFAULT_PATH_FOR_NON_LISTED_NODES, + paths: [/usr/local] + } + ] \ No newline at end of file diff --git a/clusters/kairos/local-path-provisioner/helmrepo.yaml b/clusters/kairos/local-path-provisioner/helmrepo.yaml new file mode 100644 index 0000000..5acdcc8 --- /dev/null +++ b/clusters/kairos/local-path-provisioner/helmrepo.yaml @@ -0,0 +1,15 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: GitRepository +metadata: + name: local-path-repo + namespace: kube-system +spec: + interval: 15m + url: https://github.com/rancher/local-path-provisioner + ref: + branch: main + ignore: |- + # exclude all + /* + # include charts directory + !/deploy/chart/ \ No newline at end of file diff --git a/clusters/kairos/storage/kustomization.yaml b/clusters/kairos/local-path-provisioner/kustomization.yaml similarity index 60% rename from clusters/kairos/storage/kustomization.yaml rename to clusters/kairos/local-path-provisioner/kustomization.yaml index 3cb9601..4de7c24 100644 --- a/clusters/kairos/storage/kustomization.yaml +++ b/clusters/kairos/local-path-provisioner/kustomization.yaml @@ -1,5 +1,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- localstorageconfigmap.yaml -- storageclass.yaml \ No newline at end of file +- helmrelease.yaml +- helmrepo.yaml \ No newline at end of file diff --git a/clusters/kairos/monitoring/grafana/helmrelease.yaml b/clusters/kairos/monitoring/grafana/helmrelease.yaml index ef35fcc..e831168 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: local-storage \ No newline at end of file + storageClassName: local-path \ No newline at end of file diff --git a/clusters/kairos/monitoring/loki/helmrelease.yaml b/clusters/kairos/monitoring/loki/helmrelease.yaml index 96af506..a651cd8 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: local-storage + storageClass: local-path # Zero out replica counts of other deployment modes singleBinary: diff --git a/clusters/kairos/storage/localstorageconfigmap.yaml b/clusters/kairos/storage/localstorageconfigmap.yaml deleted file mode 100644 index 01789c4..0000000 --- a/clusters/kairos/storage/localstorageconfigmap.yaml +++ /dev/null @@ -1,34 +0,0 @@ -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 deleted file mode 100644 index 24ad121..0000000 --- a/clusters/kairos/storage/storageclass.yaml +++ /dev/null @@ -1,11 +0,0 @@ -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 diff --git a/kairos-config.yaml b/kairos-config.yaml index 3670cca..1ffaba0 100644 --- a/kairos-config.yaml +++ b/kairos-config.yaml @@ -12,6 +12,8 @@ users: # Enable K3s on the node. k3s: enabled: true # Set to true to enable K3s. + args: + - --disable=local-storage stages: boot: