snipeit

by Helm

Helm chartv3.4.1App v6.0.14

A free open source IT asset/license management system

About this chart

Snipe-IT

Snipeit-IT is free open source IT asset/license management system

Generate config.snipeit.key

In order for Snipe-IT to work correctly you need to set the yaml-key config.snipeit.key in the values.yaml. This must be a Base64 Encoded key, which you have to set before deploying this Chart.

$ docker run -i -t snipe/snipe-it php artisan key:generate --show

Then set the generated key from the output with --set config.snipeit.key when you're deploying.

TL;DR;

$ helm repo add t3n https://storage.googleapis.com/t3n-helm-charts
$ helm install t3n/snipeit --set config.snipeit.key="base64:....."

Introduction

This chart bootstraps a Snipe-IT deployment on a Kubernetes cluster using the Helm package manager.

Installing the Chart

To install the chart with the release name my-release:

$ helm install --name my-release t3n/snipeit --set config.snipeit.key="base64:....."

The command deploys Snipe-IT on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the Snipe-IT chart and their default values.

ParameterDescriptionDefault
config.mysql.externalDatabase.userUsername of external MySQL Database Usersnipeit
config.mysql.externalDatabase.passPassword of external MySQL Database User""
config.mysql.externalDatabase.nameName of external MySQL Databasedb-snipeit
config.mysql.externalDatabase.hostHostname/IP of external MySQL Databasemysql
config.mysql.externalDatabase.portPort of external MySQL Database3306
config.snipeit.envSnipe-IT Environment to useproduction
config.snipeit.debugWhether to enable Debug mode or notfalse
config.snipeit.urlURL of Snipe-IThttp://snipeit.example.local
config.snipeit.keyApplication-Key for Snipe-IT""
config.snipeit.timezoneSnipe-IT TimezoneEurope/Berlin
config.snipeit.localeSnipe-IT Localeen
config.snipeit.envConfigConfigure Environment Values{}
config.externalSecrets External Secrets to for db configuration[]
image.repositoryImage Repositorysnipe/snipe-it
image.tagImage Tag4.6.16
image.pullPolicyImage Pull PolicyIfNotPresent
ingress.enabledWhether or not to enable Ingresstrue
ingress.classNameIngress Class Name""
ingress.annotationsCustom Ingress Annotations{}
ingress.pathRoot Path for the Ingress Ressource/
ingress.hostsURL where Snipe-IT will be accessedexample.local
ingress.tlsConfiguration for SecretName and TLS-Hosts[]
mysql.enabledWhether or not to deploy a MySQL Deploymenttrue
mysql.mysqlUserMySQL User to createsnipeit
mysql.mysqlPasswordMySQL Password for the User""
mysql.mysqlDatabaseName of MySQL Database to createdb-snipeit
mysql.persistence.enabledWhether or not to enable Persistencetrue
mysql.persistence.storageClassStorageClass for MySQL Deployment persistence""
mysql.persistence.accessModeAccess Mode of PVReadWriteOnce
mysql.persistence.sizeSize of the PV8Gi
persistence.enabledWhether or not Snipe-IT Data should be persistedtrue
persistence.annotationsAnnotations for the PVC{}
persistence.sizeSize of the persistent Snipe-IT Volume2Gi
replicaCountNumber of Snipe-IT Pods to run1
deploymentStrategyDeployment strategy{ "type": "RollingUpdate" }
revisionHistoryLimitThe number of old Replicas to keep to allow rollback.0
service.typeType of service to createClusterIP
service.annotationsAnnotations of service to create{}
service.clusterIPInternal cluster service IPnil
service.loadBalancerIPIP address to assign to load balancer (if supported)nil
service.loadBalancerSourceRangeslist of IP CIDRs allowed access to lb (if supported)[]
service.externalIPsservice external IP addresses[]
resourcesCPU/Memory resource requests/limits{}
nodeSelectorNode labels for pod assignment{}
tolerationsToleration labels for pod assignment[]
affinityAffinity settings for pod assignment{}
extraManifestsAdd additional manifests to deploy[]
extraVolumeMountsAdditional volumeMounts to the container[]
extraVolumeAdditional volumes to the pod[]
Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,
$ helm install --name my-release \
  --set service.type=LoadBalancer \
    t3n/snipeit

The above command sets the service type LoadBalancer.

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

$ helm install --name my-release -f values.yaml t3n/snipeit

Tip: You can use the default values.yaml

Persistence

The Snipe-IT image stores persistence under /var/lib/snipeit path of the container. A dynamically managed Persistent Volume Claim is used to keep the data across deployments, by default. This is known to work in GCE, AWS, and minikube. Alternatively, a previously configured Persistent Volume Claim can be used.

Existing PersistentVolumeClaim

  1. Create the PersistentVolume
  2. Create the PersistentVolumeClaim
  3. Install the chart
$ helm install --name my-release \
    --set persistence.existingClaim=PVC_NAME \
    t3n/snipeit

Custom Environment Values

Snipe-IT uses .env file to store configuration variables. This includes Email configuration, advanced configurations like proxy, login throttling etc. To override the default values for these variables, use the config.snipeit.envConfig.

config:
  snipeit:
    envConfig:
      MAIL_HOST: smtp.example.com
      MAIL_PORT: 25
      MAIL_USERNAME: username
      MAIL_PASSWORD: password
      MAIL_FROM_ADDR: [email protected]
      MAIL_FROM_NAME: Snipe-IT

External Secrets

To use manually created secrets for the database configuration, use the config.externalSecret. You can create a secret with the following command:

kubectl create secret generic my-db-secret \
  --from-literal=MYSQL_USER=<your_mysql_user> \
  --from-literal=MYSQL_DATABASE=<your_mysql_database> \
  --from-literal=MYSQL_PASSWORD=<your_mysql_password> \
  --from-literal=MYSQL_PORT_3306_TCP_ADDR=<your_mysql_host> \
  --from-literal=MYSQL_PORT_3306_TCP_PORT=<your_mysql_port> \
  --from-literal=APP_KEY=<your_app_key>

Additional manifests

It is possible to add additional manifests into a deployment, to extend the chart. One of the reason is to deploy a manifest specific to a cloud provider ( BackendConfig on GKE for example ).

extraManifests:
  - apiVersion: cloud.google.com/v1beta1
    kind: BackendConfig
    metadata:
      name: "{{ .Release.Name }}-test"
    spec:
      securityPolicy:
        name: "gcp-cloud-armor-policy-test"

Deploy snipeit with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has snipeit 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 chartsnipeit is pinned at v3.4.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