spoolman

by tina.junold

Helm chartv2.11.1App 0.27.1Verified publisher

Spoolman is a self-hosted web service designed to help you efficiently manage your 3D printer filament spools and monitor their usage.

About this chart

spoolman

Spoolman is a self-hosted web service designed to help you efficiently manage your 3D printer filament spools and monitor their usage.

Homepage: https://gitlab.com/ideaplexus/charts

Maintainers

NameEmailUrl
Tina Junold[email protected]https://ideaplexus.com

Source Code

Requirements

RepositoryNameVersion
https://charts.ideaplexus.comcommon1.1.0

Database

Spoolman supports SQLite, PostgreSQL, MySQL/MariaDB and CockroachDB. This chart deploys no database of its own: with the default database.type: sqlite it stores everything in a file under the data directory, and for anything else you point it at a database you run yourself.

Note that MariaDB uses type: mysql -- that is the value Spoolman expects.

SQLite, the default

Nothing to configure. Enable persistence so the file survives a restart:

persistence:
  enabled: true
  size: 1Gi

An existing database, password managed by the chart

The password goes into a secret the chart creates. It is mounted read-only and reaches the container as SPOOLMAN_DB_PASSWORD_FILE, so it never appears in the process environment.

persistence:
  enabled: false
database:
  type: postgres
  host: postgres.databases.svc.cluster.local
  port: 5432
  name: spoolman
  username: spoolman
  password: change-me

An existing database, credentials from your own secret

Preferred when the password is managed elsewhere, for example by an operator, External Secrets or SOPS. The chart then creates no secret of its own.

database:
  type: mysql
  host: mariadb.databases.svc.cluster.local
  port: 3306
  name: spoolman
  username: spoolman
  existingSecret: spoolman-db-credentials
  existingSecretPasswordKey: db-password
kubectl create secret generic spoolman-db-credentials \
  --from-literal=db-password='change-me'

A database deployed alongside the release

database.host is evaluated as a template, so it can reference the release it is installed with. With CloudNativePG, whose cluster secret already carries a password key:

database:
  type: postgres
  host: "{{ .Release.Name }}-pg-rw"
  port: 5432
  name: spoolman
  username: spoolman
  existingSecret: "{{ .Release.Name }}-pg-app"
  existingSecretPasswordKey: password

Connecting over a socket

database.query is appended to the connection URL:

database:
  type: mysql
  host: localhost
  name: spoolman
  username: spoolman
  query: "unix_socket=/var/run/mysqld/mysqld.sock"

What is checked

Rendering fails with a named error rather than producing a connection Spoolman cannot use, when database.type is not sqlite and

  • database.host is empty,
  • database.name is empty, or
  • both database.password and database.existingSecret are set.

Probes

All three probes are configurable, and a startupProbe is enabled by default. While it runs, the liveness and readiness probes are not evaluated, so a slow first start -- Spoolman runs its database migration there -- cannot be interrupted. Its defaults allow roughly five minutes.

startupProbe:
  enabled: true
  periodSeconds: 10
  failureThreshold: 30   # 30 * 10s before the container is restarted

To replace a probe wholesale, for a different endpoint or an exec check, disable the built-in one and set its custom counterpart:

livenessProbe:
  enabled: false
customLivenessProbe:
  httpGet:
    path: /api/v1/health
    port: http
  periodSeconds: 30

Values

KeyTypeDefaultDescription
affinityobject{}Affinity for pod assignment
argslist[]Override default container args (useful when using custom images)
clusterDomainstring"cluster.local"Default Kubernetes cluster domain
commandlist[]Override default container command (useful when using custom images)
commonAnnotationsobject{}Annotations to add to all deployed resources
commonLabelsobject{}Labels to add to all deployed resources
containerPorts.httpstring"8000"HTTP port
containerSecurityContext.allowPrivilegeEscalationboolfalseSet Spoolman container's Security Context allowPrivilegeEscalation
containerSecurityContext.capabilities.droplist["ALL"]List of capabilities to be dropped
containerSecurityContext.enabledboolfalseEnable or disable Spoolman containers' Security Context
containerSecurityContext.privilegedboolfalseSet Spoolman container's Security Context privileged
containerSecurityContext.readOnlyRootFilesystembooltrueSet Spoolman container's Security Context readOnlyRootFilesystem
containerSecurityContext.runAsGroupint1000Set Spoolman containers' Security Context runAsGroup
containerSecurityContext.runAsNonRootbooltrueSet Controller container's Security Context runAsNonRoot
containerSecurityContext.runAsUserint1000Set Spoolman containers' Security Context runAsUser
containerSecurityContext.seLinuxOptionsobject{}Set SELinux options in container
containerSecurityContext.seccompProfile.typestring"RuntimeDefault"
customLivenessProbeobject{}A complete probe replacing the built-in livenessProbe. Only used when livenessProbe.enabled is false.
customReadinessProbeobject{}A complete probe replacing the built-in readinessProbe. Only used when readinessProbe.enabled is false.
customStartupProbeobject{}A complete probe replacing the built-in startupProbe. Only used when startupProbe.enabled is false.
database.existingSecretstring""Name of an existing secret holding the password, instead of letting the chart create one. Evaluated as a template.
database.existingSecretPasswordKeystring"password"Key inside the secret that holds the password
database.hoststring""Database host. Evaluated as a template, so {{ .Release.Name }}-postgresql works. Required unless type is sqlite.
database.namestring"spoolman"Database name. Required unless type is sqlite.
database.passwordstring""Database password. Stored in a generated secret and mounted as a file, never passed through the environment. Mutually exclusive with existingSecret.
database.portstring""Database port. Left out when empty, so the driver's default applies.
database.querystring""Extra connection parameters, for example unix_socket=/var/run/mysqld/mysqld.sock
database.typestring"sqlite"Database backend. Use mysql for MariaDB. With sqlite no other field applies.
database.usernamestring"spoolman"Database user
extraDeploylist[]Array of extra objects to deploy with the release
extraEnvVarslist[]Extra environment variables
extraEnvVarsCMlist[]ConfigMaps containing extra env vars
extraEnvVarsSecretlist[]Secret containing extra env vars (in case of sensitive data)
fullnameOverridestring""String to fully override common.names.fullname template
global.defaultStorageClassstring""Global default StorageClass for Persistent Volume(s)
global.imagePullSecretslist[]Global Docker registry secret names
global.imageRegistrystring""Global Docker image registry
image.digeststring""Spoolman image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag
image.pullPolicystring"IfNotPresent"Spoolman image pull policy
image.pullSecretslist[]Spoolman image pull secrets
image.registrystring"ghcr.io"Spoolman image registry
image.repositorystring"donkie/spoolman"Spoolman image repository
image.tagstring""Spoolman image tag
ingress.annotationsobject{}Additional annotations for the Ingress resource.
ingress.apiVersionstring""Override API Version (automatically detected if not set)
ingress.enabledboolfalseSet to true to enable ingress record generation
ingress.extraHostslist[]ingress.extraHosts The list of additional hostnames to be covered with this ingress record.
ingress.extraPathslist[]Any additional arbitrary paths that may need to be added to the ingress under the main host.
ingress.extraRuleslist[]Additional rules to be covered with this ingress record
ingress.extraTlslist[]The tls configuration for additional hostnames to be covered with this ingress record.
ingress.hostnamestring"spoolman.local"When the ingress is enabled, a host pointing to this will be created
ingress.ingressClassNamestring""IngressClass that will be used to implement the Ingress (Kubernetes 1.18+)
ingress.pathstring"/"Default path for the ingress resource
ingress.pathTypestring"ImplementationSpecific"Ingress Path type
ingress.secretslist[]Extra secrets
ingress.selfSignedboolfalseCreate a TLS secret for this ingress record using self-signed certificates generated by Helm
ingress.tlsboolfalseEnable TLS configuration for the hostname
kubeVersionstring""Force target Kubernetes version (using Helm capabilities if not set)
livenessProbe.enabledbooltrueEnable the built-in livenessProbe. initialDelaySeconds can stay at 0 while the startup probe is enabled; without it, raise this to cover the first start.
livenessProbe.failureThresholdint6Consecutive failures tolerated before the check counts as failed
livenessProbe.initialDelaySecondsint0Seconds to wait before the first check
livenessProbe.periodSecondsint10Seconds between checks
livenessProbe.successThresholdint1Consecutive successes needed after a failure
livenessProbe.timeoutSecondsint5Seconds after which a check times out
nameOverridestring""String to partially override common.names.fullname template (will maintain the release name)
namespaceOverridestring""String to override the common.names.namespace template
nodeAffinityPresetobject{"key":"","type":"","values":[]}Node affinity preset
nodeAffinityPreset.keystring""Node label key to match Ignored if affinity is set.
nodeAffinityPreset.typestring""Node affinity preset type. Ignored if affinity is set. Allowed values: soft or hard
nodeAffinityPreset.valueslist[]Node label values to match. Ignored if affinity is set.
nodeSelectorobject{}Node labels for pod assignment. Evaluated as a template
persistence.accessModestring"ReadWriteOnce"Persistent Volume Access Mode
persistence.accessModeslist[]Persistent Volume Access Modes
persistence.annotationsobject{}Persistent Volume Claim annotations
persistence.dataSourceobject{}Custom PVC data source
persistence.enabledboolfalseEnable persistence
persistence.existingClaimstring""A manually managed Persistent Volume Claim
persistence.finalizerslist["kubernetes.io/pvc-protection"]PVC finalizers
persistence.hostPathstring""If defined, the spoolman-data volume will mount to the specified hostPath.
persistence.lookupVolumeNamebooltrueIf 'lookupVolumeName' is set to true, Helm will attempt to retrieve the current value of 'spec.volumeName' and incorporate it into the template.
persistence.selectorobject{}Selector to match an existing Persistent Volume for Spoolman data PVC
persistence.sizestring"1Gi"PVC Storage Request Size for Spoolman volume
persistence.storageClassstring""Storage class to use with the PVC
persistence.typestring"pvc"Persistence type
podAffinityPresetstring""Pod affinity preset. Ignored if affinity is set. Allowed values: soft or hard
podAnnotationsobject{}Pod annotations
podAntiAffinityPresetstring"soft"Pod anti-affinity preset. Ignored if affinity is set. Allowed values: soft or hard
podLabelsobject{}Pod labels
podManagementPolicystring""podManagementPolicy to manage scaling operation of Spoolman pods
podSecurityContext.enabledbooltrueEnable or disable Spoolman pods' Security Context
podSecurityContext.fsGroupint1000Spoolman pods' group ID
podSecurityContext.fsGroupChangePolicystring"Always"Set filesystem group change policy
podSecurityContext.supplementalGroupslist[]Set filesystem extra groups
podSecurityContext.sysctlslist[]Set kernel settings using the sysctl interface
priorityClassNamestring""Spoolman pods' priorityClassName
readinessProbe.enabledbooltrueEnable the built-in readinessProbe.
readinessProbe.failureThresholdint6Consecutive failures tolerated before the check counts as failed
readinessProbe.initialDelaySecondsint0Seconds to wait before the first check
readinessProbe.periodSecondsint10Seconds between checks
readinessProbe.successThreshold

Deploy spoolman with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has spoolman on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartspoolman is pinned at v2.11.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply