Creating a Virtual Service Route Table

Create a virtual service route table for the virtual service in Service Mesh.

You must have at least one virtual deployment to create a virtual service route table.

Important

Before you proceed, you must set up the appropriate OCI policies for the virtual service route table resource. For details, see Required IAM Policy for Virtual Service Route Table.
    1. Open the navigation menu and click Developer Services. Under Containers & Artifacts, click Service Mesh.
    2. Click Service Meshes.
    3. On the Service Mesh page, from the list of compartments on the left side, select a compartment.
    4. From the list of meshes, click the mesh name that has the virtual service for which you want to create a route table.
    5. On the details page of the mesh, in the Virtual Services table, click the name of the virtual service for which you want to create a route table.
    6. On the details page of the virtual service, under Resources, click Route Tables, and then click Create route table.
    7. In the Create route table panel, provide the following details:
      • Name: The name of the virtual service route table. The name must be unique within the same virtual service and can't be changed after creation. The name must start with a letter or underscore, followed by letters, numbers, hyphens, or underscores. Length can be 1–255 characters. Avoid entering confidential information.
      • Description: (Optional) The description of the virtual service route table. The field is changeable. Avoid entering confidential information.
      • Priority: Sets the route table priority from 1 to 1000. The default is 500. Lower numbers are a higher priority. At the same priority, route tables are prioritized based on the time created with the most recent route table taking the highest priority.
      • Compartment: The compartment in which you want to create the virtual service route table. The default compartment is the one you selected before, but you can select any compartment that you have permission to work in.
      • Route Rule: Define the conditions and destinations for this rule.
        • Protocol: Select between HTTP and TCP. If you select HTTP, provide the following details:
          • Request Timeout (in milliseconds): The maximum duration in milliseconds for the target service to respond to a request. If provided, the timeout value overrides the default timeout of 15 seconds for the HTTP-based route rules and disabled (no timeout) when isGrpc is true. Setting the value 0 disables that the timeout.

            For streaming responses from the target service, consider either keeping the timeout disabled or set a sufficiently high value.

          • Path type: The type of path provided. The default PREFIX option treats the path as a prefix to an endpoint and is the only supported option. If pathType is not specified, the default is used.
          • Path: A path to this route, for example, /mypath. Specify no path value to default to root ("/"). When you specify a path without a root value, the rule prepends the root ("/") to the path.
          • gRPC: If selected, the rule checks that the content-type header contains application/grpc or one of the various application/grpc+ values.
      • Destinations: Pick the destination virtual deployment for this route.
        • Virtual Deployment: Select a virtual deployment.
        • Port: Select a port in the range of 1-65535. The rule allows only one port. If you don't specify a port, the rule targets all the ports on the virtual deployment.
          Caution

          Don't use the following Service Mesh reserved ports in your mesh resource: 15000, 15003, 15006, and 9901.
        • Weight: The weight for this destination. If only one destination is created, the value defaults to and must be 100. When multiple destinations are created, you can specify a value from 1-100 for each destination. When summed, the weights for all the destinations must total 100.
        • To add more destinations, click + Add another destination pair.
      • To add more rules, click + Add another rule.
    8. (Optional) To add tags to the virtual service route table, click show advanced options. For more information about tagging, see Resource Tags.
    9. Click Create route table.
  • To see what operations are available for virtual-service-route-table create use:

    oci service-mesh virtual-service-route-table create -h

    To create a virtual service route table use the oci service-mesh virtual-service-route-table create option:

    oci service-mesh virtual-service-route-table create --name "<name>" --compartment-id <compartmentId> --virtual-service-id <virtualServiceId> --route-rules <rules> --description <description> --priority <priority>

    where:

    • <name> (immutable): The name of the virtual service route table. The name must be unique within the same virtual service and can't be changed after creation. The name must start with a letter or underscore, followed by letters, numbers, hyphens, or underscores. Length can be 1–255 characters. Avoid entering confidential information.
    • <compartmentId> (optional): The OCID of the compartment to which the virtual service route table belongs.
    • <virtualServiceId>: The OCID of the virtual service in which this virtual service route table is created.
    • <rules>
      • <type>: Choose between the HTTP, TCP, and TLS_PASSTHROUGH protocols. If TLS_PASSTHROUGH is selected, the proxy doesn't manage TLS. The proxy passes encrypted data "as is" to the application that manages TLS on its own.

        HTTP option:

        • <path>: A path to this route, for example, /mypath. Specify no path value to default to root ("/"). When you specify a path without a root value, the rule prepends the root ("/") to the path.
        • <pathType>: The type of path provided. The default PREFIX option treats the path as a prefix to an endpoint and is the only supported option. If pathType is not specified, the default is used.
        • <isGrpc>: If set to true, the rule checks that the content-type header contains application/grpc or one of the various application/grpc+ values.
      • <destinations>: Defines the virtual deployment destinations for this route. A minimum of one destination is required.
        • <virtualDeploymentId> The OCID of the virtual deployment where the request is routed.
        • <weight>: The weight for this destination. If only one destination is created, the value defaults to and must be 100. When multiple destinations are created, you can specify a value from 1-100 for each destination. When summed, the weights for all the destinations must total 100.
        • <port>:
          Select a port in the range of 1-65535. The rule allows only one port. If you don't specify a port, the rule targets all the ports on the virtual deployment.
          Caution

          Don't use the following Service Mesh reserved ports in your mesh resource: 15000, 15003, 15006, and 9901.
    • <description> (optional): The description of the virtual service route table. The field is changeable. Avoid entering confidential information.
    • <priority> (optional): Sets the route table priority from 1 to 1000. The default is 500. Lower numbers are a higher priority. At the same priority, route tables are prioritized based on the time created with the most recent route table taking the highest priority.

    For example:

    oci service-mesh virtual-service-route-table create --compartment-id ocid1.compartment.oc1..aaa... --virtual-service-id ocid1.meshvirtualservice.oc1..aaa... --name "virtual-service-route-table" --route-rules '[{"destinations":[{"port":443,"type":"VIRTUAL_DEPLOYMENT","virtualDeploymentId":"ocid1.meshvirtualdeployment.oc1..aaa...","weight":100}],"isGrpc":true,"path":"/service-path","pathType":"PREFIX","type":"HTTP"}]' --description "my virtual-service-route-table" --priority 10

    The response to the command includes:

    • The virtual service route table's OCID
    • The life cycle state (for example, ACTIVE, FAILED).
    • The ID of the work request to create the virtual service route table (details of work requests are available for seven days after completion, cancellation, or failure).

    If you want the command to wait to return control until the virtual service is active or the request has failed, include either or both of the following parameters:

    • --wait-for-state SUCCEEDED
    • --wait-for-state FAILED

    For example:

    oci service-mesh virtual-service-route-table create --compartment-id ocid1.compartment.oc1..aaa... --virtual-service-id ocid1.meshvirtualservice.oc1..aaa... --name "virtual-service-route-table" --route-rules '[{"destinations":[{"port":443,"type":"VIRTUAL_DEPLOYMENT","virtualDeploymentId":"ocid1.meshvirtualdeployment.oc1..aaa...","weight":100}],"isGrpc":true,"path":"/service-path","pathType":"PREFIX","type":"HTTP"}]' --description "my virtual-service-route-table" --priority 10 --wait-for-state SUCCEEDED
    Tip

    You can't use the virtual service until the work request has successfully created it and the virtual service is active.

    Checking Virtual Service Status

    To see the status of the virtual service route table, enter:

    oci service-mesh virtual-service-route-table get --virtual-service-route-table-id <virtual-service-route-table-ocid>

    To view the status of the work request creating the virtual service, refer to Service Mesh Work Requests.

    Creating a Virtual Service Route Table using JSON File

    Alternatively, create a virtual service route table by supplying a JSON file to the create command.

    1. Generate a sample JSON file for a virtual service route table:

      oci service-mesh virtual-service-route-table create --generate-full-command-json-input
    2. Create a JSON file with the sample-generated output from preceding step and update the fields with appropriate values.
    3. Supply the JSON file to the virtual-service-route-table create command:

      oci service-mesh virtual-service create --from-json file:///<filename>

    For more information about using the CLI, see:

  • Use the CreateVirtualServiceRouteTable operation to create a virtual service route table.