---
apiVersion: v1
kind: Namespace
metadata:
  name: trimaran
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: trimaran-scheduler-config
  namespace: trimaran
data:
  config.yaml: |
    apiVersion: kubescheduler.config.k8s.io/v1beta2
    kind: KubeSchedulerConfiguration
    leaderElection:
      leaderElect: false
    profiles:
    - schedulerName: trimaran-scheduler
      plugins:
        score:
          disabled:
          - name: NodeResourcesBalancedAllocation
          - name: NodeResourcesLeastAllocated
          enabled:
          - name: TargetLoadPacking
            weight: 10
      pluginConfig:
      - name: TargetLoadPacking
        args:
          defaultRequests:
            cpu: "2000m"
          defaultRequestsMultiplier: "1"
          targetUtilization: 1
          metricProvider:
            type: Prometheus
            address: https://thanos-querier-openshift-monitoring.apps.rlk-alias.myocp4.com
            token: ...
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: trimaran-scheduler
  namespace: trimaran
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: trimaran
subjects:
- kind: ServiceAccount
  name: trimaran-scheduler
  namespace: trimaran
roleRef:
  kind: ClusterRole
  name: system:kube-scheduler
  apiGroup: rbac.authorization.k8s.io
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: trimaran-scheduler
  namespace: trimaran
  labels:
    app: trimaran-scheduler
spec:
  replicas: 1
  selector:
    matchLabels:
      app: trimaran-scheduler
  template:
    metadata:
      labels:
        app: trimaran-scheduler
    spec:
      serviceAccount: trimaran-scheduler
      volumes:
      - name: etckubernetes
        configMap:
          name: trimaran-scheduler-config
      containers:
        - name: trimaran-scheduler
          env:
          - name: ENABLE_OPENSHIFT_AUTH
            value: "true"
          image: quay.io/chenw615/kube-scheduler:ocp
          imagePullPolicy: Always
          args:
          - /bin/kube-scheduler
          - --config=/etc/kubernetes/config.yaml
          - -v=6
          volumeMounts:
          - name: etckubernetes
            mountPath: /etc/kubernetes
