feat: install local-path-provisioner with flux/helmrelease instead of k3s options

Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
Devin Buhl committed 2023-01-11 14:55:29 -05:00
1 parent 814ad434d5
commit 4a50941cee
10 files changed
+133 -6

No files matched your search

+6 -4
View File
@@ -16,12 +16,14 @@ k3s_server:
disable:
# Disable flannel - replaced with Calico
- flannel
# Disable traefik - replaced with ingress-nginx
- traefik
# Disable servicelb - replaced with metallb and install with Flux
- servicelb
# Disable local-path-provisioner - installed with Flux
- local-storage
# Disable metrics-server - installed with Flux
- metrics-server
# Disable servicelb - replaced with metallb and installed with Flux
- servicelb
# Disable traefik - replaced with ingress-nginx and installed with Flux
- traefik
disable-network-policy: true
disable-cloud-controller: true
write-kubeconfig-mode: "644"
@@ -2,7 +2,7 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: &app echo-server
name: echo-server
namespace: default
spec:
interval: 15m
@@ -4,5 +4,6 @@ kind: Kustomization
resources:
- ./namespace.yaml
- ./kube-vip/ks.yaml
- ./local-path-provisioner/ks.yaml
- ./metrics-server/ks.yaml
- ./reloader/ks.yaml
@@ -0,0 +1,71 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: local-path-provisioner
namespace: kube-system
spec:
interval: 15m
chart:
spec:
chart: ./deploy/chart/local-path-provisioner
sourceRef:
kind: GitRepository
name: local-path-provisioner
namespace: flux-system
maxHistory: 3
install:
createNamespace: true
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
retries: 3
uninstall:
keepHistory: false
values:
helperImage:
repository: public.ecr.aws/docker/library/busybox
tag: latest
storageClass:
defaultClass: false
nodePathMap:
- node: DEFAULT_PATH_FOR_NON_LISTED_NODES
paths: ["/var/lib/rancher/k3s/storage"]
configmap:
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}
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kube-system
resources:
- ./helmrelease.yaml
@@ -0,0 +1,23 @@
---
# yaml-language-server: $schema=https://kubernetes-schemas.devbu.io/kustomization_v1beta2.json
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: cluster-apps-local-path-provisioner
namespace: flux-system
labels:
substitution.flux.home.arpa/enabled: "true"
spec:
path: ./kubernetes/apps/kube-system/local-path-provisioner/app
prune: true
sourceRef:
kind: GitRepository
name: home-kubernetes
healthChecks:
- apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
name: local-path-provisioner
namespace: kube-system
interval: 30m
retryInterval: 1m
timeout: 3m
Whitespace-only changes.
@@ -0,0 +1,6 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./local-path-provisioner.yaml
@@ -0,0 +1,17 @@
---
# yaml-language-server: $schema=https://kubernetes-schemas.devbu.io/gitrepository_v1beta2.json
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: GitRepository
metadata:
name: local-path-provisioner
namespace: flux-system
spec:
interval: 30m
url: https://github.com/rancher/local-path-provisioner
ref:
tag: v0.0.23
ignore: |
# exclude all
/*
# include kubernetes directory
!/deploy/chart/local-path-provisioner
@@ -2,6 +2,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
# - ./git
- ./git
- ./helm
# - ./oci