## 3.4.5.1.1. Managing weights of an existing route using the web console 

## Procedure 

alternateBackends: - kind: Service name: ab-example-b weight: 15 ... 

1. Navigate to the Networking → Routes  page. 

2. Click the Actions menu  next to the route you want to edit and select Edit Route . 

3. Edit the YAML file. Update the weight  to be an integer between 0  and 256  that specifies the relative weight of the target against other target reference objects. The value 0  suppresses requests to this back end. The default is 100 . Run oc explain routes.spec.alternateBackends for more information about the options. 

4. Click Save . 

## 3.4.5.1.2. Managing weights of an new route using the web console 

1. Navigate to the Networking → Routes  page. 

2. Click Create Route . 

3. Enter the route Name . 

4. Select the Service . 

5. Click Add Alternate Service . 

6. Enter a value for Weight  and Alternate Service Weight . Enter a number between 0  and 255 that depicts relative weight compared with other targets. The default is 100 . 

7. Select the Target Port . 

8. Click Create . 

## 3.4.5.1.3. Managing weights using the CLI 

## Procedure 

1. To manage the services and corresponding weights load balanced by the route, use the oc set route-backends  command: 

$ oc set route-backends ROUTENAME \ [--zero|--equal] [--adjust] SERVICE=WEIGHT[%] [...] [options] 

For example, the following sets ab-example-a  as the primary service with weight=198  and ab- example-b  as the first alternate service with a weight=2 : 

