# apiVersion: v1
# kind: Namespace
# metadata:
#   labels:
#     control-plane: controller-manager
#   name: fluid-system
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: controller-manager
  namespace: fluid-system
  labels:
    control-plane: controller-manager
spec:
  selector:
    matchLabels:
      control-plane: controller-manager
  replicas: 1
  template:
    metadata:
      labels:
        control-plane: controller-manager
    spec:
      serviceAccountName: fluid
      tolerations:
      - operator: Exists
      hostNetwork: true
      containers:
      - command:
        - fluid-controller
        # args:
        # - --enable-leader-election
        image: "{{ .Values.controller.image }}"
        name: manager
        command:
          - fluid-controller
        args:
          - --development=false
#        args:
#          - --capacity-percentage={{ .Values.controller.capacityPercentagePerNode }}
#          - --reserved={{ .Values.controller.reservedStorage }}
#          - --cache-store-type={{ .Values.controller.cacheStoreType }}
#          - --cache-storage-path={{ .Values.controller.cacheStoragePath }}
        ports:
        - containerPort: 8080
          name: metrics
          protocol: TCP
        resources:
          limits:
            cpu: 100m
            memory: 300Mi
          requests:
            cpu: 100m
            memory: 200Mi
        ports:
        - containerPort: 8080
          name: metrics
          protocol: TCP
      terminationGracePeriodSeconds: 10
