openshift 学习笔记-1

一、网络

  1. pod IP:172.17.0.3 –>docker 中的容器ip
  2. service IP:172.30.217.14 –>服务IP 用于pod间通信,可跨node节点,此IP是虚拟IP,物理机无法访问。
  3. route IP:192.168.226.144 –>暴露给外网的IP,路由到service–>container

二、oc 客户端

  • 查看版本
$oc version
oc v3.7.0-alpha.1+fdbd3dc
kubernetes v1.7.0+695f48a16f
features: Basic-Auth

Server https://192.168.226.144:8443
openshift v3.6.0-rc.0+98b3d56
kubernetes v1.6.1+5115d708d7
  • 登陆
$oc version
oc v3.7.0-alpha.1+fdbd3dc
kubernetes v1.7.0+695f48a16f
features: Basic-Auth

Server https://192.168.226.144:8443
openshift v3.6.0-rc.0+98b3d56
kubernetes v1.6.1+5115d708d7
  • 创建新项目
oc version
oc v3.7.0-alpha.1+fdbd3dc
kubernetes v1.7.0+695f48a16f
features: Basic-Auth

Server https://192.168.226.144:8443
openshift v3.6.0-rc.0+98b3d56
kubernetes v1.6.1+5115d708d7
#查新看一下结果:
$oc get project
NAME             DISPLAY NAME   STATUS
hello-world-oc                  Active
  • 创建应用程序,部署镜像
$oc new-app openshift/hello-openshift
--> Found Docker image ecb93ca (11 hours old) from Docker Hub for "openshift/hello-openshift"

    * An image stream will be created as "hello-openshift:latest" that will track this image
    * This image will be deployed in deployment config "hello-openshift"
    * Ports 8080/tcp, 8888/tcp will be load balanced by service "hello-openshift"
      * Other containers can access this service through the hostname "hello-openshift"
    * WARNING: Image "openshift/hello-openshift" runs as the 'root' user which may not be permitted by your cluster administrator

--> Creating resources ...
    imagestream "hello-openshift" created
    deploymentconfig "hello-openshift" created
    service "hello-openshift" created
--> Success
    Run 'oc status' to view your app.
#查询一下创建结果
$oc get pod
NAME                      READY     STATUS    RESTARTS   AGE
hello-openshift-1-3r588   1/1       Running   0          1m

#查看详细信息
oc describe pod hello-openshift-1-3r588
Name:           hello-openshift-1-3r588
Namespace:      hello-world-oc
Node:           localhost/192.168.226.144
Start Time:     Thu, 12 Oct 2017 15:25:28 +0800
Labels:         app=hello-openshift
                deployment=hello-openshift-1
                deploymentconfig=hello-openshift
Annotations:    kubernetes.io/created-by={"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"ReplicationController","namespace":"hello-world-oc","name":"hello-openshift-1","uid":"82a46c44-af1e-11e7-a...
                openshift.io/deployment-config.latest-version=1
                openshift.io/deployment-config.name=hello-openshift
                openshift.io/deployment.name=hello-openshift-1
                openshift.io/generated-by=OpenShiftNewApp
                openshift.io/scc=restricted
Status:         Running
IP:             172.17.0.4
Created By:     ReplicationController/hello-openshift-1
Controlled By:  ReplicationController/hello-openshift-1
Containers:
  hello-openshift:
    Container ID:

三、系群管理员

默认集群管理员为 system:admin ,该用户没有密码,登陆需要依赖证书密钥。登陆方法如下:
oc命令行,直接执行:
oc login -u system:admin

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值