Create a Microservices-based App

    This tutorial demonstrates how to create a microservices-based app Bookinfo, which is composed of four Services, and set a customized domain name to access the app.

    • You need to create a workspace, a project, and a user () for this tutorial. The user needs to be invited to the project with the operator role. For more information, see Create Workspaces, Projects, Users and Roles.
    • project-admin needs to so that project-regular can define a domain name when creating the app.
    1. Log in to the web console of KubeSphere and navigate to Apps in Application Workloads of your project. On the Composed Apps tab, click Create.

    2. On the Services page, you need to create microservices that compose the app. Click Create Service and select Stateless Service.

    3. Set a name for the Service (e.g productpage) and click Next.

      Note

      You can create a Service on the dashboard directly or enable Edit YAML in the upper-right corner to edit the YAML file.

    4. Click Add Container under Containers and enter in the search box to use the Docker Hub image.

      You must press Enter in your keyboard after you enter the image name.

    5. Click Use Default Ports. For more information about image settings, see Pod Settings. Click in the lower-right corner and Next to continue.

    6. On the Volume Settings page, or click Next to continue.

    7. Click Create on the Advanced Settings page.

    8. When you finish adding microservices, click Next.

    9. On the Route Settings page, click Add Routing Rule. On the Specify Domain tab, set a domain name for your app (for example, demo.bookinfo) and select HTTP in the Protocol field. For Paths, select the Service productpage and port 9080. Click OK to continue.

      Note

    10. You can add more rules or click Create to finish the process.

    11. Wait for your app to reach the Ready status.

    1. As you set a domain name for the app, you need to add an entry in the hosts () file. For example, add the IP address and hostname as below:

      Note

      You must add your own IP address and hostname.

    2. In Composed Apps, click the app you just created.

    3. Click Normal user and Test user respectively to see other Services.