Joshua_Pu

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

因为进度原因, 先把目前在做的更新出来, 之后再补上缺失的内容.

快速搭建一个 OCP 来做测试.

环境: Mac OS X High Sierra

OCP: Latest(3.6.1)

 

安装过程:

1. 安装 Docker:

  https://store.docker.com/editions/community/docker-ce-desktop-mac

  下载, 安装, DMG 格式的, 无脑装就好了, 安装完你能看到小鲸鱼图标, Docker is running

  

 

2. 配置 Docker:

  Preferences > Advanced, 根据你的资源给做配置吧, CPU 2-4, 内存 4-12 GB, 磁盘你可以自己选地方也可以默认

  

  

  Daemon, insecure registries 这里在安装 OCP 的时候会提示你的, 172.30.0.0/16

  Registry Mirrors 可以填镜像地址, 毕竟 docker.io 太慢了

    

  应用了重启

 

3. 安装 oc 命令:

  https://github.com/openshift/origin/blob/master/docs/cluster_up_down.md

  我用 homebrew 安装的:

brew install openshift-cli

 

4. 启动 OCP:

MacBook-Pro:~ joshuapu$ oc cluster up
Starting OpenShift using openshift/origin:v3.6.1 ...
OpenShift server started.

The server is accessible via web console at:
    https://127.0.0.1:8443

You are logged in as:
    User:     developer
    Password: <any value>

To login as administrator:
    oc login -u system:admin

 

好了, OCP 起来了, 接下来我们就可以登录使用了

5. 查看一下系统状态

MacBook-Pro:~ joshuapu$ oc whoami
developer
MacBook-Pro:~ joshuapu$ oc login -u system:admin
Logged into "https://127.0.0.1:8443" as "system:admin" using existing credentials.

You have access to the following projects and can switch between them with 'oc project <projectname>':

    default
    kube-public
    kube-system
  * myproject
    openshift
    openshift-infra

Using project "myproject".
MacBook-Pro:~ joshuapu$ oc project default
Now using project "default" on server "https://127.0.0.1:8443".
MacBook-Pro:~ joshuapu$ oc get pods
NAME                            READY     STATUS      RESTARTS   AGE
docker-registry-1-ch9c0         1/1       Running     0          16m
persistent-volume-setup-82gq9   0/1       Completed   0          16m
router-1-hd32j                  1/1       Running     0          16m
MacBook-Pro:~ joshuapu$ oc get svc
NAME              CLUSTER-IP      EXTERNAL-IP   PORT(S)                   AGE
docker-registry   172.30.1.1      <none>        5000/TCP                  16m
kubernetes        172.30.0.1      <none>        443/TCP,53/UDP,53/TCP     16m
router            172.30.100.76   <none>        80/TCP,443/TCP,1936/TCP   16m

 

posted on 2017-11-17 11:05  Joshua_Pu  阅读(770)  评论(0编辑  收藏  举报