Starting the Volcano

This section describes how to install the Volcano components (vc-scheduler and vc-controller-manager) used for cluster scheduling. If you need to use other Volcano components, install them by yourself and ensure their security.

Procedure

  1. Log in to the Kubernetes master node as the root user and run the following command to check whether the Volcano image and version are correct:
    docker images | grep volcanosh
    Example:
    root@ubuntu:# docker images | grep volcanosh
    volcanosh/vc-controller-manager      v1.4.0              84c73128cc55        3 days ago          44.5MB
    volcanosh/vc-scheduler               v1.4.0              e90c114c75b1        3 days ago          188MB
  2. Copy the YAML file in the directory (for example, /home/ascend-volcano) where the Volcano software package is decompressed to any directory (for example, /home/ascend-volcano) on the Kubernetes master node. If the Volcano software package is decompressed on the Kubernetes master node, you do not need to copy the YAML file.
    cd /home/ascend-volcano
    scp root@{IP_address_of_the_node_where_the_software_package_is_decompressed}:/home/ascend-volcano/volcano-*.yaml ./
  3. Skip this step if you do not need to modify the component startup parameters. Otherwise, modify the Volcano startup parameters in the corresponding startup YAML file based on your requirements. For details about the common startup parameters, see Table 1 and Table 2.
  4. Configure Volcano log dump.
    During the installation, Volcano logs are mounted to the drive space (/var/log/mindx-dl). To prevent the drive space from being used up, configure log dump for the Volcano. For details, see Table 3.
    1. In the /etc/logrotate.d directory on the master node, run the following command to create a log dump configuration file:
      vim /etc/logrotate.d/file_name

      Example:

      vim /etc/logrotate.d/volcano
      Add the following content to the file and run the :wq command to save the file:
      /var/log/mindx-dl/volcano-*/*.log{    
           daily     
           rotate 8     
           size 50M     
           compress     
           dateext     
           missingok     
           notifempty     
           copytruncate     
           create 0640 hwMindX hwMindX     
           sharedscripts     
           postrotate         
               chmod 640 /var/log/mindx-dl/volcano-*/*.log                
               chmod 440 /var/log/mindx-dl/volcano-*/*.log-*            
           endscript 
      }
    2. Run the following commands to set the configuration file permission to 640 and owner to root:
      chmod 640 /etc/logrotate.d/file_name
      chown root /etc/logrotate.d/file_name

      Example:

      chmod 640 /etc/logrotate.d/volcano
      chown root /etc/logrotate.d/volcano
  5. Run the following command to start the Volcano:
    kubectl apply -f volcano-*.yaml

    Example:

    root@ubuntu:/home/ascend-volcano# kubectl apply -f volcano-*.yaml
    namespace/volcano-system created
    namespace/volcano-monitoring created
    configmap/volcano-scheduler-configmap created
    serviceaccount/volcano-scheduler created
    clusterrole.rbac.authorization.K8s.io/volcano-scheduler created
    clusterrolebinding.rbac.authorization.K8s.io/volcano-scheduler-role created
    deployment.apps/volcano-scheduler created
    service/volcano-scheduler-service created
    serviceaccount/volcano-controllers created
    clusterrole.rbac.authorization.K8s.io/volcano-controllers created
    clusterrolebinding.rbac.authorization.K8s.io/volcano-controllers-role created
    deployment.apps/volcano-controllers created
    customresourcedefinition.apiextensions.K8s.io/jobs.batch.volcano.sh created
    customresourcedefinition.apiextensions.K8s.io/commands.bus.volcano.sh created
    customresourcedefinition.apiextensions.K8s.io/podgroups.scheduling.volcano.sh created
    customresourcedefinition.apiextensions.K8s.io/queues.scheduling.volcano.sh created
    customresourcedefinition.apiextensions.K8s.io/numatopologies.nodeinfo.volcano.sh created
    root@ubuntu:/home/ascend-volcano# kubectl get pod -n volcano-system
    NAME                                   READY   STATUS    RESTARTS   AGE
    volcano-controllers-5cf8d788d5-qdpzq   1/1     Running   0          1m
    volcano-scheduler-6cffd555c9-45k7c     1/1     Running   0          1m

Parameters

Table 1 Volcano scheduler startup parameters

Parameter

Type

Default Value

Description

--log-dir

string

/var/log/mindx-dl/volcano-scheduler

Log directory.

--log-file

string

/var/log/mindx-dl/volcano-scheduler/volcano-scheduler.log

Log file name.

--logtostderr

bool

false

Whether to print logs in the standard output.

-v

int

2

Log output level.

  • 1: error
  • 2: warning
  • 3: info
  • 4: debug

--plugins-dir

string

plugins

Path for loading the scheduler plugin.

--version

bool

false

Volcano scheduler binary version number.

Table 2 Volcano controller startup parameters

Parameter

Type

Default Value

Description

--log-dir

string

/var/log/mindx-dl/volcano-controller

Log directory.

--log-file

string

/var/log/mindx-dl/volcano-controller/volcano-controller.log

Log file name.

--logtostderr

bool

false

Whether to print logs in the standard output.

-v

int

4

Log output level.

  • 1: error
  • 2: warning
  • 3: info
  • 4: debug

--version

bool

false

Volcano controller binary version number.

The Volcano is open-source software. Only the startup parameters in use are listed. For details about other startup parameters, see the open-source software description.

Table 3 Configuration items for Volcano log file dump

Configuration Item

Description

Possible Value

daily

Log dump frequency

  • daily: Performs the dump check once a day.
  • weekly: Performs the dump check once a week.
  • monthly: Performs the dump check once a month.
  • yearly: Performs the dump check once a year.

rotate x

Number of times that log files are dumped before they are deleted

x indicates the number of backups.

Examples:

  • rotate 0: no backup
  • rotate 8: eight backups

size xx

A log file is dumped only when its size reaches the value of this parameter.

The size unit can be specified as follows:

  • byte (default value)
  • K
  • M

For example, size 50M indicates that a log file is dumped when its size reaches 50 MB.

NOTE:

logrotate periodically checks the sizes of log files based on the configured dump frequency. Dump is triggered only when the size of a log file exceeds the value of Size.

This means that logrotate does not dump a log file as soon as it reaches its size limit.

compress

Whether to compress dumped logs using gzip

  • compress: Use gzip for compression.
  • nocompress: Do not use gzip for compression.

notifempty

Whether to dump empty files

  • ifempty: Dump empty files.
  • notifempty: Do not dump empty files.