Skip to content

Commit

Permalink
fix(esphome): Add cache PVC for build/platformio caches
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Nov 1, 2024
1 parent 7e938ad commit 39a19df
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
36 changes: 32 additions & 4 deletions kubernetes/gabernetes/apps/esphome/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ spec:
runAsNonRoot: true
runAsUser: 65534
runAsGroup: 65534
fsGroup: 65534
fsGroupChangePolicy: OnRootMismatch
seccompProfile: { type: RuntimeDefault }

controllers:
Expand All @@ -45,7 +47,14 @@ spec:
env:
TZ: America/Chicago
ESPHOME_DASHBOARD_USE_PING: true
PLATFORMIO_CORE_DIR: .tmp/platformio
# From https://github.com/ptr727/ESPHome-NonRoot
PLATFORMIO_CORE_DIR: /cache/pio
# ESPHome "build_path" option, default is "/config/.esphome/build/[project]"
ESPHOME_BUILD_PATH: /cache/build
# ESPHome "data_dir" option, default is "/config/.esphome"
ESPHOME_DATA_DIR: /cache/data
# Set pip cache directory, default is "~/.cache/pip"
PIP_CACHE_DIR: /cache/pip
probes:
startup:
enabled: true
Expand Down Expand Up @@ -81,8 +90,8 @@ spec:
- --disable-telemetry
- --disable-update-check
- --auth=none
- --user-data-dir=/config/.vscode
- --extensions-dir=/config/.vscode
- --user-data-dir=/cache
- --extensions-dir=/cache
- /config
resources:
limits:
Expand Down Expand Up @@ -116,9 +125,28 @@ spec:
accessMode: ReadWriteMany
size: 8Gi
retain: true
nonexistent:
cache:
enabled: true
storageClass: longhorn-ssd
accessMode: ReadWriteOnce
size: 8Gi
advancedMounts:
esphome:
app:
- path: /cache
subPath: esphome
code:
app:
- path: /cache
subPath: code
tmp:
enabled: true
type: emptyDir
globalMounts:
- path: /nonexistent
subPath: home
- path: /tmp
subPath: tmp

ingress:
esphome:
Expand Down
4 changes: 0 additions & 4 deletions kubernetes/gabernetes/apps/esphome/borgmatic/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ spec:
label: borgbase
source_directories:
- /esphome-config
exclude_patterns:
- /esphome-config/.esphome
- /esphome-config/.tmp
- /esphome-config/build
archive_name_format: "esphome-{now:%Y-%m-%d-%H%M%S}"
ssh_command: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR
retries: 2
Expand Down

0 comments on commit 39a19df

Please sign in to comment.