From 37a9fed45bba15a79bc99c889489685515417376 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Sun, 16 Apr 2023 20:08:21 -0400 Subject: [PATCH] Change local-path-config --- .../core/kube-system/local-path-config.yaml | 79 +++++++++++++------ cluster/core/kustomization.yaml | 1 + 2 files changed, 56 insertions(+), 24 deletions(-) diff --git a/cluster/core/kube-system/local-path-config.yaml b/cluster/core/kube-system/local-path-config.yaml index 032e6b5..0f13375 100644 --- a/cluster/core/kube-system/local-path-config.yaml +++ b/cluster/core/kube-system/local-path-config.yaml @@ -5,28 +5,59 @@ metadata: namespace: kube-system data: config.json: |- - { - "nodePathMap":[ - { - "node":"DEFAULT_PATH_FOR_NON_LISTED_NODES", - "paths":[ "/mnt/MainPool/Kubernetes/local-path-provisioner" ] - }, - ] - } - setup: |- - #!/bin/sh - set -eu - mkdir -m 0777 -p "$VOL_DIR" - teardown: |- - #!/bin/sh - set -eu - rm -rf "$VOL_DIR" + { + "nodePathMap":[ + { + "node":"DEFAULT_PATH_FOR_NON_LISTED_NODES", + "paths":["/var/lib/rancher/k3s/storage"] + } + { + "node":"r720xd", + "paths":["/mnt/MainPool/Kubernetes/local-path-provisioner"] + } + ] + } helperPod.yaml: |- - apiVersion: v1 - kind: Pod - metadata: - name: helper-pod - spec: - containers: - - name: helper-pod - image: busybox \ No newline at end of file + apiVersion: v1 + kind: Pod + metadata: + name: helper-pod + spec: + containers: + - name: helper-pod + image: rancher/mirrored-library-busybox:1.34.1 + setup: |- + #!/bin/sh + while getopts "m:s:p:" opt + do + case $opt in + p) + absolutePath=$OPTARG + ;; + s) + sizeInBytes=$OPTARG + ;; + m) + volMode=$OPTARG + ;; + esac + done + mkdir -m 0777 -p ${absolutePath} + chmod 701 ${absolutePath}/.. + teardown: |- + #!/bin/sh + while getopts "m:s:p:" opt + do + case $opt in + p) + absolutePath=$OPTARG + ;; + s) + sizeInBytes=$OPTARG + ;; + m) + volMode=$OPTARG + ;; + esac + done + rm -rf ${absolutePath} \ No newline at end of file diff --git a/cluster/core/kustomization.yaml b/cluster/core/kustomization.yaml index c01b427..ac10ea5 100644 --- a/cluster/core/kustomization.yaml +++ b/cluster/core/kustomization.yaml @@ -1,6 +1,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: +- ./kube-system - ./helm-repositories.yaml - ./cert-manager - ./networking