Exercise 1

通过Deployment方式,使用redis镜像创建一个pod。通过kubectl获得redis启动日志。

Deployment的名称为<hwcka-003-1-你的华为云id>

[root@svn ch03]# kubectl create deploy hwcka-003-1-chenjo --image redis:alpine
deployment.apps/hwcka-003-1-chenjo created [root@svn ch03]# kubectl get po
NAME READY STATUS RESTARTS AGE
hwcka-003-1-chenjo-98498d48c-rbj2n 1/1 Running 0 10s [root@svn ch03]# kubectl logs -f hwcka-003-1-chenjo-98498d48c-rbj2n
1:C 22 Jul 2019 09:28:12.262 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 22 Jul 2019 09:28:12.262 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 22 Jul 2019 09:28:12.262 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 22 Jul 2019 09:28:12.264 * Running mode=standalone, port=6379.
1:M 22 Jul 2019 09:28:12.264 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 22 Jul 2019 09:28:12.264 # Server initialized
1:M 22 Jul 2019 09:28:12.264 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this is sue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be re started after THP is disabled.
1:M 22 Jul 2019 09:28:12.264 * Ready to accept connections

将所用命令、创建的Deployment完整yaml截图上传

// kubectl create deploy hwcka-003-1-chenjo --image redis:alpine --dry-run -o yaml > ex1.yaml
// cat ex1.yaml apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: hwcka-003-1-chenjo
name: hwcka-003-1-chenjo
spec:
replicas: 1
selector:
matchLabels:
app: hwcka-003-1-chenjo
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: hwcka-003-1-chenjo
spec:
containers:
- image: redis:alpine
name: redis
resources: {}
status: {}

2. Exercise 2

通过命令行,创建一个Deployment,副本数为3,镜像为nginx:latest。然后滚动升级到nginx:1.9.1。

Deployment的名称为<hwcka-003-2-你的华为云id>

[root@svn ch03]# kubectl run hwcka-003-2-chenjo --replicas 3 --image nginx:latest
kubectl run --generator=deployment/apps.v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead.
deployment.apps/hwcka-003-2-chenjo created [root@svn ch03]# kubectl rollout history deploy hwcka-003-2-chenjo
deployment.extensions/hwcka-003-2-chenjo
REVISION CHANGE-CAUSE
1 <none> [root@svn ch03]# kubectl rollout history deploy hwcka-003-2-chenjo --revision 1
deployment.extensions/hwcka-003-2-chenjo with revision #1
Pod Template:
Labels: pod-template-hash=67bd474c9
run=hwcka-003-2-chenjo
Containers:
hwcka-003-2-chenjo:
Image: nginx:latest
Port: <none>
Host Port: <none>
Environment: <none>
Mounts: <none>
Volumes: <none> [root@svn ch03]#

将所用命令、创建Deployment的完整yaml和升级历史信息截图上传

// kubectl run hwcka-003-2-chenjo --replicas 3 --image nginx:latest --dry-run -o yaml > ex2.yaml
// cat ex2.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
run: hwcka-003-2-chenjo
name: hwcka-003-2-chenjo
spec:
replicas: 3
selector:
matchLabels:
run: hwcka-003-2-chenjo
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
run: hwcka-003-2-chenjo
spec:
containers:
- image: nginx:latest
name: hwcka-003-2-chenjo
resources: {}
status: {}

最新文章

  1. ASP.NET MVC5+EF6+EasyUI 后台管理系统(72)-微信公众平台开发-消息处理
  2. C语言程序设计第九次作业
  3. 深入浅出MyBatis
  4. supervisor 安装 配置 及 使用
  5. solr 导入数据
  6. RequireJS 2.0 正式发布(转)
  7. Unity3d 接入 移动MM支付SDK(2.3) 全攻略
  8. PHP 魔术方法 __get __set (二)
  9. 面试知识:操作系统、计算机网络、设计模式、Linux编程,数据结构总结
  10. 未能正确加载“visual C++ package”包
  11. Android 获取系统或SDCARD剩余空间信息(转)
  12. Callable、Future和FutureTask区别
  13. 【译】Gradle 的依赖关系处理不当,可能导致你编译异常
  14. LoadRunner监控数据库服务
  15. jxa快速入门,Javascript已加入AppleScript全家桶
  16. java 图片裁剪
  17. Android Tools&amp;Cmd
  18. JDBC数据库
  19. mac 全角/半角标点符号切换
  20. Mysql多实例安装笔记

热门文章

  1. 1.ElasticSearch相关概念
  2. minkube在deban10上的安装步骤
  3. 1、Linux下安装JDK
  4. [IDEA] chapter_reader - idea看小说插件 idea阅读插件 idea摸鱼插件
  5. 08 - Vue3 UI Framework - Input 组件
  6. JUC之Lock接口以及Synchronized回顾
  7. bcloud_bctf_2016(house of force)
  8. Kafka从入门到放弃(三) —— 详说生产者
  9. 云主机tracert外网无返回需在安全组入方向加ICMP Time Exceeded TTLexpired in transit
  10. mysql绿色版添加服务