이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 4. Deploying an existing JWS image


You can use the JWS Operator to facilitate the deployment of an existing image for a web server application that you want to deploy in an OpenShift cluster. In this situation, you must create a custom resource WebServer file for the web server application that you want to deploy. The JWS Operator uses the custom resource WebServer file to handle the application deployment.

Prerequisites

  • You have installed the JWS Operator from OperatorHub.

    To ensure that the JWS Operator is installed, enter the following command:

    $ oc get deployment.apps/jws-operator-controller-manager
    Copy to clipboard

    The preceding command displays the name and status details of the Operator.

    For example:

    NAME           READY  UP-TO-DATE  AVAILABLE  AGE
    jws-operator   1/1    1           1          15h
    Copy to clipboard
    Note

    If you want to view more detailed output, you can use the following command:

    oc describe deployment.apps/jws-operator-controller-manager

Procedure

  1. Prepare your image and push it to the location where you want to display the image (for example, quay.io/<USERNAME>/tomcat-demo:latest).
  2. To create a custom resource file for your web server application, perform the following steps:

    1. Create a YAML file named, for example, webservers_cr.yaml.
    2. Enter details in the following format:

      apiVersion: web.servers.org/v1alpha1
      kind: WebServer
      metadata:
          name: <image name>
      spec:
          # Add fields here
          applicationName: <application name>
          replicas: 2
      webImage:
         applicationImage: <URL of the image>
      Copy to clipboard

      For example:

      apiVersion: web.servers.org/v1alpha1
      kind: WebServer
      metadata:
          name: example-image-webserver
      spec:
          # Add fields here
          applicationName: jws-app
          replicas: 2
      webImage:
         applicationImage: quay.io/<USERNAME>/tomcat-demo:latest
      Copy to clipboard
  3. To deploy your web application, perform the following steps:

    1. Go to the directory where you have created the web application.
    2. Enter the following command:

      $ oc apply -f webservers_cr.yaml
      Copy to clipboard

      The preceding command displays a message to confirm that the web application is deployed.

      For example:

      webserver/example-image-webserver created
      Copy to clipboard

      When you run the preceding command, the Operator also creates a route automatically.

  4. Verify the route that the Operator has automatically created:

    $ oc get routes
    Copy to clipboard
  5. Optional: Delete the webserver that you created in Step 3:

    $ oc delete webserver example-image-webserver
    Copy to clipboard
    Note

    Alternatively, you can delete the webserver by deleting the YAML file. For example:

    oc delete -f webservers_cr.yaml

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat, Inc.