「.NET 開発基盤部会 Wiki」は、「Open棟梁Project」,「OSSコンソーシアム .NET開発基盤部会」によって運営されています。
OpenShiftのファーストステップをどうやるか?
OpenShift Container Platformの機能を体験するのに役立つ。
national parks(国立公園)サンプル・アプリケーション
Azure上にデプロイされる。
No test drive was found!
と表示されるので、
Explore more solutions on Azure Marketplace [See more]
を押下して、Marketplace 起動する。
C:\openshift-cli
>oc OpenShift Client ・・・ >oc version oc v1.4.1+3f9807a kubernetes v1.4.0+776c994 features: Basic-Auth
>oc login opnshdnsxx.westus.cloudapp.azure.com:8443
Use insecure connections? (y/n):
>oc login https://opnshdnsxx.westus.cloudapp.azure.com:8443 –insecure-skip-tls-verify=true
Username: (The username provided to you in Access information section of the test-drive) Password: (The password provided to you in Access information section of the test-drive) Login successful.
>oc new-project <projectname>
https://opnshdnsxx.westus.cloudapp.azure.com:8443/<Exact URL is under Access information of test drive>
最初のイメージを展開する。
https://hub.docker.com/r/kubernetes/guestbook/
>oc new-project usertestdrive-guestbook
Now using project "usertestdrive-guestbook" on server "https://opnshdnsxx.westus.cloudapp.azure.com:8443".
>oc get projects NAME DISPLAY NAME STATUS usertestdrive-guestbook Active
>oc new-app kubernetes/guestbook --> Found Docker image 4305190 (2 years old) from Docker Hub for "kubernetes/guestbook" * An image stream will be created as "guestbook:latest" that will track this image * This image will be deployed in deployment config "guestbook" * Port 3000/tcp will be load balanced by service "guestbook" * Other containers can access this service through the hostname "guestbook" * WARNING: Image "guestbook" runs as the 'root' user which may not be permitted by your cluster administrator --> Creating resources with label app=guestbook ... imagestream "guestbook" created deploymentconfig "guestbook" created service "guestbook" created --> Success Run 'oc status' to view your app.
>oc get pods -w
- ポータルに移動
- プロジェクトを選択
usertestdrive-guestbook- ブラウズを選択
- ポッドを選択
>oc get services NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE guestbook 172.30.XXX.XXX <none> 3000/TCP 12m
>oc get service guestbook -o json ・・・JSON・・・
>oc get pods NAME READY STATUS RESTARTS AGE guestbook-1-e83hb 1/1 Running 0 24m >oc get pod guestbook-1-e83hb -o json ・・・JSON・・・
>oc describe service guestbook
>oc get routes <no output>
>oc get services NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE guestbook 172.30.XXX.XXX <none> 3000/TCP 31m
>oc expose service guestbook route "guestbook" exposed
>oc get routes NAME HOST/PORT PATH SERVICE TERMINATION LABELS guestbook guestbook-guestbook.apps.10.2.2.2.xip.io guestbook:3000-tcp app=guestbook
guestbook-guestbook.apps.10.2.2.2.xip.io