走一遍概念  

  • An overview of Kubernetes control
  • f Working with pods
  • f Working with a replication controller
  • f Working with services
  • f Working with volumes
  • f Working with secrets
  • f Working with names
  • f Working with namespaces
  • f Working with labels and selectors
  1. An overview of Kubernetes control

查看k8s版本

  % kubectl version

是如何做到的

  kubectl通过restful api 连接kubernetes api server

如何工作的

  kubectl [command] [TYPE] [NAME] [flags]

/usr/local/bin/kubectl run my-first-nginx --image=nginx

However, you can write either a YAML file or a JSON file to perform similar operations.

# cat nginx.yaml
apiVersion: v1
kind: ReplicationController
metadata:
name: my-first-nginx
spec:
replicas: 1
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: my-first-nginx
image: nginx

Then specify the  create -f option to execute the  kubectl command as follows

# kubectl create -f nginx.yaml
replicationcontroller "my-first-nginx" created

status of the replication controller

# kubectl get replicationcontrollers
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS AGE
my-first-nginx my-first-nginx nginx app=nginx 1 12s

缩写

kubectl get rc
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS AGE
my-first-nginx my-first-nginx nginx app=nginx 1 1m

删除

# kubectl delete rc my-first-nginx
replicationcontroller "my-first-nginx" deleted

2.pods

是k8s中最小的可部署单元

每个pod被进程id,网络,进程间通信,时间命名空间隔离。

   docker pull centos
# cat my-first-pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: my-first-pod
spec:
containers:
- name: my-nginx
image: nginx
- name: my-centos
image: centos
command: ["/bin/sh", "-c", "while : ;do curl http://
localhost:80/; sleep 3; done"]

最新文章

  1. jQuery MiniUI开发系列之:安装部署
  2. STL Map的使用
  3. 判断密文加密类型hash-identifier
  4. 第五篇 Integration Services:增量加载-Deleting Rows
  5. 一个高在线(可以超过1024)多线程的socket echo server(pthreads 和 libevent扩展)
  6. Oracle_11g中解决被锁定的scott用户的方法(转载)
  7. Codeforces 432E Square Tiling(结构体+贪婪)
  8. iOS超全开源框架、项目和学习资料汇总:UI篇
  9. 理解 OAuth2.0
  10. Java多线程(二)关于多线程的CPU密集型和IO密集型这件事
  11. Less 创建css3动画@keyframes函数
  12. Zookeeper集群节点数量为什么要是奇数个?
  13. firewall 和 iptables 常用命令
  14. Java基础——Oracle(三)
  15. DW 破解方法
  16. sqlserver收缩日志的几种方式
  17. C#.NET常见问题(FAQ)-如何设置控件水平对齐,垂直对齐
  18. Hive SQL执行流程分析
  19. kafka学习之-文件存储机制
  20. Android-Gallery GridView ImageSwitcher 使用

热门文章

  1. 天地图OGC WMTS服务规则
  2. Thinkpad个性化设置:F1~F12恢复正常按键,Fn与Ctrl按键互换
  3. nova Evacuate
  4. DB2导入导出方法总结
  5. The import java.util cannot be resolved
  6. LightOJ 1038 概率dp
  7. 使用NSUserDefaults保存自定义对象(转)
  8. java web service 上传下载文件
  9. Httpclient远程调用WebService示例
  10. redis之 Redis常用数据类型