如何在自己的MacBook上体验OpenShift 4.1
在4版本后,CDK和minishift基本不跟新了,取代的是一个CodeReady Containter,定位和CDK以及minishift一样,简称CRC,是在本地环境中运行一个开发环境,目前仍然是在Alpha版本阶段,没有正式的GA,在4.2版本会GA.
CRC目前只支持linux和mac环境,windows环境的支持正在开发中。
1.下载
需要下载的包括如下:
- CRC:
https://github.com/code-ready/crc/releases
在v0.87.0-alpha-4.1.0的assets里面下载crc-0.87.0-darwin-amd64.tar.xz
- Images:
http://cdk-builds.usersys.redhat.com/builds/crc/4.1.0/virtualbox/
这个网站需要登录redhat内网
- OC客户端
http://cloud.redhat.com
下载完成后放到同一个目录下
2.设置运行
./crc setup
这一步需要上网下载oc.tar.gz, 因为速度慢我想设置一个本地的mirror.openshift.com,结果证书验证不过。第二天网速正常就过了。输出如下
然后启动
ericdeMacBook-Pro:openshift ericnie$ ./crc start -d virtualbox -b crc_vbox_4.1.0.tar.xz
crc - Local OpenShift .x cluster
INFO Checking if oc binary is cached
INFO Checking if VirtualBox is Installed
INFO Checking file permissions for resolver
INFO Extracting the Bundle tarball ...
INFO Creating VM ...
INFO Bridge IP on the host: 192.168.130.1
INFO Restarting the network
INFO Check internal and public dns query ...
WARN Failed Public dns query: ssh command error:
command : host -R quay.io
err : exit status
output : Host quay.io not found: (NXDOMAIN)
:
INFO Starting OpenShift cluster ... [waiting 3m]
INFO To access the cluster using 'oc', run 'oc login -u kubeadmin -p btGHD-oHFCZ-xTZUv-bTRsv https://api.crc.testing:6443'
INFO Access the OpenShift web-console here: https://console-openshift-console.apps-crc.testing
INFO Login to the console with user: kubeadmin, password: btGHD-oHFCZ-xTZUv-bTRsv
WARN Make sure add 'nameserver 192.168.130.100' as first entry to '/etc/resolv.conf' file
INFO Running
看一下需要的配置
ericdeMacBook-Pro:openshift ericnie$ crc config view
crc - Local OpenShift .x cluster
- bundle : crc_vbox_4.1.0.tar.xz
- cpus :
- memory :
- vm-driver : hyperkit
我的mac配置是8G,但这个虚拟机就要用8G
3.访问
登录
ericdeMacBook-Pro:openshift ericnie$ oc login -u kubeadmin -p btGHD-oHFCZ-xTZUv-bTRsv https://api.crc.testing:6443
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): y Login successful. You have access to the following projects and can switch between them with 'oc project <projectname>': * default
kube-public
kube-system
openshift
openshift-apiserver
openshift-apiserver-operator
openshift-authentication
openshift-authentication-operator
openshift-cloud-credential-operator
openshift-cluster-machine-approver
openshift-cluster-node-tuning-operator
openshift-cluster-samples-operator
openshift-cluster-storage-operator
openshift-cluster-version
openshift-config
openshift-config-managed
openshift-console
openshift-console-operator
openshift-controller-manager
openshift-controller-manager-operator
openshift-dns
openshift-dns-operator
openshift-etcd
openshift-image-registry
openshift-infra
openshift-ingress
openshift-ingress-operator
openshift-kube-apiserver
openshift-kube-apiserver-operator
openshift-kube-controller-manager
openshift-kube-controller-manager-operator
openshift-kube-scheduler
openshift-kube-scheduler-operator
openshift-machine-api
openshift-machine-config-operator
openshift-marketplace
openshift-monitoring
openshift-multus
openshift-network-operator
openshift-node
openshift-operator-lifecycle-manager
openshift-operators
openshift-sdn
openshift-service-ca
openshift-service-ca-operator
openshift-service-catalog-apiserver-operator
openshift-service-catalog-controller-manager-operator Using project "default".
按照提示设置/etc/resolv.conf, 主要是添加192.168.130.100这个解析,所有的master地址 :api.crc.testing 和 console域名console-openshift-console.apps-crc.testing都解析到虚拟机上。
ericdeMacBook-Pro:openshift ericnie$ cat /etc/resolv.conf
#
# macOS Notice
#
# This file is not consulted for DNS hostname resolution, address
# resolution, or the DNS query routing mechanism used by most
# processes on this system.
#
# To view the DNS configuration used by this system, use:
# scutil --dns
#
# SEE ALSO
# dns-sd(), scutil()
#
# This file is automatically generated.
#
nameserver 192.168.130.100
nameserver 192.168.0.102
nameserver 202.96.134.33
CSR批准,环境刚建立完成是没有批准的,需要手工批一下
ericdeMacBook-Pro:openshift ericnie$ oc get csr
NAME AGE REQUESTOR CONDITION
csr-2vnqs 17d system:node:crc-4gdnp-master- Pending
csr-4lpf5 17d system:node:crc-4gdnp-master- Pending
csr-4n67j 17d system:node:crc-4gdnp-master- Pending
csr-4pv76 17d system:node:crc-4gdnp-master- Pending
csr-5t449 17d system:node:crc-4gdnp-master- Pending
csr-6rpkz 17d system:node:crc-4gdnp-master- Pending
csr-88dx8 17d system:node:crc-4gdnp-master- Pending
csr-9cphd 17d system:node:crc-4gdnp-master- Pending
csr-c8cds 17d system:node:crc-4gdnp-master- Pending
csr-d249k 17d system:node:crc-4gdnp-master- Pending
csr-j54cg 17d system:node:crc-4gdnp-master- Pending
csr-jx6ls 17d system:node:crc-4gdnp-master- Pending
csr-l4mmk 17d system:node:crc-4gdnp-master- Pending
csr-l99nh 17d system:node:crc-4gdnp-master- Pending
csr-mm64p 17d system:node:crc-4gdnp-master- Pending
csr-mtjgp 17d system:node:crc-4gdnp-master- Pending
csr-pv82g 17d system:node:crc-4gdnp-master- Pending
csr-qpwc4 17d system:node:crc-4gdnp-master- Approved,Issued
csr-qs9nf 17d system:node:crc-4gdnp-master- Pending
csr-t2sb6 17d system:node:crc-4gdnp-master- Pending
csr-vp6pb 4m system:node:crc-4gdnp-master- Pending
csr-vpqpc 17d system:node:crc-4gdnp-master- Pending
csr-wb9r7 17d system:node:crc-4gdnp-master- Pending
csr-wglrj 17d system:node:crc-4gdnp-master- Pending
csr-x9dvz 17d system:node:crc-4gdnp-master- Pending
批准命令为,大家可以写一个shell脚本一次批准生效
ericdeMacBook-Pro:openshift ericnie$ oc adm certificate approve csr-j54cg csr-d249k csr-c8cds csr-9cphd csr-88dx8 csr-6rpkz
certificatesigningrequest "csr-j54cg" approved
certificatesigningrequest "csr-d249k" approved
certificatesigningrequest "csr-c8cds" approved
certificatesigningrequest "csr-9cphd" approved
certificatesigningrequest "csr-88dx8" approved
certificatesigningrequest "csr-6rpkz" approved
co是Cluster Operator? 可见machine-config, marketplace(涉及的operatorhub)和monitor(涉及集群监控)都没有在这个开发环境中。
ericdeMacBook-Pro:openshift ericnie$ oc get co
NAME VERSION AVAILABLE PROGRESSING DEGRADED SINCE
authentication 4.1. True False False 18d
cloud-credential 4.1. True False False 18d
cluster-autoscaler 4.1. True False False 18d
console 4.1. True False False 18d
dns 4.1. True False False 55m
image-registry 4.1. True False False 54m
ingress 4.1. True False False 56m
kube-apiserver 4.1. True False False 18d
kube-controller-manager 4.1. True False False 18d
kube-scheduler 4.1. True False False 18d
machine-api 4.1. True False False 18d
machine-config 4.1. False False True 18d
marketplace 4.1. False False False 18d
monitoring False True True 18d
network 4.1. True False False 18d
node-tuning 4.1. True False False 55m
openshift-apiserver 4.1. True False False 54m
openshift-controller-manager 4.1. True False False 51m
openshift-samples 4.1. True False False 18d
operator-lifecycle-manager 4.1. True False False 18d
operator-lifecycle-manager-catalog 4.1. True False False 18d
service-ca 4.1. True False False 18d
service-catalog-apiserver 4.1. True False False 18d
service-catalog-controller-manager 4.1. True False False 18d
storage 4.1. True False False 18d
看一下nodes,可见一台机器既做了master,又做了worker
ericdeMacBook-Pro:openshift ericnie$ oc get nodes
NAME STATUS ROLES AGE VERSION
crc-4gdnp-master- Ready master,worker 18d v1.13.4+cb455d664
访问管理控制台
https://console-openshift-console.apps-crc.testing
通过kubeadmin登录
如何在自己的MacBook上体验OpenShift 4.1的更多相关文章
- 不写1行代码,在Mac上体验ASP.NET 5的最简单方法
昨天微软发布了ASP.NET 5 beta2(详见ASP.NET 5 Beta2 发布),对ASP.NET 5的好奇心又被激发了. 今天下午在Mac OS X上体验了一下ASP.NET 5,而且借助Y ...
- Macbook上Windows的触摸板设置工具
Macbook上用Boot Camp装了双系统后,没了触摸板的三指拖拽功能,滚动(scroll)也太过灵敏,装Boot Camp官方驱动也没用. 装了Trackpad++这个第三方驱动,就能完美实现M ...
- 如何在Macbook上安装MySQL ?
MySQL是常用的一款开源数据库,对各个平台都提供了支持,而Macbook又作为程序员的一款主力开发工具经常被使用.因此怎么在Macbook上安装MySQL进行程序开发也成了一项基本技能.下面来跟随本 ...
- macbook上安装虚拟机软件如何操作?
很多用户都不太熟悉苹果系统,用惯了Windows之后再过渡到MacOS难免会有些不习惯.为了使我们又可以用回那些熟悉的Windows应用,比较常见的办法就是安装macbook虚拟机.下面小编就教大家一 ...
- 【实时渲染】实时3D渲染如何加速汽车线上体验应用推广
在过去,一支优秀的广告片足以让消费者对一辆汽车产生兴趣.完美的底盘线条或引擎的轰鸣声便会让潜在买家跑到经销商那里试驾.现在,广告还是和往常一样,并没有失去其特性,但86%的买家在与销售交流之前会在网上 ...
- 在macbook上搭建ubuntu工作环境
工作环境需要:ubuntu12.04.gcc 4.4.7.vim.source insight.git. 1. 制作启动盘 首先需要制作一个能从苹果电脑启动的ubuntu启动盘: 在苹果电脑的终端中输 ...
- Macbook上安装Win7经验总结
昨天兴致突发,想在Macbook上装个win7跑双系统玩玩,结果遇到了几个非常奇葩的问题.折腾了差不多一天,硬盘分区又合并分区N次,若干次卡死,最后总算搞定.记录下经验,以慰后来人. 问题一:安装程序 ...
- 凤凰系统(Phoenix OS)PC版安装,电脑上体验功能丰富的安卓系统
PC版(X86版)ISO镜像下载地址:http://www.phoenixos.com/download_x86 下载完成后,可按照官方给出的安装教程进行安装. 凤凰系统帮助中心:http://www ...
- Safari配置WebApp----添加启动图和桌面图标让你的WebApp在ios设备上体验如原生一样
现在很多开发者的Web应用程序的设计样式和交互类似本机应用程序,例如,它的缩放比例适合iOS上的整个屏幕.当用户将其添加到主屏幕时,您可以通过使其看起来像本机应用程序一样,在iOS上为您的Web应用程 ...
随机推荐
- mysql 增加列
alter table t_zhaosheng_chengji_is_finish add season_id int(4) default '1' not null COMMENT '招生季ID';
- docker学习1-CentOS 7安装docker环境
前言 Docker 提供轻量的虚拟化,你能够从Docker获得一个额外抽象层,你能够在单台机器上运行多个Docker微容器,而每个微容器里都有一个微服务或独立应用,例如你可以将Tomcat运行在一个D ...
- easyui_验证扩展
本文为转载,并非原创 easyui validatebox 验证类型 分类: jquery-easyUI -- : 11000人阅读 评论() 收藏 举报 easyuiValidateBox requ ...
- django-mysql事务
django文档:https://yiyibooks.cn/xx/django_182/topics/db/transactions.html mysql事务 1) 事务概念 一组mysql语句,要么 ...
- 算法笔记求序列A每个元素左边比它小的数的个数(树状数组和离散化)
#include <iostream> #include <algorithm> #include <cstring> using namespace std ; ...
- 001_Visual Studio 显示数组波形
视频教程:https://v.qq.com/x/page/z3039pr02eh.html 资料下载:https://download.csdn.net/download/xiaoguoge11/12 ...
- POJ P1985 Cow Marathon 题解
这道题是我们考试的第一题,非常水,就是一个树的直径的板子.详见上一篇博客. #include<iostream> #include<cstdio> #include<cs ...
- Xamarin.Forms 入门
介绍 Xamarin.Forms是一个开源UI框架,Xamarin.Forms允许开发人员从单个共享代码库构建Android,iOS和Windows应用程序. Xamarin.Forms允许开发人员使 ...
- Nodejs仿Apache的部分功能
一.初步实现Apache的部分功能 //1.加载模块 var http=require('http'); var fs=require('fs'); //2.创建server var server=h ...
- IIS 站点配置文件
IIS 站点配置文件 C:/Windows/System32/inetsrv/config/applicationHost.config 配置文件示例: <system.application ...