apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    k8s-app: cms-xcache-11-ucsd
  name: cms-xcache-11-ucsd
spec:
  replicas: 1
  selector:
    matchLabels:
      k8s-app: cms-xcache-11-ucsd
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        k8s-app: cms-xcache-11-ucsd
    spec:
      tolerations:
      - effect: NoSchedule
        key: nautilus.io/stashcache
        operator: Exists
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: kubernetes.io/hostname
                operator: In
                values:
                - xcache-11.t2.ucsd.edu
      containers:
      - env:
        - name: XC_RESOURCENAME
          value: UCSD-XCACHE
        - name: XC_RAMSIZE
          value: 12g
        - name: XC_SPACE_LOW_WM
          value: '0.95'
        - name: XC_SPACE_HIGH_WM
          value: '0.97'
        - name: XC_ROOTDIR
          value: /xcache/namespace
        - name: XC_MULTI_DISK
          value: 'true'
        - name: XC_LOCAL_REDIRECTORS
          value: xcache-redirector-real.t2.ucsd.edu:2041,xcache-real.ultralight.org:2041
        image: opensciencegrid/cms-xcache:fresh
        ports:
         - containerPort: 1094
           hostPort: 1094
         - containerPort: 1095
           hostPort: 1095
        imagePullPolicy: Always
        name: cms-xcache-xcache-11-ucsd
        resources:
           limits:
              memory: 30Gi
              cpu: 4
           requests:
              memory: 20Gi
              cpu: 4
        volumeMounts:
        - mountPath: /etc/xrootd/config.d/95-local-ucsd.cfg
          name: config95
          subPath: 95-local-ucsd.cfg
        - mountPath: /etc/grid-security/hostcert.pem
          name: hostcert
        - mountPath: /etc/grid-security/hostkey.pem
          name: hostkey
        - mountPath: /xcache/namespace
          name: localroot
        - mountPath: /xcache/data3
          name: data3
        - mountPath: /xcache/data4
          name: data4
        - mountPath: /xcache/data5
          name: data5
        - mountPath: /xcache/data6
          name: data6
        - mountPath: /xcache/data7
          name: data7
        - mountPath: /xcache/data8
          name: data8
        - mountPath: /xcache/data9
          name: data9
        - mountPath: /xcache/data10
          name: data10
        - mountPath: /xcache/data11
          name: data11
      dnsPolicy: ClusterFirst
      hostNetwork: true
      restartPolicy: Always
      schedulerName: default-scheduler
      terminationGracePeriodSeconds: 30
      volumes:
      - configMap:
          defaultMode: 420
          items:
          - key: 95-local-ucsd.cfg
            path: 95-local-ucsd.cfg
          name: cms-xcache-bcache-1-ucsd
        name: config95
      - hostPath:
          path: /etc/grid-security/hostcert.pem
          type: File
        name: hostcert
      - hostPath:
          path: /etc/grid-security/hostkey.pem
          type: File
        name: hostkey
      - name: data3
        persistentVolumeClaim:
          claimName: pvc-xcache-11-ucsd-s3
      - name: data4
        persistentVolumeClaim:
          claimName: pvc-xcache-11-ucsd-s4
      - name: data5
        persistentVolumeClaim:
          claimName: pvc-xcache-11-ucsd-s5
      - name: data6
        persistentVolumeClaim:
          claimName: pvc-xcache-11-ucsd-s6
      - name: data7
        persistentVolumeClaim:
          claimName: pvc-xcache-11-ucsd-s7
      - name: data8
        persistentVolumeClaim:
          claimName: pvc-xcache-11-ucsd-s8
      - name: data9
        persistentVolumeClaim:
          claimName: pvc-xcache-11-ucsd-s9
      - name: data10
        persistentVolumeClaim:
          claimName: pvc-xcache-11-ucsd-s10
      - name: data11
        persistentVolumeClaim:
          claimName: pvc-xcache-11-ucsd-s11
      - name: localroot
        hostPath:
          path: /xcache-root
          type: Directory

