#  Copyright 2019 U.C. Berkeley RISE Lab
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
#  Modifications copyright (C) 2021 Taras Lykhenko, Rafael Soares

apiVersion: apps/v1
kind: ReplicaSet
metadata:
  name: scheduler-nodes
  labels:
    role: scheduler
spec:
  selector:
    matchLabels:
      role: scheduler
  template:
    metadata:
      labels:
        role: scheduler
    spec:
      topologySpreadConstraints:
        - maxSkew: 1
          topologyKey: kubernetes.io/hostname
          whenUnsatisfiable: DoNotSchedule
          labelSelector:
            matchLabels:
              role: scheduler
      hostIPC: true
      containers:
      - name: scheduler-container
        image: jrafaelsoares/faastcc_cloudburst
        imagePullPolicy: IfNotPresent
        env:
        - name: LIBC_FATAL_STDERR_
          value: "1"
        - name: ROUTE_ADDR
          value: ROUTE_ADDR_DUMMY
        - name: MGMT_IP
          value: MGMT_IP_DUMMY
        - name: ROLE
          value: scheduler
        - name: REPO_ORG
          value: taraslykhenko
        - name: REPO_BRANCH
          value: main
        - name: ANNA_REPO_ORG
          value: FaaSTCC
        - name: ANNA_REPO_BRANCH
          value: master
        - name: POLICY
          value: round-robin
      imagePullSecrets:
        - name: regcred
      nodeSelector:
        type: S
