From da280d229ba2329c80a6005ed0ebe9fde62470d3 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Mon, 3 Apr 2023 00:12:37 -0400 Subject: [PATCH] I dont think I need raw --- cluster/core/storage/longhorn/helm.yaml | 171 +++++++++++++++--------- 1 file changed, 111 insertions(+), 60 deletions(-) diff --git a/cluster/core/storage/longhorn/helm.yaml b/cluster/core/storage/longhorn/helm.yaml index c503be8..21c1f9c 100644 --- a/cluster/core/storage/longhorn/helm.yaml +++ b/cluster/core/storage/longhorn/helm.yaml @@ -62,66 +62,117 @@ spec: interval: 1m --- # ================= Release for incubator/raw ================= -apiVersion: helm.toolkit.fluxcd.io/v2beta1 -kind: HelmRelease +#apiVersion: helm.toolkit.fluxcd.io/v2beta1 +#kind: HelmRelease +#metadata: +# name: raw +# namespace: longhorn-system +#spec: +# interval: 5m +# dependsOn: +# - name: kyverno +# namespace: longhorn-system +# chart: +# spec: +# chart: raw +# version: '2.0.0' +# sourceRef: +# kind: HelmRepository +# name: raw-charts +# namespace: flux-system +# interval: 1m +# values: +# resources: +# - apiVersion: v1 +# kind: ConfigMap +# metadata: +# name: longhorn-custom-path +# namespace: longhorn-system +# data: +# PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/run/wrappers/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin +# - apiVersion: kyverno.io/v1 +# kind: ClusterPolicy +# metadata: +# name: add-host-path-to-longhorn +# annotations: +# policies.kyverno.io/title: Add Environment Variables from ConfigMap +# policies.kyverno.io/subject: Pod +# policies.kyverno.io/category: Other +# policies.kyverno.io/description: >- +# Longhorn invokes executables on the host system, and needs +# to be aware of the host systems PATH. This modifies all +# deployments such that the PATH is explicitly set to support +# NixOS based systems. +# spec: +# rules: +# - name: add-env-vars +# match: +# resources: +# kinds: +# - Pod +# namespaces: +# - longhorn-system +# mutate: +# patchStrategicMerge: +# spec: +# initContainers: +# - (name): "*" +# envFrom: +# - configMapRef: +# name: longhorn-custom-path +# containers: +# - (name): "*" +# envFrom: +# - configMapRef: +# name: longhorn-custom-path + + + + + + + +--- +apiVersion: v1 +kind: ConfigMap metadata: - name: raw + name: longhorn-custom-path namespace: longhorn-system +data: + PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/run/wrappers/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin +--- +apiVersion: kyverno.io/v1 +kind: ClusterPolicy +metadata: + name: add-host-path-to-longhorn + annotations: + policies.kyverno.io/title: Add Environment Variables from ConfigMap + policies.kyverno.io/subject: Pod + policies.kyverno.io/category: Other + policies.kyverno.io/description: >- + Longhorn invokes executables on the host system, and needs + to be aware of the host systems PATH. This modifies all + deployments such that the PATH is explicitly set to support + NixOS based systems. spec: - interval: 5m - dependsOn: - - name: kyverno - namespace: longhorn-system - chart: - spec: - chart: raw - version: '2.0.0' - sourceRef: - kind: HelmRepository - name: raw-charts - namespace: flux-system - interval: 1m - values: - resources: - - apiVersion: v1 - kind: ConfigMap - metadata: - name: longhorn-custom-path - namespace: longhorn-system - data: - PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/run/wrappers/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin - - apiVersion: kyverno.io/v1 - kind: ClusterPolicy - metadata: - name: add-host-path-to-longhorn - annotations: - policies.kyverno.io/title: Add Environment Variables from ConfigMap - policies.kyverno.io/subject: Pod - policies.kyverno.io/category: Other - policies.kyverno.io/description: >- - Longhorn invokes executables on the host system, and needs - to be aware of the host systems PATH. This modifies all - deployments such that the PATH is explicitly set to support - NixOS based systems. - spec: - rules: - - name: add-env-vars - match: - resources: - kinds: - - Pod - namespaces: - - longhorn-system - mutate: - patchStrategicMerge: - spec: - initContainers: - - (name): "*" - envFrom: - - configMapRef: - name: longhorn-custom-path - containers: - - (name): "*" - envFrom: - - configMapRef: - name: longhorn-custom-path \ No newline at end of file + rules: + - name: add-env-vars + match: + resources: + kinds: + - Pod + namespaces: + - longhorn-system + mutate: + patchStrategicMerge: + spec: + initContainers: + - (name): "*" + envFrom: + - configMapRef: + name: longhorn-custom-path + containers: + - (name): "*" + envFrom: + - configMapRef: + name: longhorn-custom-path \ No newline at end of file