Use our own install of local path

This commit is contained in:
2024-08-19 01:40:03 +01:00
parent 46988b5a12
commit adab3ce553
9 changed files with 47 additions and 50 deletions

View File

@@ -5,7 +5,7 @@ metadata:
spec: spec:
accessModes: accessModes:
- ReadWriteOncePod - ReadWriteOncePod
storageClassName: local-storage storageClassName: local-path
resources: resources:
requests: requests:
storage: 5Gi storage: 5Gi

View File

@@ -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]
}
]

View File

@@ -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/

View File

@@ -1,5 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- localstorageconfigmap.yaml - helmrelease.yaml
- storageclass.yaml - helmrepo.yaml

View File

@@ -16,4 +16,4 @@ spec:
values: values:
persistence: persistence:
enabled: true enabled: true
storageClassName: local-storage storageClassName: local-path

View File

@@ -45,7 +45,7 @@ spec:
minio: minio:
enabled: true enabled: true
persistence: persistence:
storageClass: local-storage storageClass: local-path
# Zero out replica counts of other deployment modes # Zero out replica counts of other deployment modes
singleBinary: singleBinary:

View File

@@ -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}"

View File

@@ -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

View File

@@ -12,6 +12,8 @@ users:
# Enable K3s on the node. # Enable K3s on the node.
k3s: k3s:
enabled: true # Set to true to enable K3s. enabled: true # Set to true to enable K3s.
args:
- --disable=local-storage
stages: stages:
boot: boot: