# Copyright (c) 2020 SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: chartmuseum
  labels:
    app: harbor
    component: chartmuseum
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: harbor
      component: chartmuseum
  template:
    metadata:
      labels:
        app: harbor
        component: chartmuseum
    spec:
      securityContext:
        fsGroup: 10000
      containers:
        - name: chartmuseum
          image: goharbor/chartmuseum-photon
          imagePullPolicy: Always
          livenessProbe:
            httpGet:
              path: /health
              port: 9999
            initialDelaySeconds: 300
            periodSeconds: 10
          readinessProbe:
            httpGet:
              path: /health
              port: 9999
            initialDelaySeconds: 1
            periodSeconds: 10
          envFrom:
            - configMapRef:
                name: chartmuseum
            - secretRef:
                name: chartmuseum
          env:
            - name: BASIC_AUTH_PASS
              valueFrom:
                secretKeyRef:
                  name: core
                  key: secret
          resources:
            requests:
              memory: 256Mi
              cpu: 100m
          ports:
            - containerPort: 9999
          volumeMounts:
            - name: chartmuseum-data
              mountPath: /chart_storage
      volumes:
        - name: chartmuseum-data
          persistentVolumeClaim:
            claimName: pvc-chartmuseum
