Skip to content

Commit

Permalink
feat: add longhorn
Browse files Browse the repository at this point in the history
  • Loading branch information
hugginsio committed Oct 27, 2024
1 parent 7fc17aa commit 3bdb5d4
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 0 deletions.
1 change: 1 addition & 0 deletions kubernetes/hyperlab/flux/repositories/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ kind: Kustomization
resources:
- "./ingress-nginx.yaml"
- "./jameswynn.yaml"
- "./longhorn.yaml"
- "./spegel.yaml"
- "./tailscale.yaml"
9 changes: 9 additions & 0 deletions kubernetes/hyperlab/flux/repositories/longhorn.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/helmrepository-source-v1.json
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: longhorn
namespace: flux-system
spec:
interval: 1h
url: "https://charts.longhorn.io"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- "./namespace.yaml"
###
- "./longhorn/ks.yaml"
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/refs/heads/main/helmrelease-helm-v2.json
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: &name longhorn
namespace: longhorn-system
spec:
interval: 10m
releaseName: *name
chart:
spec:
chart: *name
version: 1.7.2
sourceRef:
kind: HelmRepository
name: longhorn
namespace: flux-system
install:
remediation:
retries: &retries 3
upgrade:
cleanupOnFail: true
remediation:
retries: *retries
# https://longhorn.io/docs/1.7.2/advanced-resources/deploy/customizing-default-settings/#using-helm
values:
defaultSettings:
defaultDataPath: "/var/lib/longhorn"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- "./helmrelease.yaml"
20 changes: 20 additions & 0 deletions kubernetes/hyperlab/namespaces/longhorn-system/longhorn/ks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app longhorn
namespace: flux-system
spec:
targetNamespace: longhorn-system
commonMetadata:
labels:
app.kubernetes.io/name: *app
path: ./kubernetes/hyperlab/namespaces/longhorn-system/longhorn/app
prune: true
wait: true
sourceRef:
kind: GitRepository
name: homelab
interval: 10m
retryInterval: 1m
timeout: 5m
10 changes: 10 additions & 0 deletions kubernetes/hyperlab/namespaces/longhorn-system/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/yannh/kubernetes-json-schema/refs/heads/master/master-local/namespace-v1.json

apiVersion: v1
kind: Namespace
metadata:
name: longhorn-system
labels:
pod-security.kubernetes.io/audit: privileged
pod-security.kubernetes.io/enforce: privileged
pod-security.kubernetes.io/warn: privileged

0 comments on commit 3bdb5d4

Please sign in to comment.