docker build -t dvm.adsplatformproxy:v1.0.0 .      #build images
docker run -e WWNamespace=dev -e ZKServerAddress=****** -p 6000:80 6cb913a34ae3 #run container,本地起进程
docker run -ti 6cb913a34ae3 /bin/bash #远程进入image文件;exit退出
docker rmi -f b54d6e186ef4 #远程删除image
docker rmi -rf b54d6e186ef4
docker build -t dvm.adsplatformproxy:v1.0.0 . #build images
docker run -e WWNamespace=dev -e ZKServerAddress=****** -p 6000:80 6cb913a34ae3 #run container,本地起进程
docker run -ti 6cb913a34ae3 /bin/bash #远程进入image文件;exit退出
docker rmi -f b54d6e186ef4 #远程删除image
docker rmi -rf b54d6e186ef4

查看docker仓库的tag信息

For the latest (as of 2015-07-31) version of Registry V2, you can get this image from DockerHub:

docker pull distribution/registry:master

List all repositories (effectively images):

curl -X GET https://myregistry:5000/v2/_catalog
> {"repositories":["redis","ubuntu"]}

List all tags for a repository:

curl -X GET https://myregistry:5000/v2/ubuntu/tags/list
> {"name":"ubuntu","tags":["14.04"]}
 kubectl get deployment  #获取发布
kubectl delete deployment **** #删除发布,自动删除service、pods

  

kubectl create ******.yaml  #创建yaml,包含config、ingress配置
kubectl get ingress #获取ingress配置
kubectl get configmap #获取config配置

 

kubectl edit configmaps *****-config -n *namespace* 

kubectl get configmap  #1.获取配置文件
kubectl edit configmap ****** #2.修改配置文件
 ..\refreshconfig.ps1 -ConfigMapName dvm-website-config    #3.psl更新配置   或者删除已有的pod,会自动创建pod并使用新的configmap
kubectl create -f rc-nginx.yaml 

kubectl replace -f rc-nginx.yaml

kubectl edit po rc-nginx-btv4j    

kubectl delete -f rc-nginx.yaml
kubectl delete po rc-nginx-btv4j
kubectl delete po -lapp=nginx-2 kubectl describe po rc-nginx-2-btv4j # kubectl get namespace
kubectl get po <podname> -o #yaml 以yawl格式输出pod的详细信息。
kubectl get po <podname> -o json # 以json格式输出pod的详细信息。
kubectl get po rc-nginx-2-btv4j -o=custom-columns=LABELS:.metadata.labels.app #使用”-o=custom-columns=“定义直接获取指定内容的值

  

  

  

  

 

configmap 的更新

A new command, kubectl rolling-restart that takes an RC name and incrementally deletes all the pods controlled by the RC and allows the RC to recreate them.

Small work around (I use deployments and I want to change configs without having real changes in image/pod):

  • create configMap
  • create deployment with ENV variable (you will use it as indicator for your deployment) in any container
  • update configMap
  • update deployment (change this ENV variable)

k8s will see that definition of the deployment has been changed and will start process of replacing pods
PS:
if someone has better solution, please share

It feels like the right solution here would enable you to restart a deployment, and reuse most of the deployment parameters for rollouts like MinReadyCount, while allowing for command-line overrides like increasing the parallelism for emergency situations where you need everything to bounce immediately.

We would also like to see this for deployments maybe like kubectl restart deployment some-api

Kubernetes is allowed to restart Pods for all sorts of reasons, but the cluster admin isn't allowed to.
I understand the moral stand that 'turn it off and on again' may not be a desired way to operate... but I also think it should be ok to let those people who wish to, to restart a Deployment without resorting to the range of less appetizing tricks like:

  • deleting pods
  • dummy labels
  • dummy environment variables
  • dummy config maps mapped to environment variable
  • rebooting the worker nodes
  • cutting the power to the data centre

    docker 命令2的更多相关文章

    1. Docker命令学习

      今天更换腾讯云系统的时候发现了多了个CoreOS,据说是专门运行docker的轻量系统,顺便学习一下docker命令. 1. docker version 显示 Docker 版本信息. 2. doc ...

    2. Docker命令详解

      Docker命令详解   最近学习Docker,将docker所有命令实验了一番,特整理如下: # docker --help Usage: docker [OPTIONS] COMMAND [arg ...

    3. Docker入门教程(六)另外的15个Docker命令

      Docker入门教程(六)另外的15个Docker命令 [编者的话]DockerOne组织翻译了Flux7的Docker入门教程,本文是系列入门教程的第六篇,继续介绍Docker命令.之前的第二篇文章 ...

    4. 安装Docker和下载images镜像和常用Docker命令

      我的是centos7,也会6的方法: $sudo yum install docker 直接yum安装contos7使用centos6.5先获取epel源并 启动Docker,并注册开机服务 [roo ...

    5. docker命令和后台参数

      Docker官方为了让用户快速了解Docker,提供了一个 交互式教程 ,旨在帮助用户掌握Docker命令行的使用方法. Docker 命令行 下面对Docker的命令清单进行简单的介绍,详细内容在后 ...

    6. 掌握Docker命令

      1.管理镜像命令 获取镜像 docker push ubuntu:14:04 查看镜像列表 docker images 重命名image docker tag IMAGE-NAME NEW-IMAGE ...

    7. docker命令不需要敲sudo的方法

      由于docker daemon需要绑定到主机的Unix socket而不是普通的TCP端口,而Unix socket的属主为root用户,所以其他用户只有在命令前添加sudo选项才能执行相关操作. 如 ...

    8. 从开发到部署会用到的 Docker 命令

      本文的目的是理解容器开发在目标环境中部署的端到端流程,并列出这些操作所需的 Docker 命令.如果有任何Docker问题,请移步到最新最热的技术社区 IT帮 itbang.me 提问,短信通知专家来 ...

    9. docker命令行学习

      docker命令行学习 docker run docker run --help:老实说这条最管用了 docker run -it:交互模式,允许控制台输出 docker run -d:detach, ...

    10. Docker命令查询

      基本语法 docker [OPTIONS] COMMAND [arg...] 一般来说,Docker 命令可以用来管理 daemon,或者通过 CLI 命令管理镜像和容器.可以通过 man docke ...

    随机推荐

    1. 取n到m行

      取n到m行 . select top m * from tablename where id not in (select top n id from tablename order by id as ...

    2. 孤立森林(Isolation Forest)

      前言随着机器学习近年来的流行,尤其是深度学习的火热.机器学习算法在很多领域的应用越来越普遍.最近,我在一家广告公司做广告点击反作弊算法研究工作.想到了异常检测算法,并且上网调研发现有一个算法非常火爆, ...

    3. Linux环境 vi/vim ESC无法退出原因

      原因是输入模式是中文的,需要切换成英文半角符号输入命令!

    4. Linux基础命令---文本格式转换expand,unexpand

      expand 将文件中的tab转换成空格,结果送到标准输出.如果没有指定文件,那么从标准输入读取. 此命令的适用范围:RedHat.RHEL.Ubuntu.CentOS.SUSE.openSUSE.F ...

    5. 100.容器List-ArrayList

      package collection; import java.util.ArrayList; import java.util.Collection; import java.util.Date; ...

    6. Codeforces 841B - Godsend

      题目链接:http://codeforces.com/problemset/problem/841/B Leha somehow found an array consisting of n inte ...

    7. いっしょ / Be Together (暴力枚举)

      题目链接:http://abc043.contest.atcoder.jp/tasks/arc059_a Time limit : 2sec / Memory limit : 256MB Score ...

    8. ubunta apt install error

      ubuntu系统: 用apt-get命令安装一些软件包时,总报错:E:could not get lock /var/lib/dpkg/lock -open等 出现这个问题的原因可能是有另外一个程序正 ...

    9. 每日linux命令学习-历史指令查询(history、fc、alias)

      linux历史机制对命令行中输入的命令进行编号并依此保存,以维护命令历史.登录会话期间输入的命令保存在shell内存中,若终止命令则添加至历史文件. 1. 箭头符号方向键 使用键盘上的箭头方向键可以从 ...

    10. EL和jstl(概念和使用方法)

      概念: 1 .  JSP 标签 是用来替换java代码的技术,容器遇到标签后会将其转换成java代码,jsp标签类似于开始标记.属性.结束标记.标签体. EL表达式是一套简单的运算规则,用于给jsp标 ...