Skip to content

Commit

Permalink
update ps5 auth storage volume
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codes committed Jan 18, 2025
1 parent abbba0c commit cf95bea
Show file tree
Hide file tree
Showing 9 changed files with 171 additions and 162 deletions.
104 changes: 52 additions & 52 deletions apps/alexa/deployment/index.jsonnet
Original file line number Diff line number Diff line change
@@ -1,108 +1,108 @@
local lib = import '../../../packages/deployment-utils/dist/index.libsonnet';
local k = import 'github.com/jsonnet-libs/k8s-libsonnet/1.29/main.libsonnet';
local lib = import "../../../packages/deployment-utils/dist/index.libsonnet";
local k = import "github.com/jsonnet-libs/k8s-libsonnet/1.29/main.libsonnet";

local ttsVolume = lib.volume.persistentNfsVolume.new('piper-data', '40Gi', std.extVar('nfsIp'), std.extVar('nfsUsername'), std.extVar('nfsPassword'))
local ttsVolume = lib.volume.persistentNfsVolume.new("piper-data", "40Gi", std.extVar("nfsIp"))
;
local ttsContainer = k.core.v1.container.new(name='piper', image='rhasspy/wyoming-piper')
+ k.core.v1.container.withImagePullPolicy('Always')
local ttsContainer = k.core.v1.container.new(name="piper", image="rhasspy/wyoming-piper")
+ k.core.v1.container.withImagePullPolicy("Always")
+ k.core.v1.container.withPorts({
name: 'piper',
name: "piper",
containerPort: 10200,
protocol: 'TCP',
protocol: "TCP",
},)
+ { volumeMounts: [k.core.v1.volumeMount.new('piper-data', '/data')] }
+ { args: ['--voice', 'en_US-hfc_female-medium', '--debug'] }
+ { volumeMounts: [k.core.v1.volumeMount.new("piper-data", "/data")] }
+ { args: ["--voice", "en_US-hfc_female-medium", "--debug"] }
+ k.core.v1.container.withEnv([
{ name: 'TZ', value: 'America/New_York' },
{ name: "TZ", value: "America/New_York" },
])
;
local ttsDeployment = k.apps.v1.deployment.new(name='piper', containers=[ttsContainer],)
+ k.apps.v1.deployment.spec.template.spec.withImagePullSecrets({ name: 'regcred' },)
+ k.apps.v1.deployment.spec.template.spec.withServiceAccount('app',)
+ { spec+: { template+: { spec+: { volumes: [k.core.v1.volume.fromPersistentVolumeClaim('piper-data', 'piper-data-pvc')] } } } }
local ttsDeployment = k.apps.v1.deployment.new(name="piper", containers=[ttsContainer],)
+ k.apps.v1.deployment.spec.template.spec.withImagePullSecrets({ name: "regcred" },)
+ k.apps.v1.deployment.spec.template.spec.withServiceAccount("app",)
+ { spec+: { template+: { spec+: { volumes: [k.core.v1.volume.fromPersistentVolumeClaim("piper-data", "piper-data-pvc")] } } } }
;
local ttsService = k.core.v1.service.new('piper', { name: 'piper' }, [{
name: 'piper',
local ttsService = k.core.v1.service.new("piper", { name: "piper" }, [{
name: "piper",
port: 10200,
protocol: 'TCP',
targetPort: 'piper',
protocol: "TCP",
targetPort: "piper",
}],);


local sttVolume = lib.volume.persistentNfsVolume.new('whisper-data', '80Gi', std.extVar('nfsIp'), std.extVar('nfsUsername'), std.extVar('nfsPassword'))
local sttVolume = lib.volume.persistentNfsVolume.new("whisper-data", "80Gi", std.extVar("nfsIp"))
;
local sttContainer = k.core.v1.container.new(name='whisper', image=std.extVar('whisperImage')) + k.core.v1.container.withImagePullPolicy('Always')
local sttContainer = k.core.v1.container.new(name="whisper", image=std.extVar("whisperImage")) + k.core.v1.container.withImagePullPolicy("Always")
+ k.core.v1.container.withPorts({
name: 'whisper',
name: "whisper",
containerPort: 10300,
protocol: 'TCP',
protocol: "TCP",
},)
+ { volumeMounts: [k.core.v1.volumeMount.new('whisper-data', '/data')] }
+ { args: ['--model', 'tiny-int8', '--language', 'en'] }
+ { volumeMounts: [k.core.v1.volumeMount.new("whisper-data", "/data")] }
+ { args: ["--model", "tiny-int8", "--language", "en"] }
+ k.core.v1.container.withEnv([
{ name: 'TZ', value: 'America/New_York' },
{ name: "TZ", value: "America/New_York" },
])
+
{
resources: {
limits: {
'aliyun.com/gpu-mem': 4,
"aliyun.com/gpu-mem": 4,
},
},
}
;
local sttDeployment = k.apps.v1.deployment.new(name='whisper', containers=[sttContainer],)
+ k.apps.v1.deployment.spec.template.spec.withImagePullSecrets({ name: 'regcred' },)
+ k.apps.v1.deployment.spec.template.spec.withServiceAccount('app',)
local sttDeployment = k.apps.v1.deployment.new(name="whisper", containers=[sttContainer],)
+ k.apps.v1.deployment.spec.template.spec.withImagePullSecrets({ name: "regcred" },)
+ k.apps.v1.deployment.spec.template.spec.withServiceAccount("app",)
+ { spec+: {
template+: {

spec+: {
// tolerations: [
// { key: 'nvidia.com/gpu', operator: 'Exists', effect: 'NoSchedule' },
// ],
volumes: [k.core.v1.volume.fromPersistentVolumeClaim('whisper-data', 'whisper-data-pvc')],
volumes: [k.core.v1.volume.fromPersistentVolumeClaim("whisper-data", "whisper-data-pvc")],
},
},
} }
;
local sttService = k.core.v1.service.new('whisper', { name: 'whisper' }, [{
name: 'whisper',
local sttService = k.core.v1.service.new("whisper", { name: "whisper" }, [{
name: "whisper",
port: 10300,
protocol: 'TCP',
targetPort: 'whisper',
protocol: "TCP",
targetPort: "whisper",
}],);

local wakeWordVolumeData = lib.volume.persistentNfsVolume.new('open-wake-word-data', '40Gi', std.extVar('nfsIp'), std.extVar('nfsUsername'), std.extVar('nfsPassword'))
local wakeWordVolumeData = lib.volume.persistentNfsVolume.new("open-wake-word-data", "40Gi", std.extVar("nfsIp"))
;
local wakeWordVolumeCustom = lib.volume.persistentNfsVolume.new('open-wake-word-custom', '40Gi', std.extVar('nfsIp'), std.extVar('nfsUsername'), std.extVar('nfsPassword'))
local wakeWordVolumeCustom = lib.volume.persistentNfsVolume.new("open-wake-word-custom", "40Gi", std.extVar("nfsIp"))
;
local wakeWordContainer = k.core.v1.container.new(name='open-wake-word', image='rhasspy/wyoming-openwakeword')
+ k.core.v1.container.withImagePullPolicy('Always')
local wakeWordContainer = k.core.v1.container.new(name="open-wake-word", image="rhasspy/wyoming-openwakeword")
+ k.core.v1.container.withImagePullPolicy("Always")
+ k.core.v1.container.withPorts({
name: 'open-wake-word',
name: "open-wake-word",
containerPort: 10400,
protocol: 'TCP',
protocol: "TCP",
},)
+ { volumeMounts: [k.core.v1.volumeMount.new('open-wake-word-data', '/data'), k.core.v1.volumeMount.new('open-wake-word-custom', '/custom')] }
+ { volumeMounts: [k.core.v1.volumeMount.new("open-wake-word-data", "/data"), k.core.v1.volumeMount.new("open-wake-word-custom", "/custom")] }
+ k.core.v1.container.withEnv([
{ name: 'TZ', value: 'America/New_York' },
{ name: "TZ", value: "America/New_York" },
])
+ { args: ['--preload-model', 'alexa'] }
+ { args: ["--preload-model", "alexa"] }
;
local wakeWordDeployment = k.apps.v1.deployment.new(name='open-wake-word', containers=[wakeWordContainer],)
+ k.apps.v1.deployment.spec.template.spec.withImagePullSecrets({ name: 'regcred' },)
+ k.apps.v1.deployment.spec.template.spec.withServiceAccount('app',)
local wakeWordDeployment = k.apps.v1.deployment.new(name="open-wake-word", containers=[wakeWordContainer],)
+ k.apps.v1.deployment.spec.template.spec.withImagePullSecrets({ name: "regcred" },)
+ k.apps.v1.deployment.spec.template.spec.withServiceAccount("app",)
+ { spec+: { template+: { spec+: { volumes: [
k.core.v1.volume.fromPersistentVolumeClaim('open-wake-word-data', 'open-wake-word-data-pvc'),
k.core.v1.volume.fromPersistentVolumeClaim('open-wake-word-custom', 'open-wake-word-custom-pvc'),
k.core.v1.volume.fromPersistentVolumeClaim("open-wake-word-data", "open-wake-word-data-pvc"),
k.core.v1.volume.fromPersistentVolumeClaim("open-wake-word-custom", "open-wake-word-custom-pvc"),
] } } } }
;
local wakeWordService = k.core.v1.service.new('open-wake-word', { name: 'open-wake-word' }, [{
name: 'open-wake-word',
local wakeWordService = k.core.v1.service.new("open-wake-word", { name: "open-wake-word" }, [{
name: "open-wake-word",
port: 10400,
protocol: 'TCP',
targetPort: 'open-wake-word',
protocol: "TCP",
targetPort: "open-wake-word",
}],)
;

Expand Down
36 changes: 18 additions & 18 deletions apps/home-assistant/deployment/index.jsonnet
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
local secrets = import '../../../apps/secrets/dist/secrets.jsonnet';
local lib = import '../../../packages/deployment-utils/dist/index.libsonnet';
local k = import 'github.com/jsonnet-libs/k8s-libsonnet/1.29/main.libsonnet';
local secrets = import "../../../apps/secrets/dist/secrets.jsonnet";
local lib = import "../../../packages/deployment-utils/dist/index.libsonnet";
local k = import "github.com/jsonnet-libs/k8s-libsonnet/1.29/main.libsonnet";

local deployment = lib.deployment.new(std.extVar('name'), std.extVar('image'), std.extVar('secrets'), '', '8123')
local deployment = lib.deployment.new(std.extVar("name"), std.extVar("image"), std.extVar("secrets"), "", "8123")
+ lib.deployment.withEnvVars(0, [
{ name: 'DEBUG', value: '' },
{ name: 'MQTT_HOST', value: 'mqtt' },
{ name: 'MQTT_PORT', value: '1883' },
{ name: "DEBUG", value: "" },
{ name: "MQTT_HOST", value: "mqtt" },
{ name: "MQTT_PORT", value: "1883" },
])
+ lib.deployment.withInitContainer('mqtt-is-ready', std.extVar('registryHostname') + '/mqtt-client:latest', { env: [secrets['mqtt/username'], secrets['mqtt/password']], command: ['sh'], args: ['-c', 'timeout 10 sub -h mqtt -t "\\$SYS/#" -C 1 -u $MQTT_USERNAME -P $MQTT_PASSWORD | grep -v Error || exit 1'] })
+ lib.deployment.withPersistentVolume('home-assistant-config')
+ lib.deployment.withProbe(0, '/')
+ lib.deployment.withVolumeMount(0, k.core.v1.volumeMount.new('home-assistant-config', '/config',))
+ lib.deployment.withInitContainer("mqtt-is-ready", std.extVar("registryHostname") + "/mqtt-client:latest", { env: [secrets["mqtt/username"], secrets["mqtt/password"]], command: ["sh"], args: ["-c", 'timeout 10 sub -h mqtt -t "\\$SYS/#" -C 1 -u $MQTT_USERNAME -P $MQTT_PASSWORD | grep -v Error || exit 1'] })
+ lib.deployment.withPersistentVolume("home-assistant-config")
+ lib.deployment.withProbe(0, "/")
+ lib.deployment.withVolumeMount(0, k.core.v1.volumeMount.new("home-assistant-config", "/config",))
+ lib.deployment.withSecurityContext(0, { privileged: true, allowPrivilegeEscalation: true },)
+ lib.deployment.withEnvVars(0, [secrets['home-assistant/token'], secrets['home-assistant/server']],)
+ lib.deployment.withEnvVars(0, [secrets["home-assistant/token"], secrets["home-assistant/server"]],)
+ lib.deployment.withSecurityContext(0, { privileged: true, allowPrivilegeEscalation: true },)
+ {
deployment+: {
Expand All @@ -23,9 +23,9 @@ local deployment = lib.deployment.new(std.extVar('name'), std.extVar('image'), s
containers:
[super.containers[0] { volumeMounts+: [
{
name: 'docker-env-empty-dir',
mountPath: '/.dockerenv',
subPath: '.dockerenv',
name: "docker-env-empty-dir",
mountPath: "/.dockerenv",
subPath: ".dockerenv",
},
] }] + super.containers[1:],
},
Expand All @@ -40,7 +40,7 @@ local deployment = lib.deployment.new(std.extVar('name'), std.extVar('image'), s
spec+: {
volumes+: [
{
name: 'docker-env-empty-dir',
name: "docker-env-empty-dir",
emptyDir: {},
},
],
Expand All @@ -50,11 +50,11 @@ local deployment = lib.deployment.new(std.extVar('name'), std.extVar('image'), s
},
}
;
local haVolume = lib.volume.persistentNfsVolume.new('home-assistant-config', '10Gi', std.extVar('nfsIp'), std.extVar('nfsUsername'), std.extVar('nfsPassword'))
local haVolume = lib.volume.persistentNfsVolume.new("home-assistant-config", "10Gi", std.extVar("nfsIp"))
;


// local espHomeConfigVolume = lib.volume.persistentNfsVolume.new('esphome-config', '10Gi', std.extVar('nfsIp'), std.extVar('nfsUsername'), std.extVar('nfsPassword'))
// local espHomeConfigVolume = lib.volume.persistentNfsVolume.new('esphome-config', '10Gi', std.extVar('nfsIp'))
// ;
// local espGitConfigVolume = k.core.v1.configMap.new('esphome-gitconfig', { '.gitconfig': '[safe]\n directory = *' })
// ;
Expand Down
30 changes: 15 additions & 15 deletions apps/influxdb/deployment/index.jsonnet
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
local lib = import '../../../packages/deployment-utils/dist/index.libsonnet';
local k = import 'github.com/jsonnet-libs/k8s-libsonnet/1.29/main.libsonnet';
local lib = import "../../../packages/deployment-utils/dist/index.libsonnet";
local k = import "github.com/jsonnet-libs/k8s-libsonnet/1.29/main.libsonnet";

local deployment = lib.deployment.new(std.extVar('name'), std.extVar('image'), std.extVar('secrets'), std.extVar('port'), '8086')
local deployment = lib.deployment.new(std.extVar("name"), std.extVar("image"), std.extVar("secrets"), std.extVar("port"), "8086")
+ lib.deployment.withEnvVars(0, [
{ name: 'DOCKER_INFLUXDB_INIT_MODE', value: 'setup' },
{ name: 'DOCKER_INFLUXDB_INIT_USERNAME', value: std.extVar('DOCKER_INFLUXDB_INIT_USERNAME') },
{ name: 'DOCKER_INFLUXDB_INIT_PASSWORD', value: std.extVar('DOCKER_INFLUXDB_INIT_PASSWORD') },
{ name: 'DOCKER_INFLUXDB_INIT_ORG', value: std.extVar('DOCKER_INFLUXDB_INIT_ORG') },
{ name: 'DOCKER_INFLUXDB_INIT_BUCKET', value: std.extVar('DOCKER_INFLUXDB_INIT_BUCKET') },
{ name: "DOCKER_INFLUXDB_INIT_MODE", value: "setup" },
{ name: "DOCKER_INFLUXDB_INIT_USERNAME", value: std.extVar("DOCKER_INFLUXDB_INIT_USERNAME") },
{ name: "DOCKER_INFLUXDB_INIT_PASSWORD", value: std.extVar("DOCKER_INFLUXDB_INIT_PASSWORD") },
{ name: "DOCKER_INFLUXDB_INIT_ORG", value: std.extVar("DOCKER_INFLUXDB_INIT_ORG") },
{ name: "DOCKER_INFLUXDB_INIT_BUCKET", value: std.extVar("DOCKER_INFLUXDB_INIT_BUCKET") },
])
+ lib.deployment.withPersistentVolume('influxdb-data')
+ lib.deployment.withPersistentVolume('influxdb-config')
+ lib.deployment.withVolumeMount(0, k.core.v1.volumeMount.new('influxdb-data', '/var/lib/influxdb2',))
+ lib.deployment.withVolumeMount(0, k.core.v1.volumeMount.new('influxdb-config', '/etc/influxdb2',))
+ lib.deployment.withPersistentVolume("influxdb-data")
+ lib.deployment.withPersistentVolume("influxdb-config")
+ lib.deployment.withVolumeMount(0, k.core.v1.volumeMount.new("influxdb-data", "/var/lib/influxdb2",))
+ lib.deployment.withVolumeMount(0, k.core.v1.volumeMount.new("influxdb-config", "/etc/influxdb2",))
;

local dataVolume = lib.volume.persistentNfsVolume.new('influxdb-data', '150Gi', std.extVar('nfsIp'), std.extVar('nfsUsername'), std.extVar('nfsPassword'))
local dataVolume = lib.volume.persistentNfsVolume.new("influxdb-data", "150Gi", std.extVar("nfsIp"))
;
local configVolume = lib.volume.persistentNfsVolume.new('influxdb-config', '30Gi', std.extVar('nfsIp'), std.extVar('nfsUsername'), std.extVar('nfsPassword'))
local configVolume = lib.volume.persistentNfsVolume.new("influxdb-config", "30Gi", std.extVar("nfsIp"))
;
local telegrafConfigVolume = lib.volume.persistentVolume.new('telegraf-config', '10Gi')
local telegrafConfigVolume = lib.volume.persistentVolume.new("telegraf-config", "10Gi")
;

dataVolume + configVolume + std.objectValues(deployment) + telegrafConfigVolume
Loading

0 comments on commit cf95bea

Please sign in to comment.