SpeciesFileGroup/taxonworks

View on GitHub
k8s/app.yml

Summary

Maintainability
Test Coverage
---
apiVersion: v1
kind: Service
metadata:
  name: taxonworks
  namespace: tw
  labels:
    app: taxonworks
    tier: frontend
spec:
  type: NodePort
  ports:
    - port: 80
      nodePort: 30995  # was hard-coded to 80, dev is targetPort: 80, no nodePort
  selector:
    app: taxonworks
    tier: frontend

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: taxonworks
  namespace: tw
spec:
  replicas: 3
  template:
    metadata:
      namespace: tw
      name: taxonworks
      labels:
        app: taxonworks
        tier: frontend
    spec:
      volumes:
        - name: taxonworks-media-vol
          persistentVolumeClaim:
            claimName: taxonworks-media-pv-claim
        - name: taxonworks-backup-vol
          persistentVolumeClaim:
            claimName: taxonworks-backup-pv-claim
        - name: taxonworks-staging-vol
          persistentVolumeClaim:
            claimName: taxonworks-staging-pv-claim
      containers:
        - name: taxonworks
          image: sfgrp/taxonworks:0.3.12
          ports:
            - containerPort: 80
              name: http
          volumeMounts:
            - mountPath: /app/public/system
              name: taxonworks-media-vol
            - mountPath: /backup
              name: taxonworks-backup-vol
            - mountPath: /staging
              name: taxonworks-staging-vol
          readinessProbe:
            httpGet:
              path: /api/v1/ping
              port: 80
            initialDelaySeconds: 900 # 30 
            timeoutSeconds: 3
          livenessProbe:
            httpGet:
              path: /api/v1/ping
              port: 80
            initialDelaySeconds: 900 # 1600 # 180
            timeoutSeconds: 3
          env:
            - name: RAILS_ENV
              value: production
            - name: SERVER_NAME
              value: sfg.taxonworks.org 
            - name: POSTGRES_HOST
              valueFrom: 
                configMapKeyRef:
                  name: taxonworks
                  key: db.host
            - name: POSTGRES_DB
              valueFrom:
                configMapKeyRef:
                  name: taxonworks
                  key: db
            - name: POSTGRES_USER
              valueFrom:
                secretKeyRef:
                  name: taxonworks
                  key: db.user
            - name: POSTGRES_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: taxonworks
                  key: db.user.password
            - name: NGINX_SECRET_KEY
              valueFrom:
                secretKeyRef:
                  name: taxonworks 
                  key: nginx.secret 
            - name: SECRET_KEY_BASE
              valueFrom:
                secretKeyRef:
                  name: taxonworks
                  key: secret_key_base
            - name: TW_EXCEPTION_NOTIFICATION_EMAIL_PREFIX
              valueFrom:
                configMapKeyRef:
                  name: taxonworks 
                  key: tw.exception_notification.email_prefix
            - name: TW_EXCEPTION_NOTIFICATION_SENDER_ADDRESS
              valueFrom:
                configMapKeyRef:
                  name: taxonworks 
                  key: tw.exception_notification.sender_address
            - name: TW_EXCEPTION_RECIPIENTS
              valueFrom:
                configMapKeyRef:
                  name: taxonworks 
                  key: tw.exception_recipients
            - name: TW_ACTION_MAILER_SMTP_SETTINGS_ADDRESS
              valueFrom:
                configMapKeyRef:
                  name: taxonworks 
                  key: tw.action_mailer_smtp_settings.address
            - name: TW_ACTION_MAILER_SMTP_SETTINGS_PORT
              valueFrom:
                configMapKeyRef:
                  name: taxonworks 
                  key: tw.action_mailer_smtp_settings.port
            - name: TW_ACTION_MAILER_SMTP_SETTINGS_DOMAIN
              valueFrom:
                configMapKeyRef:
                  name: taxonworks 
                  key: tw.action_mailer_smtp_settings.domain
            - name: TW_ACTION_MAILER_URL_HOST
              valueFrom:
                configMapKeyRef:
                  name: taxonworks 
                  key: tw.action_mailer_url_host
            - name: TW_MAIL_DOMAIN
              valueFrom:
                configMapKeyRef:
                  name: taxonworks 
                  key: tw.mail_domain
            - name: TW_PATHS_STAGING
              valueFrom:
                configMapKeyRef:
                  name: taxonworks 
                  key: tw.paths.staging
            - name: TW_PATHS_BACKUP
              valueFrom:
               configMapKeyRef:
                 name: taxonworks 
                 key: tw.paths.backup