apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    workload.user.cattle.io/workloadselector: deployment-indrz-geoserver
    app: geoserver
  name: geoserver
spec:
  replicas: 1
  selector:
    matchLabels:
      workload.user.cattle.io/workloadselector: deployment-indrz-geoserver
      app: geoserver
  template:
    metadata:
      labels:
        workload.user.cattle.io/workloadselector: deployment-indrz-geoserver
        app: geoserver
    spec:
      containers:
      - envFrom:
        - secretRef:
            name: geoserver
            optional: false
        - secretRef:
            name: indrz-common
            optional: false
        image: indrz/indrz-geoserver:indrz-latest
        imagePullPolicy: Always
        livenessProbe:
          httpGet:
            path: /geoserver/
            scheme: HTTP
            port: 8080
          failureThreshold: 3
          initialDelaySeconds: 30
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 10
        name: geoserver
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
        readinessProbe:
          httpGet:
            path: /geoserver/
            scheme: HTTP
            port: 8080
          failureThreshold: 3
          initialDelaySeconds: 60
          periodSeconds: 30
          successThreshold: 2
          timeoutSeconds: 10
        volumeMounts:
        - mountPath: /opt/geoserver/data_dir
          name: geoserver
      imagePullSecrets:
        - name: indrz-docker-registry
      volumes:
      - name: geoserver
        persistentVolumeClaim:
          claimName: geoserver
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    workload.user.cattle.io/workloadselector: deployment-indrz-api
    app: indrz-api
  name: indrz-api
spec:
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: indrz-api
      workload.user.cattle.io/workloadselector: deployment-indrz-api
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      labels:
        workload.user.cattle.io/workloadselector: deployment-indrz-api
        app: indrz-api
    spec:
      containers:
      - envFrom:
        - secretRef:
            name: indrz-api
            optional: false
        - secretRef:
            name: indrz-db
            optional: false
          prefix: PG_
        - secretRef:
            name: indrz-common
            optional: false
        image: indrz/indrz-api:indrz-latest
        imagePullPolicy: Always
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /api/v1/admin/login/
            port: 8000
            scheme: HTTP
          initialDelaySeconds: 10
          periodSeconds: 60
          successThreshold: 1
          timeoutSeconds: 10
        name: indrz-api
        ports:
        - containerPort: 8000
          name: http
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /api/v1/admin/login/
            port: 8000
            scheme: HTTP
          initialDelaySeconds: 10
          periodSeconds: 10
          successThreshold: 2
          timeoutSeconds: 10
        resources: {}
        securityContext:
          allowPrivilegeEscalation: false
          capabilities: {}
          privileged: false
          readOnlyRootFilesystem: false
          runAsNonRoot: false
        stdin: true
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        tty: true
        volumeMounts:
        - mountPath: /opt/data/media
          name: indrz-api
          subPath: media
        - mountPath: /opt/data/static
          name: indrz-api
          subPath: static
      imagePullSecrets:
        - name: indrz-docker-registry
      volumes:
      - name: indrz-api
        persistentVolumeClaim:
          claimName: indrz-api
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    workload.user.cattle.io/workloadselector: deployment-indrz-db
    app: indrz-db
  name: indrz-db
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      workload.user.cattle.io/workloadselector: deployment-indrz-db
      app: indrz-db
  strategy:
    rollingUpdate:
      maxSurge: 0
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        workload.user.cattle.io/workloadselector: deployment-indrz-db
        app: indrz-db
    spec:
      containers:
      - envFrom:
        - secretRef:
            name: indrz-db
            optional: false
          prefix: POSTGRES_
        - secretRef:
            name: indrz-common
        image: kartoza/postgis:13.0
        imagePullPolicy: Always
        livenessProbe:
          exec:
            command:
            - pg_isready
            - -U
            - postgres
          failureThreshold: 5
          initialDelaySeconds: 10
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 5
        name: indrz-db
        ports:
        - containerPort: 5432
          name: postgresql
          protocol: TCP
        readinessProbe:
          exec:
            command:
            - pg_isready
            - -U
            - postgres
          failureThreshold: 5
          initialDelaySeconds: 10
          periodSeconds: 10
          successThreshold: 2
          timeoutSeconds: 5
        volumeMounts:
        - mountPath: /var/lib/postgresql
          name: indrz-db
      volumes:
      - name: indrz-db
        persistentVolumeClaim:
          claimName: indrz-db
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    workload.user.cattle.io/workloadselector: deployment-indrz-nginx
    app: indrz-nginx
  name: indrz-nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      workload.user.cattle.io/workloadselector: deployment-indrz-nginx
      app: indrz-nginx
  template:
    metadata:
      labels:
        workload.user.cattle.io/workloadselector: deployment-indrz-nginx
        app: indrz-nginx
    spec:
      containers:
      - envFrom:
        - secretRef:
            name: indrz-common
        image: indrz/indrz-nginx:indrz-latest
        imagePullPolicy: Always
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /static/index.html
            port: 80
            scheme: HTTP
          initialDelaySeconds: 1
          periodSeconds: 2
          successThreshold: 1
          timeoutSeconds: 2
        name: indrz-nginx
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /static/index.html
            port: 80
            scheme: HTTP
          initialDelaySeconds: 1
          periodSeconds: 2
          successThreshold: 2
          timeoutSeconds: 2
        volumeMounts:
        - mountPath: /opt/data/media
          name: indrz-api
          subPath: media
        - mountPath: /opt/data/static
          name: indrz-api
          subPath: static
        - mountPath: /var/www/indrz
          name: indrz-nginx
          subPath: www
        - mountPath: /etc/nginx/conf.d/default.conf
          name: nginx-config
          subPath: default-conf
      imagePullSecrets:
        - name: indrz-docker-registry
      volumes:
      - name: indrz-api
        persistentVolumeClaim:
          claimName: indrz-api
      - name: indrz-nginx
        persistentVolumeClaim:
          claimName: indrz-nginx
      - name: nginx-config
        configMap:
            name: indrz-nginx
            items:
              - key: default.conf
                path: default-conf

