apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: hsds
  name: hsds
spec:
  replicas: 1
  selector:
    matchLabels:
      app: hsds
  template:
    metadata:
      labels:
        app: hsds
    spec:
      containers:
        -
          name: sn
          image: "hsds"
          imagePullPolicy: Never
          ports:
            -
              containerPort: 5101
          env:
          - name: NODE_TYPE
            value: sn
          - name: AWS_S3_GATEWAY
            value: http://s3.amazonaws.com
          - name: AWS_ACCESS_KEY_ID
            valueFrom:
              secretKeyRef:
                name: aws-auth-keys
                key: aws_access_key_id
          - name: AWS_SECRET_ACCESS_KEY
            valueFrom:
              secretKeyRef:
                name: aws-auth-keys
                key: aws_secret_access_key
          - name: AWS_REGION
            value: us-east-1
          - name: BUCKET_NAME
            value: hsds.bucket
          - name: LOG_LEVEL
            value: DEBUG
          - name: SERVER_NAME
            value: "Highly Scalable Data Service (HSDS)"
          - name: HSDS_ENDPOINT
            value: http://hsds.hdf.test
          - name: GREETING
            value: "Welcome to HSDS!"
          - name: ABOUT
            value: "HSDS is a webservice for HDF data"
        -
          name: dn
          image: "hsds"
          lifecycle:
            preStop:
              exec:
                command: ["/usr/bin/curl", "-X", "DELETE", "http://127.0.0.1:6101/prestop"]
          imagePullPolicy: Never
          ports:
            -
              containerPort: 6101
          env:
          - name: NODE_TYPE
            value: dn
          - name: AWS_S3_GATEWAY
            value: http://s3.amazonaws.com
          - name: AWS_ACCESS_KEY_ID
            valueFrom:
              secretKeyRef:
                name: aws-auth-keys
                key: aws_access_key_id
          - name: AWS_SECRET_ACCESS_KEY
            valueFrom:
              secretKeyRef:
                name: aws-auth-keys
                key: aws_secret_access_key
          - name: AWS_REGION
            value: us-east-1
          - name: BUCKET_NAME
            value: hsds.bucket
          - name: LOG_LEVEL
            value: DEBUG
          - name: HSDS_ENDPOINT
            value: http://hsds.hdf.test
