3.4. Deploying the front-end application


Deploy the front-end application that provides the external-facing web component for the tutorial.

The simplest way to deploy an application in OpenShift Container Platform is to run a provided container image.

The following procedure deploys parksmap, which is the front-end component of the national-parks-app application. The web application displays an interactive map of the locations of national parks across the world.

Prerequisites

  • You have access to an OpenShift Container Platform cluster.
  • You have installed the OpenShift CLI (oc).

Procedure

  • Deploy the parksmap application by running the following command:

    $ oc new-app quay.io/openshiftroadshow/parksmap:latest --name=parksmap -l 'app=national-parks-app,component=parksmap,role=frontend,app.kubernetes.io/part-of=national-parks-app'

    Example output

    --> Found container image 0c2f55f (4 years old) from quay.io for "quay.io/openshiftroadshow/parksmap:latest"
    
        * An image stream tag will be created as "parksmap:latest" that will track this image
    
    --> Creating resources with label app=national-parks-app,app.kubernetes.io/part-of=national-parks-app,component=parksmap,role=frontend ...
        imagestream.image.openshift.io "parksmap" created
        deployment.apps "parksmap" created
        service "parksmap" created
    --> Success
        Application is not exposed. You can expose services to the outside world by executing one or more of the commands below:
         'oc expose service/parksmap'
        Run 'oc status' to view your app.

3.4.1. Exposing the front-end service

By default, services running on OpenShift Container Platform are not accessible externally. To expose your service so that external clients can access it, you can create a route.

A Route object is a OpenShift Container Platform networking resource similar to a Kubernetes Ingress object. The default OpenShift Container Platform router (HAProxy) uses the HTTP header of the incoming request to determine where to proxy the connection.

Optionally, you can define security, such as TLS, for the route.

Prerequisites

  • You have deployed the parksmap front-end application.
  • You have cluster-admin or project-level admin privileges.

Procedure

  • Create a route to expose the parksmap front-end application by running the following command:

    $ oc create route edge parksmap --service=parksmap

Verification

  • Verify that the application route was successfully created by running the following command:

    $ oc get route parksmap

    Example output

    NAME        HOST/PORT                                                   PATH   SERVICES   PORT       TERMINATION   WILDCARD
    parksmap    parksmap-user-getting-started.apps.cluster.example.com             parksmap   8080-tcp   edge          None

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部