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: head
          image: "hdfgroup/hsds:v0.7.0beta6"
          imagePullPolicy: IfNotPresent
          resources:
            requests:
              memory: "512M"
            limits:
              memory: "512M"
          volumeMounts:
          - name: config
            mountPath: "/config"
          ports:
            -
              containerPort: 5100
          env:
          - name: NODE_TYPE
            value: head_node
        -
          name: sn
          image: "hdfgroup/hsds:v0.7.0beta6"
          imagePullPolicy: IfNotPresent
          resources:
            requests:
              memory: "1G"
            limits:
              memory: "1G"
          volumeMounts:
          - name: accounts
            mountPath: "/config/passwd.txt"
            subPath: passwd.txt
          - name: config
            mountPath: "/config"
          ports:
            -
              containerPort: 5101
          env:
          - name: NODE_TYPE
            value: sn
          - name: PASSWORD_FILE
            value: /config/passwd.txt
          - 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: dn1
          image: "hdfgroup/hsds:v0.7.0beta6"
          lifecycle:
            preStop:
              exec:
                command: ["/usr/bin/curl", "-X", "DELETE", "http://127.0.0.1:6101/prestop"]
          imagePullPolicy: IfNotPresent
          resources:
            requests:
              memory: "2G"
            limits:
              memory: "2G"
          volumeMounts:
          - name: config
            mountPath: "/config"
          ports:
            -
              containerPort: 6101
          env:
          - name: NODE_TYPE
            value: dn
          - name: DN_PORT
            value: "6101"
          - 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: dn2
          image: "hdfgroup/hsds:v0.7.0beta6"
          lifecycle:
            preStop:
              exec:
                command: ["/usr/bin/curl", "-X", "DELETE", "http://127.0.0.1:6101/prestop"]
          imagePullPolicy: IfNotPresent
          resources:
            requests:
              memory: "2G"
            limits:
              memory: "2G"
          volumeMounts:
          - name: config
            mountPath: "/config"
          ports:
            -
              containerPort: 6102
          env:
          - name: NODE_TYPE
            value: dn
          - name: DN_PORT
            value: "6102"
          - 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: dn3
          image: "hdfgroup/hsds:v0.7.0beta6"
          lifecycle:
            preStop:
              exec:
                command: ["/usr/bin/curl", "-X", "DELETE", "http://127.0.0.1:6101/prestop"]
          imagePullPolicy: IfNotPresent
          resources:
            requests:
              memory: "2G"
            limits:
              memory: "2G"
          volumeMounts:
          - name: config
            mountPath: "/config"
          ports:
            -
              containerPort: 6103
          env:
          - name: NODE_TYPE
            value: dn
          - name: DN_PORT
            value: "6103"
          - 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: dn4
          image: "hdfgroup/hsds:v0.7.0beta6"
          lifecycle:
            preStop:
              exec:
                command: ["/usr/bin/curl", "-X", "DELETE", "http://127.0.0.1:6101/prestop"]
          imagePullPolicy: IfNotPresent
          resources:
            requests:
              memory: "2G"
            limits:
              memory: "2G"
          volumeMounts:
          - name: config
            mountPath: "/config"
          ports:
            -
              containerPort: 6104
          env:
          - name: NODE_TYPE
            value: dn
          - name: DN_PORT
            value: "6104"
          - 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: rangeget
          image: "hdfgroup/hsds:v0.7.0beta6"
          imagePullPolicy: IfNotPresent
          resources:
            requests:
              memory: "2G"
            limits:
              memory: "2G"
          volumeMounts:
          - name: config
            mountPath: "/config"
          ports:
            -
              containerPort: 6900
          env:
          - name: NODE_TYPE
            value: rangeget
          - 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
      volumes:
      - name: accounts
        secret:
          secretName: user-password
      - name: config
        configMap:
          name: hsds-config