没有合适的资源?快使用搜索试试~ 我知道了~
首页OpenShift官方教程,内有原文连接
OpenShift官方教程,内有原文连接

Environment Overview 1 Lab: Installing the OpenShift CLI 2 Lab: Exploring the CLI and Web Console 5 Lab: Deploy a Docker Image 8 Lab: Scaling and Self Healing 14 Lab:CreatingRoutes by Exposing Services 18 ......
资源详情
资源评论
资源推荐

目录
Environment Overview.................................................................................................... 1
Lab: Installing the OpenShift CLI..................................................................................2
Lab: Exploring the CLI and Web Console....................................................................5
Lab: Deploy a Docker Image...........................................................................................9
Lab: Scaling and Self Healing....................................................................................... 15
Lab:CreatingRoutes by Exposing Services..............................................................19
Lab: Exploring OpenShift’s Logging Capabilities..................................................21
Lab: OpenShift Role-Based Access Control.............................................................25
Lab: Remote Operations................................................................................................ 27
Exercise: Creating a Java application........................................................................31
Lab: Adding a Database................................................................................................. 36
Lab: Externalizing Application Configuration.......................................................44
Lab: Application Health................................................................................................. 45
Lab: Automating Deployment with CI/CD Pipeline..............................................45
Lab: Making Code Changes and using webhooks..................................................46
Lab: Canary Release to Production............................................................................46
Lab: Using Templates..................................................................................................... 46
Lab: Clustering Stateful Java EE Applications.........................................................49
文档官方地址:................................................................................................................. 50
Environment Overview
You will be interacting with an OpenShift environment that is running on Amazon Web Services. The
environment consists of the following systems:
1 master nodes
1 infrastructure nodes

24 "application" nodes
An NFS server
The infrastructure node is providing several services:
Aggregated logging
Cluster metrics
GitLab
This lab manual
The OpenShift Docker registry
The OpenShift router
Additionally, user accounts have been provisioned.
You will see various code and command blocks throughout these exercises. Some of the command
blocks can be copy/pasted directly. Others will require modification of the command before execution.
If you see a command block with a red border (see below), the command will require modification.
Typically this is a substitution of your username or user number:
some command for userXX
Lab: Installing the OpenShift CLI
Command Line Interface
OpenShift ships with a feature rich web console as well as command line tools to provide users with a
nice interface to work with applications deployed to the platform. The OpenShift tools are a single
executable written in the Go programming language and is available for the following operating
systems:
Microsoft Windows
Apple OS X
Linux

Downloading the tools
During this lab, we are going to download the client tool and add them to our operating system $PATH
environment variables so the executable is accessible from any directory on the command line.
The first thing we want to do is download the correct executable for your operating system as linked
below:
Microsoft Windows
Apple OS X
Linux 64
Once the file has been downloaded, you will need to extract the contents as it is a compressed archive. I
would suggest saving this file to the following directories:
Windows:
C:\OpenShift
OS X:
~/OpenShift
Linux:
~/OpenShift
Extracng the tools
Once you have the tools downloaded, you will need to extract the contents:
Windows:
In order to extract a zip archive on windows, you will need a zip utility installed on your system. With
newer versions of windows (greater than XP), this is provided by the operating system. Just right click
on the downloaded file using file explorer and select to extract the contents.
OS X:
Open up a terminal window and change to the directory where you downloaded the file. Once you are
in the directory, enter in the following command:

$ tar zxvf oc-macosx.tar.gz
Linux:
Open up a terminal window and change to the directory where you downloaded the file. Once you are
in the directory, enter in the following command:
$ tar zxvf oc-linux.tar.gz
Adding oc to your PATH
Windows:
Because changing your PATH on windows varies by version of the operating system, we will not list
each operating system here. However, the general workflow is right click on your computer name
inside of the file explorer. Select Advanced system settings. I guess changing your PATH is considered
an advanced task? :) Click on the advanced tab, and then finally click on Environment variables. Once
the new dialog opens, select the Path variable and add ";C:\OpenShift" at the end. For an easy way out,
you could always just copy it to C:\Windows or a directory you know is already on your path. For more
detailed instructions:
Windows XP
Windows Vista
Windows 7
Windows 8
Windows 10 - Follow the directions above.
OS X:
$ export PATH=$PATH:~/OpenShift
Linux:
$ export PATH=$PATH:~/OpenShift
Verify
At this point, we should have the oc tool available for use. Let’s test this out by printing the version of
the oc command:

$ oc version
You should see the following (or something similar):
oc v1.3.0 kubernetes v1.3.0+52492b4
If you get an error message, you have not updated your path correctly. If you need help, raise your
hand and the instructor will assist.
Lab: Exploring the CLI and Web Console
Command Line
The first thing we want to do to ensure that our oc command line tools was installed and successfully
added to our path is login to the OpenShift environment that has been provided for this Roadshow
session. In order to login, we will use the oc command and then specify the server that we want to
authenticate to. Issue the following command:
$ oc login master.shanghai.openshift3roadshow.com
You may see the following output:
The server uses a certificate signed by an unknown authority. You can
bypass the certificate check, but any data you send to the server
could be intercepted by others. Use insecure connections? (y/n):
Enter in Y to use a potentially insecure connection. The reason you received this message is because
we are using a self-signed certificate for this workshop, but we did not provide you with the CA
certificate that was generated by OpenShift. In a real-world scenario, either OpenShift’s certificate
would be signed by a standard CA (eg: Thawte, Verisign, StartSSL, etc.) or signed by a corporate-
standard CA that you already have installed on your system.
On some versions of Microsoft Windows, you may get an error that the server has an invalid x.509
certificate. If you receive this error, enter in the following command:
$ oc login master.shanghai.openshift3roadshow.com --insecure-skip-
tls-verify=true
剩余49页未读,继续阅读















安全验证
文档复制为VIP权益,开通VIP直接复制

评论4