Joey Hafner
ccde72e4ab
Some checks failed
Deploy NixOS System Configurations to Silver-Flame Hosts / deploy (push) Failing after 25s
- Move old Terraform files to archive - Move from nix/nix-lab to homelab/silver-flame
44 lines
1.3 KiB
YAML
44 lines
1.3 KiB
YAML
---
|
|
apiVersion: kyverno.io/v1
|
|
kind: ClusterPolicy
|
|
metadata:
|
|
name: longhorn-add-nixos-path
|
|
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-nixos-path
|
|
containers:
|
|
- (name): "*"
|
|
envFrom:
|
|
- configMapRef:
|
|
name: longhorn-nixos-path
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: longhorn-nixos-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 |