LoginSignup
4
1

More than 3 years have passed since last update.

Red Hat OpenShift Online でOpenShiftに入門する

Posted at

個人学習用のOpenShift環境をどう準備しようか思案していたのですが、
Starterプランであれば無料ということで、Red Hat OpenShift Onlineを利用することにしました。
本記事はその記録になります。

今回の内容は以下の記事を参考にさせて頂きました。
開発環境の準備とOpenShiftへのアクセス | Think IT(シンクイット)

OpenShift ONLINE の利用登録

以下のリンク先にアクセスします。
https://www.openshift.com/products/online/

image.png

スクロールして Starter PlanのSign up for freeを押下。

image.png

初回なのでSign upを押下します。
(いきなりLOG INしたらInternal Server Errorになりました・・・)

image.png

Red HatのIDとパスワード (事前登録済) を入力後、Terms & ConditionにチェックしてSubmit.

image.png

Phone Verificationが行われます。

image.png

指示通りVerificationをPassすると以下の画面に。

image.png

Confirm Subscriptionを押下。
Provisioning待ちとなりました。

image.png

15分ほどで以下のメールが来ました。

image.png

メールに記載のURLを押下してログインすると、OpenShiftのWebコンソールが表示されます。

image.png

Create Projectを押下して自分のProjectを作成してみました。

image.png

CLIによるアクセス

続けてローカルPCにOpenShiftのCLIを導入して、アクセスできるか確認します。
Webコンソール右上の?を押下して、Command Line Toolsへ。

image.png

oc をダウンロード。

image.png

PATHを通して確認します。

> oc
OpenShift Client

This client helps you develop, build, deploy, and run your applications on any
OpenShift or Kubernetes cluster. It also includes the administrative
commands for managing a cluster under the 'adm' subcommand.

To familiarize yourself with OpenShift, login to your cluster and try creating a sample     application:

oc login mycluster.mycompany.com
oc new-project my-example
oc new-app django-psql-example
oc logs -f bc/django-psql-example

・・・

ocを使ってログインしてみます。
Command Line ToolsページのCopy Login Commandリンクを押下。

image.png

Display Tokenリンクを押下。

image.png

TokenやLogin Commandが表示されます。

image.png

表示されたToken付きLoginコマンドを入力。

> oc login --token={my_token} --server=https://api.us-west-1.starter.openshift-online.com:6443
Logged into "https://api.us-west-1.starter.openshift-online.com:6443" as "xxxxxxx" using the token provided.

You have one project on this server: "nkproject"

Using project "nkproject".
Welcome! See 'oc help' to get started.

ログインできました。
続けてProjectの状態を確認します。が、当然何もありません。

>oc status
In project nkproject on server https://api.us-west-1.starter.openshift-online.com:6443

You have no services, deployment configs, or build configs.
Run 'oc new-app' to create an application.

>oc get all
No resources found in nkproject namespace.

次回はこのProjectにコンテナをデプロイします。

4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1