k8s安装nettools

1.拉取nettools镜像

[root@localhost app]# docker search nettools
INDEX       NAME                                  DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
docker.io   docker.io/travelping/nettools         A simple, small, alpine-based docker image...   5                    [OK]
docker.io   docker.io/dyrnq/nettools               A small debian-based docker image with ha...   2                    
docker.io   docker.io/jrecord/nettools            Some common network tools in a centos cont...   2                    
...                   

[root@localhost app]# docker pull docker.io/travelping/nettools 

[root@localhost app]# docker images
REPOSITORY                          TAG                 IMAGE ID            CREATED             SIZE
docker.io/travelping/nettools       latest              2d2c7dadefe0        3 years ago         23.8 MB

2.将镜像打标签

docker tag 2d2c7dadefe0 10.10.10.10/images/app:20231031

3.上传到镜像仓库(镜像仓库自己去阿里云创建

[root@localhost app]# docker push 10.10.10.10/images/app:20231031
The push refers to a repository [10.10.10.10/images/app]
c268ed4fd0f2: Pushed 
2f0aae61ad3d: Pushed 
c18e1afa015f: Pushed 
35c20f26d188: Layer already exists 
c3fe59dd9556: Layer already exists 
6ed1a81ba5b6: Layer already exists 
a3483ce177ce: Layer already exists 
ce6c8756685b: Layer already exists 
30339f20ced0: Layer already exists 
0eb22bfb707d: Layer already exists 
a2ae92ffcd29: Layer already exists 
20231031: digest: sha256:b42f707163729d38f84dc435e3fd2e315907dc63066255c549435f4e639f1a94 size: 2631

4.k8s环境拉取镜像

vim deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nettool
  labels:
    app: nettool
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nettool
  template:
    metadata:
      labels:
        app: nettool
    spec:
      containers:
      - name: nettool
        image: 10.10.10.10/images/app:20231031
        imagePullPolicy: Always
        command: ["/bin/sh", "-ce", "tail -f /dev/null"]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小邋遢2.0

你的鼓励将是我创作的最大动力~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值