<p>i am trying to deploy snipe-it on k8s cluster</p>

<p>i have running mysql on kubernetes</p>

<p>i want to deploy snipe-it application on kubernetes </p>

<p>my yaml file is like</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: snipeit
  labels:
    app: snipeit
spec:
  ports:
    - port: 80
  selector:
    app: snipeit
    tier: frontend
  type: LoadBalancer
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: snipeit-pv-claim
  labels:
    app: snipeit
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 20Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: snipeit
  labels:
    app: snipeit
spec:
  selector:
    matchLabels:
      app: snipeit
      tier: frontend
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: snipeit
        tier: frontend
    spec:
      containers:
      - image: snipe/snipe-it
        name: snipeit
        env:
        - name: DB_CONNECTION
          value: mysql
        - name: DB_HOST
          value: mysql
        - name: DB_USERNAME
          value: root
        - name: DB_DATABASE
          value: snipeit
        - name: APP_URL
          value: url
        - name: DB_PASSWORD
          value: password
        ports:
        - containerPort: 80
          name: snipeit
        volumeMounts:
        - name: snipeit-persistent-storage
          mountPath: /var/www/html
      volumes:
      - name: snipeit-persistent-storage
        persistentVolumeClaim:
          claimName: snipeit-pv-claim
</code></pre>

<p>this is not working </p>

<p>image i am using is from docker hub : </p>

<pre><code>https://hub.docker.com/r/snipe/snipe-it
</code></pre>

<p>github snipe-it : <code>https://github.com/snipe/snipe-it</code></p>

<p>container start running but i logged inside container and check var/www/html but no content there </p>

<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: snipe-it-config
data:
  # Mysql Parameters
  MYSQL_PORT_3306_TCP_ADDR: "address"
  MYSQL_PORT_3306_TCP_PORT: "3306"
  MYSQL_DATABASE: "snipeit"
  MYSQL_USER: "user"
  MYSQL_PASSWORD: "pass"

  # Email Parameters
  # - the hostname/IP address of your mailserver
  MAIL_PORT_587_TCP_ADDR: "&lt;smtp-host&gt;"
  #the port for the mailserver (probably 587, could be another)
  MAIL_PORT_587_TCP_PORT: "587"
  # the default from address, and from name for emails
  MAIL_ENV_FROM_ADDR: "noreply@mydomain.com"
  MAIL_ENV_FROM_NAME: "Snipe-IT"
  # - pick 'tls' for SMTP-over-SSL, 'tcp' for unencrypted
  MAIL_ENV_ENCRYPTION: "tls"
  # SMTP username and password
  MAIL_ENV_USERNAME: "&lt;smtp-username&gt;"
  MAIL_ENV_PASSWORD: "&lt;smtp-password&gt;"

  # Snipe-IT Settings
  APP_ENV: "production"
  APP_DEBUG: "false"
  APP_KEY: "key"
  APP_URL: "http://127.0.0.1:80"
  APP_TIMEZONE: "Asia/Kolkata"
  APP_LOCALE: "en"
---
apiVersion: v1
kind: Service
metadata:
  name: snipeit
  labels:
    app: snipeit
spec:
  ports:
    - port: 80
  selector:
    app: snipeit
    tier: frontend
  type: LoadBalancer
---
apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: snipeit
  labels:
    app: snipeit
spec:
  selector:
    matchLabels:
      app: snipeit
      tier: frontend
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: snipeit
        tier: frontend
    spec:
      containers:
      - image: snipe/snipe-it
        name: snipeit
        envFrom:
            - configMapRef:
                name: snipe-it-config
        ports:
        - containerPort: 80
          name: snipeit
        volumeMounts:
        - name: snipeit-persistent-storage
          mountPath: /var/lib/snipeit
      volumes:
      - name: snipeit-persistent-storage
        persistentVolumeClaim:
          claimName: snipeit-pv-claim
</code></pre>

<p>instead of using configmap i was adding enviroment variables and parameters in deployment section...so just added config map and smoothly it's up and running </p>
