Commit e185242c authored by Luca Cinquini's avatar Luca Cinquini
Browse files

Adding cog deployment

parent 1a123cfc
Loading
Loading
Loading
Loading
+65 −0
Original line number Diff line number Diff line
apiVersion: v1
kind: Service
metadata:
  name: esgf-cog
  labels:
    stack: esgf
    app: cog
spec:
  type: NodePort
  ports:
  - port: 8000 # service port
    targetPort: 8000 # container port
    protocol: TCP
    name: django-http
  selector:
    stack: esgf
    app: cog
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: esgf-cog
spec:
  replicas: 1
  template:
    metadata:
      labels:
        stack: esgf
        app: cog
    spec:
      containers:
      - name: esgf-cog
        image: esgfhub/esgf-cog:devel
        ports:
        - containerPort: 8000
        # flags: ESGF_HOSTNAME = $ESGF_HOSTNAME,  ESGF = true to use postgres, run django server = true
        args: ["$(ESGF_HOSTNAME)", "true", "true"]
        env:
        - name: COG_DIR
          value: "/usr/local/cog"
        - name: COG_INSTALL_DIR
          value: "/usr/local/cog/cog_install"
        - name: COG_CONFIG_DIR
          value: "/usr/local/cog/cog_config"
        - name: INIT
          value: "true"
        envFrom:
        - configMapRef:
            name: esgf-env
        volumeMounts:
        - name: cog-data
          mountPath: /usr/local/cog/cog_config
        - name: esgf-config-archive
          mountPath: /root/archives/esgf_config.tar.xz
        - name: grid-certificates
          mountPath: /root/archives/grid_security_certs.tar.xz
      volumes:
      - name: cog-data
        emptyDir: {}
      - name: esgf-config-archive
        hostPath:
          path: /Users/cinquini/ESGF_CONFIG/archives/esgf_config.tar.xz
      - name: grid-certificates
        hostPath:
          path: /Users/cinquini/ESGF_CONFIG/archives/grid_security_certs.tar.xz