ããã«ã¡ã¯ãRed Hat Partner Technical Account Managerã®ã¤ã¢ã³ã§ãã
ãµãã¼ãã±ã¼ã¹å¯¾å¿ã®ä¸ã§ã¯ãã客æ§ãééãã¦ããäºè±¡ãåç¾ããããã®ãµã³ãã«ã¢ããªãèªåã§ä½ããã¨ãå¤ãã§ãã ããã«ã¦ã§ã¢åä½ã®åé¡ã§ããã°ãRed Hat Customer Portalãã対象製åããã¦ã³ãã¼ãããããã¢ããªããããã¤ã§ãã¾ãã ã§ããã客æ§ã¯OpenShiftã®ç°å¢ã使ã£ã¦ããã¨ãã¯ã©ããã¾ããããï¼
å½ã·ãªã¼ãºã§ã¯ããã¼ã«ã«PCä¸ã®ãµã³ãã«ã¢ããªããã®ã¾ã¾ä½¿ã£ã¦ãOpenShiftã«æ軽ã«ãããã¤ããæ¹æ³ãç´¹ä»ãã¾ãã
å½ã·ãªã¼ãº
- OpenShiftã®åç¾ç°å¢ä½æã®ã³ã - 第1å Quickstartsç´¹ä»
- OpenShiftã®åç¾ç°å¢ä½æã®ã³ã - 第2å ä¸ãããã«ã
- OpenShiftã®åç¾ç°å¢ä½æã®ã³ã - 第3å ã©ã³ã¿ã¤ã ã¤ã¡ã¼ã¸ã®å©ç¨
ç®æ¬¡
- å½ã·ãªã¼ãº
- ç®æ¬¡
- OpenShiftãæ¬å½ã«å¿ è¦ï¼
- OpenShiftã®æ¤è¨¼ç°å¢ã®å ¥æ
- Quickstarts
- ã¾ã¨ãã¨æ¬¡åã®äºå
OpenShiftãæ¬å½ã«å¿ è¦ï¼
ã¾ãã¯ãOpenShiftç°å¢ãæ¬å½ã«å¿ è¦ãã©ãããåãåãã¾ãããã
OpenShiftç¹æã®æ©è½ã使ã£ã¦ããªããã°ãããã«ã¦ã§ã¢åä½ã§åç¾ãããã¨ã¯å¯è½ããããã¾ããã
ã¾ããOpenShiftã§å©ç¨ãã¦ããã³ã³ããã¤ã¡ã¼ã¸ã¯Red Hat Container Registryãããã¦ã³ãã¼ãå¯è½ã§ããããã¼ã«ã«ã§ Podman ã Docker ã§ãã®ã¾ã¾ä½¿ãã¾ãã ãã®ããæ¹ã«ã¤ãã¦ã¯ã以åæ稿ãããã¼ã«ã«ã§ã®Source-To-Image (s2i)ã®æ¤è¨¼ããåç §ãã ããã
æ®å¿µãªãããBuildConfigãDeployment/DeploymentConfigã®æå確èªãã³ã³ããã®ã©ã¤ããµã¤ã¯ã«ããã¯ã®åä½ç¢ºèªãªã©ã®å ´åã¯ãOpenShiftç°å¢ãå¿ è¦ã«ãªãã¾ãã
ã§ããå²ã¨æ軽ã«OpenShiftç°å¢ãå ¥æã§ãã¾ãï¼
OpenShiftã®æ¤è¨¼ç°å¢ã®å ¥æ
OpenShiftã®æ¤è¨¼ç°å¢ãå ¥æããæ¹æ³ã¯ããã¤ãåå¨ãã¦ãã¾ãã
- 身è¿ãªç°å¢ï¼ç¤¾å ãæ ¡å ããèªå® ãªã©ï¼ããã®ã¾ã¾å©ç¨ãã
AWS, Azure, GCPä¸ã®OpenShiftç°å¢
大æã¯ã©ã¦ããµã¼ãã¹ã§æ軽ã«OpenShiftç°å¢ãèµ·åã§ãã¾ãããæåã«ãªãã¾ãã
Red Hatæä¾ã®Developer Sandbox for Red Hat OpenShift
Red Hat Developer ã®ã¢ã«ã¦ã³ãããæã¡ã§ããã°ã30æ¥éç¡åã§ãå©ç¨ã§ããç°å¢ã使ãã¾ãã詳細ã¯ä¸è¨ã®ãªã³ã¯ãã覧ãã ããã
OpenShift Local(æ§å: CodeReady Containers (CRC))
ãã¼ã«ã«PCã«OpenShiftç°å¢ãèµ·åããæ¹æ³ã§ãã ç°¡åã«å°å ¥ã§ãã¾ãããæä½éã®å¿ è¦ã¹ããã¯ã¯é«ãã§ãï¼
- 4 CPUã³ã¢ä»¥ä¸
- 9 GBã¡ã¢ãªä»¥ä¸
- 35 GBãã£ã¹ã¯ä»¥ä¸
å½è¨äºã§ã¯ãOpenShift Localãå©ç¨ãã¾ãããä»ã®ç°å¢ã§ã使ããã¯ãã§ãã
ç°å¢ã®ç¨æãã§ãããããµã³ãã«ã¢ããªã®ãããã¤ã®ä»æ¹ãè¦ã¦ã¿ã¾ãããã
OpenShift Localã®æ§è½åä¸
ãã¼ã«ã«PCã§èµ·åããã¨ãã¯ãç§ã¯ä»¥ä¸ã®ã³ãã³ããäºåã«å®è¡ããæ§è½ãåä¸ããã¾ãã ãã¡ãããèªåã®ç°å¢ã«åããã¦è¨å®ãå¤æ´ãã¦ãã ããã
8ã³ã¢ã¾ã§å©ç¨ãã
crc config set cpus 8
14GBã¡ã¢ãªã¾ã§å©ç¨ãã
crc config set memory 14336
Quickstarts
ãµã³ãã«ã¢ããªãä½ãããå ´åã¯ãä¸ããä½ãã®ã大å¤ã§ãããã EJBã®ã¢ããã¼ã·ã§ã³ã¯ä½ã§ããã£ãï¼ ã©ããã£ã¦ãã¼ã¿ãã¼ã¹æ¥ç¶ãç¨æããã°ããã®ï¼ RESTã®Webãµã¼ãã¹ãã©ãå®ç¾©ããã°ããã§ããããï¼
ãå®å¿ãã ããï¼ä¸ããä½æããå¿ è¦ãå ¨ãããã¾ããï¼
Red Hatã¯ãQuickstartã¨å¼ã°ããé«åº¦ãªæ©è½ããã使ããããã®ãµã³ãã«ã¢ããªãæä¾ãã¦ãã¾ãã
EAPã®å ´åã¯ã80åå¼±ã®QuickstartããããEJBãMDBãJPAãCXFãResteasy ãªã©ã®æè¡ã使ã£ã¦ãããµã³ãã«ãããã¾ãã
kitchensink (æµãå°)ã®Quickstartã¯è¤æ°æ©è½ãç¨ãã¦ãä¸è¬çãªWebã¢ããªã«è¿ããµã³ãã«ã§ãããåç¾ã¢ããªã®ãã¼ã¹ã¨ãã¦ã¯è¥å¹²è¤éã§ãã
åç´ãªã¢ããªãä½ãããå ´å㯠helloworld-* ã®Quickstartããã¼ã¹ã«ãããã¨ããå§ãã§ãã
Quickstart ã®è©³ç´°ã¯ä»¥ä¸ã®ãªã³ã¯ãã覧ãã ããã
- Red Hatã«ã¹ã¿ãã¼ãã¼ã¿ã«ä¸ã®JBoss EAP quickstart examples
- GitHubä¸ã®jboss-developer/jboss-eap-quickstarts
OpenShiftã§ã®ãããã¤
Quickstartã®ãµã³ãã«ã¢ããªãOpenShiftã«ãããã¤ããæã®æé ã¯ä»¥ä¸ã®æãã§ãã
- OpenShiftä¸ã®ããã¸ã§ã¯ããä½æãã
- å¿ è¦ãªãªã½ã¼ã¹ãã¤ã³ãã¼ããã
- ãã³ãã¬ã¼ããç¨ãã¦EAP 7.4ã®ã¢ããªãä½æãã
ãã®æé ã®è©³ç´°ã¯ç¬¬2ç« JBoss EAP for OpenShift ã¤ã¡ã¼ã¸ã§ã® Java ã¢ããªã±ã¼ã·ã§ã³ã®ãã«ãããã³å®è¡ã«è¨è¼ããã¦ãã¾ãã
ããã¸ã§ã¯ãä½æ
oc new-project quickstart
ã³ãã³ãã§æ°ããOpenShiftããã¸ã§ã¯ããä½æããã
å½è¨äºã§ã¯ quickstart ã¨ããååã使ã£ã¦ãã¾ãããä»»æã«æ±ºãã¦ããã§ããå¥ã®ååã使ã£ãå ´åã¯ãããããã®ã³ãã³ãä¾ã« quickstart ãç½®ãæãã¦ãã ããã
$ oc new-project quickstart Now using project "quickstart" on server "https://api.crc.testing:6443". You can add applications to this project with the 'new-app' command. For example, try: oc new-app rails-postgresql-example to build a new example application in Ruby. Or use kubectl to deploy a simple Kubernetes application: kubectl create deployment hello-node --image=k8s.gcr.io/e2e-test-images/agnhost:2.33 -- /agnhost serve-hostname
ImageStreamã®ã¤ã³ãã¼ã
ææ°çã®JBoss EAP 7ã®ImageStreamã quickstart ããã¸ã§ã¯ãã«ã¤ã³ãã¼ããã¾ãã ãã®ä¾ã«ã¯ãJDK 11ç¨ã®ã¤ã¡ã¼ã¸ãå©ç¨ãã¾ãã
$ oc create -f \ https://raw.githubusercontent.com/jboss-container-images/jboss-eap-openshift-templates/eap74/eap74-openjdk11-image-stream.json
Templateã®ã¤ã³ãã¼ã
EAPã¢ããªãç°¡åã«ãããã¤ããããã®ãã³ãã¬ã¼ããç¨æããã¦ãã¾ãã ãã³ãã¬ã¼ãæ å ±ã quickstart ããã¸ã§ã¯ãã«ã¤ã³ãã¼ããã¾ãã
NOTE: ãã³ãã¬ã¼ãã使ããªãæ¹æ³ã¯å¾ã§ç´¹ä»ãã¾ãã
for resource in \ eap74-amq-persistent-s2i.json \ eap74-amq-s2i.json \ eap74-basic-s2i.json \ eap74-https-s2i.json \ eap74-sso-s2i.json do oc create -f \ https://raw.githubusercontent.com/jboss-container-images/jboss-eap-openshift-templates/eap74/templates/${resource} done
NOTE: ã³ãã³ããè²¼ãä»ããå ´åã¯ã$\{resource\}
ã«ãªããªãããã«ã注æãã ããã
ã¢ããªã®ä½æ
å ç¨ã®ãã³ãã¬ã¼ãã使ã£ã¦ãQuickstartã®ã¢ããªããããã¤ãã¾ãã
$ oc new-app --template=eap74-basic-s2i \ -p IMAGE_STREAM_NAMESPACE=quickstart \ -p EAP_IMAGE_NAME=jboss-eap74-openjdk11-openshift:7.4.0 \ -p EAP_RUNTIME_IMAGE_NAME=jboss-eap74-openjdk11-runtime-openshift:7.4.0 \ -p SOURCE_REPOSITORY_URL=https://github.com/jboss-developer/jboss-eap-quickstarts \ -p SOURCE_REPOSITORY_REF=7.4.x \ -p CONTEXT_DIR=helloworld-rs \ -p GALLEON_PROVISION_LAYERS=jaxrs-server \ -e ENABLE_ACCESS_LOG=true
NOTE: quickstart 以å¤ã®ããã¸ã§ã¯ãåã使ã£ãå ´åã¯ãIMAGE_STREAM_NAMESPACE
ã®å¤ãããã¸ã§ã¯ãåã«å¤æ´ãã¦ãã ããã
ãªããåç°å¢å¤æ°ã®è©³ç´°ã¯2.5. JBoss EAP S2I (Source-to-Image) ã¢ããªã±ã¼ã·ã§ã³ã® OpenShift ã¸ã®ãããã¤ã¾ã§ãåç §ãã ããã
ãã«ãã¨ãããã¤
ããã¾ã§ã§ããããOpenShiftä¸ã«æå®ããQuickstartã®ã¢ããªããã«ãã¨ãããã¤ããã¾ãã
å
¨ä½ã®ç¶æ³ã oc status
ã³ãã³ãã§ç¢ºèªã§ãã¾ãã
ãã«ããå®äºããããã¢ããªã®åä½ã確èªãã¾ãããã
稼å確èª
以ä¸ã®ã³ãã³ãã§ã¢ããªã®ãã¹ãåãåå¾ãã¾ãã
oc get route/eap-app -o jsonpath='{.spec.host}'
curl
ã使ã£ã¦ãhttpsã§ã¢ããªã«ã¢ã¯ã»ã¹ãã¾ãã
$ curl -k -w '\n' https://<host>/rest/json {"result":"Hello World!"}
ã§ãã¾ããï¼
次ã®ã¹ããã
Quickstartã®ãµã³ãã«ã¢ããªãç°¡åã«OpenShiftã«ãããã¤ã§ãã¾ããï¼
ã§ããããã§ä¸ã¤çåãããã¾ãããï¼ ã©ããã£ã¦ã¢ããªã®ã³ã¼ããç·¨éãã¾ããï¼
QuickstartãGitHubãããããã¤ãã¾ããããGitHubã®ã¬ãã¸ããªããã©ã¼ã¯ãããã¼ã«ã«ã«ã¯ãã¼ã³ããä¿®æ£ããã¾ãããã·ã¥ããã®ã¯ããªãæéããããã¾ãã
ãã¼ã«ã«ã®ã½ã¼ã¹ã³ã¼ããããã«ãããæ¹æ³ã説æãã¾ãã
Quickstartã¢ããªã®ã³ã¼ãä¿®æ£
ã³ã¼ããä¿®æ£ããããã«ã¯ããã¼ã«ã«ã«ã³ã¼ããç¨æããå¿ è¦ãããã¾ãã
- jboss-eap-quickstartsããã¼ã«ã«ã«ã¯ãã¼ã³ããã
- jboss-eap-quickstarts ãã£ã¬ã¯ããªã«ç§»åããã
7.4.x
ãã©ã³ãã«åãæ¿ããã
æºåãã§ããããã³ã¼ããç·¨éãã¾ãã
å
ã« helloworld-rs ãå©ç¨ããããã helloworld-rs ã®ä¸ã® HelloService.java ã以ä¸ã®ããã«å¤æ´ãã¾ãã
RESTãµã¼ãã¹ã®å¿çã® Hello
ã Hi
ã«åãæ¿ãã¾ãã
å¤æ´å
public class HelloService { String createHelloMessage(String name) { return "Hello " + name + "!"; } }
å¤æ´å¾
public class HelloService { String createHelloMessage(String name) { return "Hi " + name + "!"; } }
ç·¨éã§ããããã¢ããªãOpenShiftã«ãããã¤ãã¾ãããï¼
- jboss-eap-quickstarts ãã£ã¬ã¯ããªã«æ»ã
ãã«ããéå§ãã
oc start-build eap-app-build-artifacts --from-dir=.
oc start-build
ã®--from-dir
ãªãã·ã§ã³ã使ã£ã¦ããã¼ã«ã«ãã£ã¬ã¯ããªå ã®ãã¡ã¤ã«ãå§ç¸®ããOpenShiftã¸è»¢éãããã¨ãå¯è½ã§ãããã«ãã¨ãããã¤ãå®äºãããããµã¤ããã¢ã¯ã»ã¹ãã
$ curl -k -w '\n' https://<host>/rest/json {"result":"Hi World!"}
start-build
ã« --from-dir
ãªãã·ã§ã³ã使ãã°ããã¼ã«ã«ã®ã½ã¼ã¹ã³ã¼ãããã®ã¾ã¾OpenShiftã«è»¢éãããã«ãã§ãã¾ãã
ãã ããã¢ããªãä½æããã¨ãã¯ã CONTEXT_DIR=helloworld-rs
ãæå®ãã¾ããã®ã§ã helloworld-rs ã®ãã£ã¬ã¯ããªãã½ã¼ã¹ã³ã¼ãã«ãªãã¨ããã«ããã¨ã©ã¼ã«ãªãã¾ãã
ãã¾ãæè»æ§ãããã¾ãããã
ã¾ãããã®ããæ¹ã§ã¯ããã«ãæã«ã¯ jboss-eap-quickstarts ãå ¨é¨ã¾ã¨ãã¦OpenShiftã«è»¢éããå¿ è¦ãããã¾ãã ãããå°ãç¡é§ãå¤ãã§ãã
è²ã ã§ãã¾ããããã¾ã å°ãç©è¶³ãã¾ããã
ã¾ã¨ãã¨æ¬¡åã®äºå
å¼ç¤¾ãæä¾ãã¦ããQuickstartããã¼ã¹ã«ãããµã³ãã«ã¢ããªãOpenShiftã«ç°¡åã«ãããã¤ããæ¹æ³ãç´¹ä»ãã¾ããã ã¾ãããã®ã¢ããªãä¿®æ£ããåãããã¤ããæ¹æ³ã説æãã¾ããã
次åã¯ããã³ãã¬ã¼ãã¨GitHubã使ããã«ãæ¢ã«ãã¼ã«ã«ã«ããã½ã¼ã¹ã³ã¼ãã®ãããã¤æ¹æ³ãåå¼·ãã¾ãã