OpenShift Online에서 tomcat에 helloworld 앱을 배포해 봅니다 (그 1)
7251 단어 GitHubkubernetes시Tomcatopenshift

모두 keita69sawada입니다.
무료로 사용할 수 있는 PaaS 서비스를 찾고 있다면
OpenShift라는 RedHat의 PaaS 서비스를 발견했습니다.
무엇을 할 수 있는지 시험해 보자.
자, "조속히 계정을 만들어 시험해 보자!"
성게는이 기사입니다.
대상 독자
전제 조건
절차
전체 이미지 다이어그램

1. OpenShift 이용 등록
아래의 페이지를 참고로 「이용 등록」합니다.
h tp : // jp 렙 t. 코 m / 오 네이 ぇ _ 온 네 / 코 엠 / 오미 조 / 4029 /
2. OpenShift 환경 설정(작업 PC)
OpenShift 전용 명령줄 도구를 다운로드하여 적절한 디렉토리(예: C:\tmp)에 압축을 풉니 다.
압축을 푼 파일에 oc.exe가 있기 때문에
적절한 디렉토리 (예 : C :\tools\openshift-origin-client-tools)를 만듭니다.
PAHT를 통과합니다.
2. OpenShift 프로젝트 만들기(OpenShift 콘솔 화면)
OpenShift 콘솔 화면을 엽니다.
※ URL은 이용 등록시의 메일에 기재
예)
https://console.starter-us-west-2.openshift.com/console
CreateProject 버튼을 누릅니다.

각 항목을 입력하고 "Create"버튼을 누릅니다.

프로젝트가 생성되면 아래 화면이 표시됩니다.

3. 샘플 애플리케이션을 Fork(복사)(GitHub.com 콘솔)
샘플 애플리케이션이 있는 리포지토리에 액세스합니다.
오른쪽 하단의 "Fork"버튼을 누릅니다.

포크하면 GitHub에 샘플 애플리케이션이 복사됩니다. (소스 수정을 자유롭게 할 수 있게 된다)
※ 아카마루 부분이 자신의 GitHub ID로 바뀌고 있다

포크 한 리포지토리의 URL을 복사합니다.

3. 애플리케이션 빌드(oc 명령)
명령
rem "★ 必要に応じて変更(↓)"
set OC_PATH="C:\tools\openshift-origin-client-tools"
set PATH=%PATH%;%OC_PATH%
rem "★ 必要に応じて変更(↓)"
set OSHIFT_URL="https://console.starter-us-west-2.openshift.com"
oc login %OSHIFT_URL%
rem "★ Openshiftの ユーザ名、パスワード入力"
rem "★ 必要に応じて変更(↓)"
set FORK_URL=https://github.com/keita69/os-sample-java-web.git
oc new-app --name=tomcat-hello-world jboss-webserver30-tomcat8-openshift~%FORK_URL%
성공하면
--> Success
로 표시됩니다.실행 결과
>oc new-app --name=tomcat-hello-world jboss-webserver30-tomcat8-openshift~https://github.com/%GITHUB_ID%/os-sample-java-web.git
warning: Cannot find git. Ensure that it is installed and in your path. Git is required to work with git repositories.
--> Found image 4cff535 (6 weeks old) in image stream "openshift/jboss-webserver30-tomcat8-openshift" under tag "latest" for "jboss-webserver30-tomcat8-openshift"
JBoss Web Server 3.0
--------------------
Platform for building and running web applications on JBoss Web Server 3.0 - Tomcat v8
Tags: builder, java, tomcat8
* A source build using source code from https://github.com/keita69/os-sample-java-web.git will be created
* The resulting image will be pushed to image stream "tomcat-hello-world:latest"
* Use 'start-build' to trigger a new build
* This image will be deployed in deployment config "tomcat-hello-world"
* Ports 8080/tcp, 8443/tcp, 8778/tcp will be load balanced by service "tomcat-hello-world"
* Other containers can access this service through the hostname "tomcat-hello-world"
--> Creating resources ...
imagestream "tomcat-hello-world" created
buildconfig "tomcat-hello-world" created
deploymentconfig "tomcat-hello-world" created
service "tomcat-hello-world" created
--> Success ★★★ 成功 ★★★
Build scheduled, use 'oc logs -f bc/tomcat-hello-world' to track its progress.
Run 'oc status' to view your app.
4. 애플리케이션 게시(oc 명령)
명령
oc expose svc tomcat-hello-world
실행 결과
>oc expose svc tomcat-hello-world
route "tomcat-hello-world" exposed
5. 브라우저에서 액세스해 봅니다.
OpenShift 콘솔에서 URL을 확인합니다.

Hostname URL을 클릭합니다.

아래 화면이 표시되면 OK!

6. 애플리케이션 업데이트 및 반영
길어졌으므로 다시 씁니다.
요약
일본어 정보가 적기 때문에 처음에는 당황했습니다.
그러나 Docker 이미지 관리 메커니즘 (kubernetes 기반) 및
DevOps의 구조 (GitHub 연계)가 갖추어져 있기 때문에 쓰러뜨리면
OpenShift 매우 편리!
참고 URL
h tp : // jp 렙 t. 코 m / 오 네이 ぇ _ 온 네 / 코 엠 / 오미 조 / 4029 /
htps : // bg. 오페시 ft. 코 m / 엔 s 탤
htps : // bg. 오페시 ft. 코 m / 갓찐 g - s r d d u th j bou s - u b-se r ゔ r /
Reference
이 문제에 관하여(OpenShift Online에서 tomcat에 helloworld 앱을 배포해 봅니다 (그 1)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/keita69sawada/items/05f42cae9dc4c11fa1ed텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)