zoukankan      html  css  js  c++  java
  • kube-controller docker tag 详解

    root@ubuntu:/home/ubuntu# ps -elf | grep control
    4 S root     34534 34463  1  80   0 - 53539 futex_ 09:02 ?        00:00:20 kube-controller-manager --allocate-node-cidrs=true --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf --bind-address=127.0.0.1 --client-ca-file=/etc/kubernetes/pki/ca.crt --cluster-cidr=10.244.0.0/16 --cluster-name=kubernetes --cluster-signing-cert-file=/etc/kubernetes/pki/ca.crt --cluster-signing-key-file=/etc/kubernetes/pki/ca.key --controllers=*,bootstrapsigner,tokencleaner --kubeconfig=/etc/kubernetes/controller-manager.conf --leader-elect=true --node-cidr-mask-size=24 --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --root-ca-file=/etc/kubernetes/pki/ca.crt --service-account-private-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/12 --use-service-account-credentials=true
    0 S root     41096 38101  0  80   0 -  1097 pipe_w 09:23 pts/2    00:00:00 grep --color=auto control
    root@ubuntu:/home/ubuntu# docker ps -a | grep controller | less
    2a76eac2d768        0db9714b83c0           "kube-controller-man…"   20 minutes ago      Up 20 minutes                                  k8s_kube-controller-manager_kube-controller-manager-ubuntu_kube-system_cb87ef4dc335417d42d752668aa1eb27_0
    07309a3816f0        k8s.gcr.io/pause:3.2   "/pause"                 20 minutes ago      Up 20 minutes                                  k8s_POD_kube-controller-manager-ubuntu_kube-system_cb87ef4dc335417d42d752668aa1eb27_0
    root@ubuntu:/home/ubuntu# docker logs 2a76eac2d768 | more
    root@ubuntu:/home/ubuntu# docker image ls | grep controll
    mirrorgcrio/kube-controller-manager-arm64                v1.18.1             0db9714b83c0        6 months ago        158MB
    k8s.gcr.io/kube-controller-manager                       v1.18.1             0db9714b83c0        6 months ago        158MB
    root@ubuntu:/home/ubuntu# 
    root@ubuntu:~# docker images | grep controller
    mirrorgcrio/kube-controller-manager-arm64                v1.18.1             0db9714b83c0        6 months ago        158MB
    k8s.gcr.io/kube-controller-manager                       v1.18.1             0db9714b83c0        6 months ago        158MB

    docker tag 详解

     

    docker tag 用于给镜像打标签,语法如下:

    docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]

    ① 比如我现在有一个 centos 镜像:

    [root@localhost ~]$ docker images
    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
    centos              latest              1e1148e4cc2c        2 weeks ago         202MB

    ② 我对 centos 进行开发,开发了第一个版本,我就可以对这个版本打标签,打完标签后会生成新的镜像:

    [root@localhost ~]$ docker tag centos centos:v1
    [root@localhost ~]$ docker images
    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
    centos              latest              1e1148e4cc2c        2 weeks ago         202MB
    centos              v1                  1e1148e4cc2c        2 weeks ago         202MB

    ③ 我继续对 centos 进行开发,开发了第二个版本,继续打标签:

    [root@localhost ~]$ docker tag centos centos:v2
    [root@localhost ~]$ docker images
    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
    centos              latest              1e1148e4cc2c        2 weeks ago         202MB
    centos              v1                  1e1148e4cc2c        2 weeks ago         202MB
    centos              v2                  1e1148e4cc2c        2 weeks ago         202MB

    ④ 以此类推,每开发一个版本打一个标签,如果以后我想回滚版本,就可以使用指定标签的镜像来创建容器:

    [root@localhost ~]$ docker run -itd centos:v1
  • 相关阅读:
    重读金典------高质量C编程指南(林锐)-------第四章 表达式和基本语句
    重读金典------高质量C编程指南(林锐)-------第三章 命名规则
    重读金典------高质量C编程指南(林锐)-------第二章 程序的板式
    重读金典------高质量C编程指南(林锐)-------第一章 文件结构
    链表的基本操作---创建
    实现两个数的互换算法小结
    C++中引用与指针的区别
    以前写的一些小程序总结
    OPENCV中数字图像处理知识运用
    常见的论文查找办法
  • 原文地址:https://www.cnblogs.com/dream397/p/13818782.html
Copyright © 2011-2022 走看看