OpenShift 4.1 演示
功能演示主要包含三个方面.
1. 管理控制台
push镜像发布应用
podman build -t mytomcat:slim . podman tag localhost/mytomcat:slim default-route-openshift-image-registry.apps.cluster-d60b.sandbox509.opentlc.com/myproject/mytomcat:slim podman push default-route-openshift-image-registry.apps.cluster-d60b.sandbox509.opentlc.com/myproject/mytomcat:slim
[root@clientvm ~]# oc new-app mytomcat:slim --name=demo
--> Found image ec32b2c ( days old) in image stream "myproject/mytomcat" under tag "slim" for "mytomcat:slim" * This image will be deployed in deployment config "demo"
* Port /tcp will be load balanced by service "demo"
* Other containers can access this service through the hostname "demo"
* WARNING: Image "myproject/mytomcat:slim" runs as the 'root' user which may not be permitted by your cluster administrator --> Creating resources ...
imagestreamtag.image.openshift.io "demo:slim" created
deploymentconfig.apps.openshift.io "demo" created
service "demo" created
--> Success
Application is not exposed. You can expose services to the outside world by executing one or more of the commands below:
'oc expose svc/demo'
Run 'oc status' to view your app.
[root@clientvm ~]# oc expose svc/demo
route.route.openshift.io/demo exposed [root@clientvm ~]# oc get route
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
demo demo-myproject.apps.cluster-.sandbox452.opentlc.com demo -tcp None
mytomcat mytomcat-myproject.apps.cluster-.sandbox452.opentlc.com mytomcat -tcp None
2. machine和machinesets
部署一个cluster-autoscaler
oc get deployments -n openshift-machine-api cluster-autoscaler-operator echo '
---
apiVersion: "autoscaling.openshift.io/v1"
kind: "ClusterAutoscaler"
metadata:
name: "default"
spec:
podPriorityThreshold: -
resourceLimits:
maxNodesTotal:
scaleDown:
enabled: true
delayAfterAdd: 10s
delayAfterDelete: 10s
delayAfterFailure: 10s' | oc create -f - -n openshift-machine-api oc get pod -n openshift-machine-api
部署一个machineautoscaler
for ms in cluster--sd4tq-worker-ap-southeast-1c
do
echo "
---
apiVersion: \"autoscaling.openshift.io/v1beta1\"
kind: "MachineAutoscaler"
metadata:
name: autoscale-${ms}
namespace: \"openshift-machine-api\"
spec:
minReplicas:
maxReplicas:
scaleTargetRef:
apiVersion: machine.openshift.io/v1beta1
kind: MachineSet
name: ${ms}" >$HOME/autoscaler-${ms}.yaml
done
创建一个压力应用
oc new-project work-queue echo '
---
apiVersion: batch/v1
kind: Job
metadata:
generateName: work-queue-
spec:
template:
spec:
containers:
- name: work
image: busybox
command: ["sleep", ""]
resources:
requests:
memory: 500Mi
cpu: 500m
restartPolicy: Never
nodeSelector:
failure-domain.beta.kubernetes.io/zone: ap-southeast-1c
backoffLimit:
completions:
parallelism: ' | oc create -f - -n work-queue
监控machine和nodes的变化
watch oc get machines -n openshift-machine-api watch oc get nodes
3. Operator
- 部署一个etcd Operator
- 部署一个kafka Operator
OpenShift 4.1 演示的更多相关文章
- OpenShift 3.11离线环境的jenkins演示
离线安装完成后,一般情况下只装了个基础环境,catalog镜像没有导入,本文主要侧重在jenkins的一些环境设置和演示. 1.导入镜像 首先follow下面链接下载镜像 https://docs.o ...
- 在OpenShift云空间上部署java web应用
在使用之前先来介绍下OpenShift空间 OpenShift是由红帽推出逇一款面向开源开发人员开放的平台即服务(PaaS). OpenShift通过为开发人员提供在语言.框架和云上的更多的选择,使开 ...
- 升级、备份红帽PaaS openshift 上的 wordpress
红帽提供了一个很稳定的PAAS服务平台:openshift!此博客即作为wordpress建在里面. 这里记录怎样升级与备份wordpress. 预备: 安装 openshift command li ...
- OpenShift中的持续交付
上一文中讲述了如何在AWS下搭建OpenShift集群.这篇文章将目光转向如何在OpenShift中实现CI/CD以及产品环境的部署. 持续交付 如果要打造一个持续交付的流水线,首先要考虑多环境的问题 ...
- OpenShift应用镜像构建(3) - Jenkins的流水线构建
Jenkins方式构建的定位是使用专门的CICD平台. 既支持把JenKins作为一个Pod部署到openshift内部,也支持部署在Openshift集群外部,操作上的区别是 openshift自己 ...
- openshift 使用curl命令访问apiserver
openshift版本:openshift v3.6.173.0.5 使用oc(同kubectl)命令访问apiserver资源的时候,会使用到/root/.kube/config文件中使用的配置. ...
- Openshift中Pod的SpringBoot2健康检查
Openshift中Pod的SpringBoot2应用程序健康检查 1. 准备测试的SpringBoot工程, 需要Java 8 JDK or greater and Maven 3.3.x or g ...
- RedHat OpenShift QuickStart 1.2
一.在容器中传入/出文件 1. 创建一个初始化项目 oc login -u developer -p developer oc new-project myproject 2. 在容器中下载文件 先通 ...
- 005.OpenShift访问控制-权限-角色
一 Kubetcl namespace 1.1 namespace描述 Kubernetes namespace提供了将一组相关资源组合在一起的机制.在Red Hat OpenShift容器平台中,p ...
随机推荐
- PVE授权条款
授权条款 Proxmox VE 软件授权条款,采用的是 GNU AGPL (Affero General Public License) 条款,而 Proxmox VE 本身是 Free Softwa ...
- Controller的激活(1)
Public interface IController { void Execute(RequestContext requestContext) } Public abstract Class C ...
- wordpress防止垃圾邮件的另一种方法
我们知道wordpress可以用Akismet插件防止垃圾邮件,前面ytkah还讲过contact form 7如何搭配Akismet过滤垃圾邮件,还有什么方法呢?我们留在网站上的邮箱有可能被爬虫批量 ...
- Hbase扩展
1 HBase在商业项目中的能力 每天: 1) 消息量:发送和接收的消息数超过60亿 2) 将近1000亿条数据的读写 3) 高峰期每秒150万左右操作 4) 整体读取数据占有约55%,写入占有45% ...
- Linux shell脚本基础学习详细介绍(完整版)二
详细介绍Linux shell脚本基础学习(五) Linux shell脚本基础前面我们在介绍Linux shell脚本的控制流程时,还有一部分内容没讲就是有关here document的内容这里继续 ...
- For 32-bit BOOL is a signed char, whereas under 64-bit it is a bool.
https://stackoverflow.com/questions/31267325/bool-with-64-bit-on-ios/31270249#31270249 Definition of ...
- 最近的思考x
数据结构与文件格式: 自我管理与成长管理: 静态分析与动态分析.
- matlab基础向7-8:画图
1.画直角坐标系的二维图 画直线: x1=[1 2 3]; y1=[4 5 6]; plot(x1,y1);%斜率为1的直线,穿过(1,4)(2,5)(3,6) 画抛物线y=x*x(-3<=x& ...
- Hibernate学习:Exception in thread "main" java.lang.NullPointerException
1.在学习Hibernate多对多关系的时候遇到了一下异常: 主函数出现了空指针异常: public static void testadd() { Session session = Hiberna ...
- 《ELK Stack权威指南》读书笔记
Logstack: 1.Logstack介绍:Logstash is an open source data collection engine with real-time pipelining c ...