volcano.sh/volcano@v1.9.0/installer/helm/chart/volcano/templates/scheduler.yaml (about)

     1  {{- if .Values.custom.scheduler_enable }}
     2  {{ $scheduler_affinity := or .Values.custom.scheduler_affinity .Values.custom.default_affinity }}
     3  {{ $scheduler_tolerations := or .Values.custom.scheduler_tolerations .Values.custom.default_tolerations }}
     4  {{ $scheduler_sc := or .Values.custom.scheduler_sc .Values.custom.default_sc }}
     5  {{ $scheduler_ns := or .Values.custom.scheduler_ns .Values.custom.default_ns }}
     6  apiVersion: v1
     7  kind: ConfigMap
     8  metadata:
     9    name: {{ .Release.Name }}-scheduler-configmap
    10    namespace: {{ .Release.Namespace }}
    11  data:
    12    {{- (.Files.Glob .Values.basic.scheduler_config_file).AsConfig | nindent 2}}
    13  ---
    14  apiVersion: v1
    15  kind: ServiceAccount
    16  metadata:
    17    name: {{ .Release.Name }}-scheduler
    18    namespace: {{ .Release.Namespace }}
    19  ---
    20  kind: ClusterRole
    21  apiVersion: rbac.authorization.k8s.io/v1
    22  metadata:
    23    name: {{ .Release.Name }}-scheduler
    24  rules:
    25    - apiGroups: ["apiextensions.k8s.io"]
    26      resources: ["customresourcedefinitions"]
    27      verbs: ["create", "get", "list", "watch", "delete"]
    28    - apiGroups: ["batch.volcano.sh"]
    29      resources: ["jobs"]
    30      verbs: ["get", "list", "watch", "update", "delete"]
    31    - apiGroups: ["batch.volcano.sh"]
    32      resources: ["jobs/status"]
    33      verbs: ["update", "patch"]
    34    - apiGroups: [""]
    35      resources: ["events"]
    36      verbs: ["create", "list", "watch", "update", "patch"]
    37    - apiGroups: [""]
    38      resources: ["pods", "pods/status"]
    39      verbs: ["create", "get", "list", "watch", "update", "patch", "bind", "updateStatus", "delete"]
    40    - apiGroups: [""]
    41      resources: ["pods/binding"]
    42      verbs: ["create"]
    43    - apiGroups: [""]
    44      resources: ["persistentvolumeclaims"]
    45      verbs: ["list", "watch", "update"]
    46    - apiGroups: [""]
    47      resources: ["persistentvolumes"]
    48      verbs: ["list", "watch", "update"]
    49    - apiGroups: [""]
    50      resources: ["namespaces", "services", "replicationcontrollers"]
    51      verbs: ["list", "watch", "get"]
    52    - apiGroups: [""]
    53      resources: ["resourcequotas"]
    54      verbs: ["list", "watch"]
    55    - apiGroups: [""]
    56      resources: ["nodes"]
    57      verbs: ["get","list", "watch","update","patch"]
    58    - apiGroups: [ "storage.k8s.io" ]
    59      resources: ["storageclasses", "csinodes", "csidrivers", "csistoragecapacities"]
    60      verbs: [ "list", "watch" ]
    61    - apiGroups: ["policy"]
    62      resources: ["poddisruptionbudgets"]
    63      verbs: ["list", "watch"]
    64    - apiGroups: ["scheduling.k8s.io"]
    65      resources: ["priorityclasses"]
    66      verbs: ["get", "list", "watch"]
    67    - apiGroups: ["scheduling.incubator.k8s.io", "scheduling.volcano.sh"]
    68      resources: ["queues"]
    69      verbs: ["get", "list", "watch", "create", "delete"]
    70    - apiGroups: ["scheduling.incubator.k8s.io", "scheduling.volcano.sh"]
    71      resources: ["queues/status"]
    72      verbs: ["update"]
    73    - apiGroups: ["scheduling.incubator.k8s.io", "scheduling.volcano.sh"]
    74      resources: ["podgroups"]
    75      verbs: ["list", "watch", "update"]
    76    - apiGroups: ["nodeinfo.volcano.sh"]
    77      resources: ["numatopologies"]
    78      verbs: ["get", "list", "watch", "delete"]
    79    - apiGroups: [""]
    80      resources: ["configmaps"]
    81      verbs: ["get", "create", "delete", "update"]
    82    - apiGroups: ["apps"]
    83      resources: ["daemonsets", "replicasets", "statefulsets"]
    84      verbs: ["list", "watch", "get"]
    85    - apiGroups: ["coordination.k8s.io"]
    86      resources: ["leases"]
    87      verbs: ["get", "create", "update", "watch"]
    88  ---
    89  kind: ClusterRoleBinding
    90  apiVersion: rbac.authorization.k8s.io/v1
    91  metadata:
    92    name: {{ .Release.Name }}-scheduler-role
    93  subjects:
    94    - kind: ServiceAccount
    95      name: {{ .Release.Name }}-scheduler
    96      namespace: {{ .Release.Namespace }}
    97  roleRef:
    98    kind: ClusterRole
    99    name: {{ .Release.Name }}-scheduler
   100    apiGroup: rbac.authorization.k8s.io
   101  
   102  ---
   103  kind: Deployment
   104  apiVersion: apps/v1
   105  metadata:
   106    name: {{ .Release.Name }}-scheduler
   107    namespace: {{ .Release.Namespace }}
   108    labels:
   109      app: volcano-scheduler
   110      {{- if .Values.custom.scheduler_labels }}
   111      {{- toYaml .Values.custom.scheduler_labels | nindent 4 }}
   112      {{- end }}
   113  spec:
   114    replicas: {{ .Values.custom.scheduler_replicas }}
   115    selector:
   116      matchLabels:
   117        app: volcano-scheduler
   118    template:
   119      metadata:
   120        labels:
   121          app: volcano-scheduler
   122          {{- if .Values.custom.scheduler_podLabels }}
   123          {{- toYaml .Values.custom.scheduler_podLabels | nindent 8 }}
   124          {{- end }}
   125      spec:
   126        {{- if $scheduler_tolerations }}
   127        tolerations: {{- toYaml $scheduler_tolerations | nindent 8 }}
   128        {{- end }}
   129        {{- if $scheduler_ns }}
   130        nodeSelector: {{- toYaml $scheduler_ns | nindent 8 }}
   131        {{- end }}
   132        {{- if $scheduler_affinity }}
   133        affinity:
   134          {{- toYaml $scheduler_affinity | nindent 8 }}
   135        {{- end }}
   136        {{- if $scheduler_sc }}
   137        securityContext:
   138          {{- toYaml $scheduler_sc | nindent 8 }}
   139        {{- end }}
   140        serviceAccount: {{ .Release.Name }}-scheduler
   141        priorityClassName: system-cluster-critical
   142        {{- if .Values.basic.image_pull_secret }}
   143        imagePullSecrets:
   144            - name: {{ .Values.basic.image_pull_secret }}
   145        {{- end }}
   146        containers:
   147          - name: {{ .Release.Name }}-scheduler
   148            image: {{.Values.basic.scheduler_image_name}}:{{.Values.basic.image_tag_version}}
   149            {{- if .Values.custom.scheduler_resources }}
   150            resources:
   151            {{- toYaml .Values.custom.scheduler_resources | nindent 12 }}
   152            {{- end }}
   153            args:
   154              - --logtostderr
   155              - --scheduler-conf=/volcano.scheduler/{{base .Values.basic.scheduler_config_file}}
   156              - --enable-healthz=true
   157              - --enable-metrics=true
   158              - --leader-elect={{ .Values.custom.leader_elect_enable }}
   159              {{- if .Values.custom.leader_elect_enable }}
   160              - --lock-object-namespace={{ .Release.Namespace }}
   161              {{- end }}
   162              - -v=3
   163              - 2>&1
   164            env:
   165              - name: DEBUG_SOCKET_DIR
   166                value: /tmp/klog-socks
   167            imagePullPolicy: {{ .Values.basic.image_pull_policy }}
   168            volumeMounts:
   169              - name: scheduler-config
   170                mountPath: /volcano.scheduler
   171              - name: klog-sock
   172                mountPath: /tmp/klog-socks
   173        volumes:
   174          - name: scheduler-config
   175            configMap:
   176              name: {{ .Release.Name }}-scheduler-configmap
   177          - name: klog-sock
   178            hostPath:
   179              path: /tmp/klog-socks
   180  ---
   181  apiVersion: v1
   182  kind: Service
   183  metadata:
   184    annotations:
   185      prometheus.io/path: /metrics
   186      prometheus.io/port: "8080"
   187      prometheus.io/scrape: "true"
   188    name: {{ .Release.Name }}-scheduler-service
   189    namespace: {{ .Release.Namespace }}
   190    labels:
   191      app: volcano-scheduler
   192  spec:
   193    ports:
   194    - port: 8080
   195      protocol: TCP
   196      targetPort: 8080
   197      name: "metrics"
   198    selector:
   199      app: volcano-scheduler
   200    type: ClusterIP
   201  {{- end }}