k8s集群部署harbor镜像仓库

这篇具有很好参考价值的文章主要介绍了k8s集群部署harbor镜像仓库。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

目录

一 安装部署

          部署环境

二安装docker, docker-compose

三解压Harbor文件

四配置HTTPS证书

五配置Harbor YML文件

六运行安装程序脚本

七测试命令登陆仓库  https://192.168.100.13

 1,登录harbor

2,然后重启docker.service 重启Harbor 

 3,登录私有仓库

4,创建k8s项目 

5,推送命令参考页面

八Harbor仓库里开始推送镜像给k8s

1,镜像表示已经标记在项目 

2, 推送镜像到项目中查看结果

3, 将镜像推送至k8s集群里 完成


一 安装部署

          部署环境

  1. 安装Docker
  2. 安装 docker-compose
  3. 下载harbor上传主机  (harbor-offline-installer-v2.1.1.tgz)
官网 地址
harbor Releases · goharbor/harbor · GitHub

k8s配置镜像仓库,K8S,Docker,kubernetes,docker,容器,运维,linux

二安装docker, docker-compose

#安装docker-ce 
yum install docker-ce  docker-compose
#启动docker服务
systemctl start docker
#查看docker版本
docker -v

三解压Harbor文件

#创建解压目录harbor
mkdir harbor
#进入解压目录harbor
cd harbor
#解压压缩包到当前目录下的harbor目录中
tar -zxvf harbor-offline-installer-v2.1.1.tgz
[root@node1 ~]# mkdir harbor

[root@node1 ~]# cd harbor/
[root@node1 harbor]# 
[root@node1 harbor]# rz -E
rz waiting to receive.
[root@node1 harbor]# ls
harbor-offline-installer-v2.1.1.tgz
[root@node1 harbor]# tar -zxvf harbor-offline-installer-v2.1.1.tgz 
harbor/harbor.v2.1.1.tar.gz
harbor/prepare
harbor/LICENSE
harbor/install.sh
harbor/common.sh
harbor/harbor.yml.tmpl
[root@node1 harbor]# ls
harbor  harbor-offline-installer-v2.1.1.tgz

四配置HTTPS证书

[root@node1 harbor]# openssl genrsa -out ca.key 4096
Generating RSA private key, 4096 bit long modulus
...................................................................................................++
.........................................................................................................................++
e is 65537 (0x10001)
[root@node1 harbor]# openssl req -x509 -new -nodes -sha512 -days 3650  -subj "/C=CN/ST=shanxi/L=shanxi/O=example/OU=Personal/CN=192.168.100.13"  -key ca.key  -out ca.crt
[root@node1 harbor]# 
[root@node1 harbor]# mkdir -p /data/cert      创建data/cert 路径
[root@node1 harbor]# cp ca.crt /data/cert
[root@node1 harbor]# cp ca.key /data/cert
[root@node1 harbor]# 
[root@node1 harbor]# systemctl restart docker

五配置Harbor YML文件

[root@node1 harbor]# cd harbor/
[root@node1 harbor]# ls
common.sh  harbor.v2.1.1.tar.gz  harbor.yml.tmpl  install.sh  LICENSE  prepare
[root@node1 harbor]# mv harbor.yml.tmpl harbor.yml
[root@node1 harbor]# ls
common.sh  harbor.v2.1.1.tar.gz  harbor.yml  input  install.sh  LICENSE  prepare
[root@node1 harbor]# vim harbor.yml 
# Configuration file of Harbor

# The IP address or hostname to access admin UI and registry service.
# DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
hostname: 192.168.100.13        ##更改域名

# http related config
#http:                    ##注销http
  # port for http, default is 80. If https enabled, this port will redirect to https port
 # port: 80               ##注销端口

# https related config
https:      
  # https port for harbor, default is 443
  port: 443 
  # The path of cert and key files for nginx
  certificate: /data/cert/ca.crt      ##更改路径证书私钥
  private_key: /data/cert/ca.key      ##更改路径证书私钥
              

六运行安装程序脚本

./prepare 
./install.sh 

结果

[root@node1 harbor]# ./prepare 
prepare base dir is set to /root/harbor/harbor
Clearing the configuration file: /config/registry/passwd
Clearing the configuration file: /config/registry/root.crt
Clearing the configuration file: /config/registry/config.yml
Clearing the configuration file: /config/nginx/nginx.conf
Clearing the configuration file: /config/portal/nginx.conf
Clearing the configuration file: /config/db/env
Clearing the configuration file: /config/core/app.conf
Clearing the configuration file: /config/core/env
Clearing the configuration file: /config/log/rsyslog_docker.conf
Clearing the configuration file: /config/log/logrotate.conf
Clearing the configuration file: /config/registryctl/env
Clearing the configuration file: /config/registryctl/config.yml
Clearing the configuration file: /config/jobservice/env
Clearing the configuration file: /config/jobservice/config.yml
Generated configuration file: /config/portal/nginx.conf
Generated configuration file: /config/log/logrotate.conf
Generated configuration file: /config/log/rsyslog_docker.conf
Generated configuration file: /config/nginx/nginx.conf
Generated configuration file: /config/core/env
Generated configuration file: /config/core/app.conf
Generated configuration file: /config/registry/config.yml
Generated configuration file: /config/registryctl/env
Generated configuration file: /config/registryctl/config.yml
Generated configuration file: /config/db/env
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
loaded secret from file: /data/secret/keys/secretkey
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir
[root@node1 harbor]# ./install.sh 

[Step 0]: checking if docker is installed ...

Note: docker version: 23.0.1

[Step 1]: checking docker-compose is installed ...

Note: docker-compose version: 1.18.0

[Step 2]: loading Harbor images ...
Loaded image: goharbor/harbor-db:v2.1.1
Loaded image: goharbor/redis-photon:v2.1.1
Loaded image: goharbor/notary-signer-photon:v2.1.1
Loaded image: goharbor/clair-photon:v2.1.1
Loaded image: goharbor/clair-adapter-photon:v2.1.1
Loaded image: goharbor/harbor-core:v2.1.1
Loaded image: goharbor/harbor-portal:v2.1.1
Loaded image: goharbor/harbor-log:v2.1.1
Loaded image: goharbor/nginx-photon:v2.1.1
Loaded image: goharbor/prepare:v2.1.1
Loaded image: goharbor/harbor-registryctl:v2.1.1
Loaded image: goharbor/notary-server-photon:v2.1.1
Loaded image: goharbor/trivy-adapter-photon:v2.1.1
Loaded image: goharbor/harbor-jobservice:v2.1.1
Loaded image: goharbor/chartmuseum-photon:v2.1.1
Loaded image: goharbor/registry-photon:v2.1.1


[Step 3]: preparing environment ...

[Step 4]: preparing harbor configs ...
prepare base dir is set to /root/harbor/harbor
Clearing the configuration file: /config/registry/passwd
Clearing the configuration file: /config/registry/config.yml
Clearing the configuration file: /config/nginx/nginx.conf
Clearing the configuration file: /config/portal/nginx.conf
Clearing the configuration file: /config/db/env
Clearing the configuration file: /config/core/app.conf
Clearing the configuration file: /config/core/env
Clearing the configuration file: /config/log/rsyslog_docker.conf
Clearing the configuration file: /config/log/logrotate.conf
Clearing the configuration file: /config/registryctl/env
Clearing the configuration file: /config/registryctl/config.yml
Clearing the configuration file: /config/jobservice/env
Clearing the configuration file: /config/jobservice/config.yml
Generated configuration file: /config/portal/nginx.conf
Generated configuration file: /config/log/logrotate.conf
Generated configuration file: /config/log/rsyslog_docker.conf
Generated configuration file: /config/nginx/nginx.conf
Generated configuration file: /config/core/env
Generated configuration file: /config/core/app.conf
Generated configuration file: /config/registry/config.yml
Generated configuration file: /config/registryctl/env
Generated configuration file: /config/registryctl/config.yml
Generated configuration file: /config/db/env
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
loaded secret from file: /data/secret/keys/secretkey
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir


Note: stopping existing Harbor instance ...
Stopping harbor-jobservice ... done
Stopping nginx             ... done
Stopping harbor-core       ... done
Stopping harbor-portal     ... done
Stopping registryctl       ... done
Stopping redis             ... done
Stopping harbor-db         ... done
Stopping registry          ... done
Stopping harbor-log        ... done
Removing harbor-jobservice ... done
Removing nginx             ... done
Removing harbor-core       ... done
Removing harbor-portal     ... done
Removing registryctl       ... done
Removing redis             ... done
Creating harbor-log ... done
Removing registry          ... done
Removing harbor-log        ... done
Removing network harbor_harbor

Creating redis ... done
Creating harbor-core ... done
Creating network "harbor_harbor" with the default driver
Creating nginx ... done
Creating registry ... 
Creating redis ... 
Creating harbor-db ... 
Creating registryctl ... 
Creating harbor-portal ... 
Creating harbor-core ... 
Creating nginx ... 
Creating harbor-jobservice ... 
✔ ----Harbor has been installed and started successfully.----

七测试命令登陆仓库  https://192.168.100.13

k8s配置镜像仓库,K8S,Docker,kubernetes,docker,容器,运维,linux

登录账号密码在harbor.yml 文件里
admin
Harbor12345

harbor_admin_password: Harbor12345

k8s配置镜像仓库,K8S,Docker,kubernetes,docker,容器,运维,linux

 1,登录harbor

[root@node1 harbor]# docker login  192.168.100.13
Username: admin
Password: 
Error response from daemon: Get https://192.168.100.13/v2/: x509: cannot validate certificate for 192.168.100.13 because it doesn't contain any IP SANs


如果出现这种问题

解决办法:

在/usr/lib/systemd/system/docker.service中添加私有仓库地址

找到service,注释后的第一行ExecStart参数最后添加--insecure-registry 私有仓库地址
vim  /usr/lib/systemd/system/docker.service  

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service containerd.service
Wants=network-online.target
Requires=docker.socket containerd.service

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock  --insecure-registry https://192.168.100.13    ##添加地址
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always

2,然后重启docker.service 重启Harbor 

systemctl daemon-reload
systemctl restart docker.service

在harbor的路径下重启harbor服务
[root@node1 harbor]# ./install.sh 

查看harbor服务是否起来
[root@node1 harbor]# docker ps -a
CONTAINER ID   IMAGE                                               COMMAND                   CREATED          STATUS        
c9d645513951   goharbor/harbor-jobservice:v2.1.1                   "/harbor/entrypoint.…"   31 minutes ago   Up 6 seconds (h
794442077e1a   goharbor/nginx-photon:v2.1.1                        "nginx -g 'daemon of…"   31 minutes ago   Up 14 minutes (
194045c4afa9   goharbor/harbor-core:v2.1.1                         "/harbor/entrypoint.…"   31 minutes ago   Restarting (2) 
58c345de0490   goharbor/redis-photon:v2.1.1                        "redis-server /etc/r…"   31 minutes ago   Exited (128) 17
067bca17a96a   goharbor/registry-photon:v2.1.1                     "/home/harbor/entryp…"   31 minutes ago   Up 14 minutes (
9779f1e938fc   goharbor/harbor-portal:v2.1.1                       "nginx -g 'daemon of…"   31 minutes ago   Up 14 minutes (
c21da2e479ac   goharbor/harbor-registryctl:v2.1.1                  "/home/harbor/start.…"   31 minutes ago   Up 14 minutes (
3e1b1261f174   goharbor/harbor-db:v2.1.1                           "/docker-entrypoint.…"   31 minutes ago   Up 14 minutes (
6795fad40dab   goharbor/harbor-log:v2.1.1                          "/bin/sh -c /usr/loc…"   31 minutes ago   Up 14 minutes (

看到有2个服务还没有up起来
重新启动下
[root@node1 harbor]# docker start 194045c4afa9
194045c4afa9
[root@node1 harbor]# docker start 58c345de0490
58c345de0490
[root@node1 harbor]# 
再次查看服务已经全部起来
[root@node1 harbor]# docker ps -a  
CONTAINER ID   IMAGE                                               COMMAND                   CREATED          STATUS                        PORTS                                         NAMES
b7aad9d19036   goharbor/harbor-jobservice:v2.1.1                   "/harbor/entrypoint.…"   24 minutes ago   Up 24 minutes (healthy)                                                     harbor-jobservice
5901942fffd5   goharbor/nginx-photon:v2.1.1                        "nginx -g 'daemon of…"   24 minutes ago   Up 24 minutes (healthy)       0.0.0.0:80->8080/tcp, 0.0.0.0:443->8443/tcp   nginx
a552eec595ba   goharbor/harbor-core:v2.1.1                         "/harbor/entrypoint.…"   24 minutes ago   Up 24 minutes (healthy)                                                     harbor-core
8b8b0e786e2d   goharbor/redis-photon:v2.1.1                        "redis-server /etc/r…"   24 minutes ago   Up 24 minutes (healthy)                                                     redis
b5ff29631d8d   goharbor/registry-photon:v2.1.1                     "/home/harbor/entryp…"   24 minutes ago   Up 24 minutes (healthy)                                                     registry
663a0715b40f   goharbor/harbor-registryctl:v2.1.1                  "/home/harbor/start.…"   24 minutes ago   Up 24 minutes (healthy)                                                     registryctl
8d801e424c50   goharbor/harbor-portal:v2.1.1                       "nginx -g 'daemon of…"   24 minutes ago   Up 24 minutes (healthy)                                                     harbor-portal
b2907672f756   goharbor/harbor-db:v2.1.1                           "/docker-entrypoint.…"   24 minutes ago   Up 24 minutes (healthy)                                                     harbor-db
3fc51d7606aa   goharbor/harbor-log:v2.1.1                          "/bin/sh -c /usr/loc…"   24 minutes ago   Up 24 minutes (healthy)       127.0.0.1:1514->10514/tcp                     harbor-log

重新启动harbor
[root@node1 harbor]# ./install.sh 

 3,登录私有仓库

再次登录成功
[root@node1 harbor]# docker login  192.168.100.13
Username: admin
Password: 
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
[root@node1 harbor]# 

4,创建k8s项目 

k8s配置镜像仓库,K8S,Docker,kubernetes,docker,容器,运维,linux

5,推送命令参考页面

k8s配置镜像仓库,K8S,Docker,kubernetes,docker,容器,运维,linux


 在项目中标记镜像:
docker tag SOURCE_IMAGE[:TAG] 192.168.100.13/k8s/IMAGE[:TAG]

推送镜像到当前项目:
docker push 192.168.100.13/k8s/IMAGE[:TAG]

八Harbor仓库里开始推送镜像给k8s

docker tag nginx:latest 192.168.100.13/k8s/nginx:latest
docker push 192.168.100.13/k8s/nginx:latest 

1,镜像表示已经标记在项目 

k8s配置镜像仓库,K8S,Docker,kubernetes,docker,容器,运维,linux

2, 推送镜像到项目中查看结果

k8s配置镜像仓库,K8S,Docker,kubernetes,docker,容器,运维,linux文章来源地址https://www.toymoban.com/news/detail-673496.html

3, 将镜像推送至k8s集群里 完成

先删除之前k8s推送的Nginx镜像
kubectl delete svc nginx

删除创建的deployment
 kubectl delete deployment nginx

通过命令远程拉取harbor的镜像并创建pod
kubectl run my-nginx --image=192.168.100.13/k8s/nginx:latest  --port=80

创建deployment my-nginx 
kubectl create deployment my-nginx   --image=my-nginx

为刚创建的服务nginx扩容
kubectl scale deployment/my-nginx --replicas=3

删除pods
kubectl delete pods my-nginx --grace-period=0 --force


删除deployment的pods
 kubectl delete deployment my-nginx



[root@node1 harbor]# docker images
REPOSITORY                                           TAG        IMAGE ID       CREATED         SIZE
flannel/flannel                                      v0.21.3    0d004b381af6   8 days ago      64.1MB
nginx                                                latest     904b8cb13b93   2 weeks ago     142MB
192.168.100.13/k8s/nginx                             latest     904b8cb13b93   2 weeks ago     142MB
redis                                                latest     f9c173b0f012   2 weeks ago

[root@node1 harbor]# kubectl delete svc nginx
service "nginx" deleted
[root@node1 harbor]# kubectl get svc
NAME         TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE
kubernetes   ClusterIP   10.10.0.1      <none>        443/TCP          3d1h
mysql        NodePort    10.10.66.181   <none>        3064:32262/TCP   17h
redis        NodePort    10.10.20.119   <none>        81:31803/TCP     17h

[root@master1 ~]# kubectl delete deployment nginx
deployment.apps "nginx" deleted
[root@master1 ~]#  kubectl get pod
NAME                     READY   STATUS    RESTARTS   AGE
redis-8464b6fbc9-sj6tm   1/1     Running   0          18h

[root@node1 harbor]# kubectl get pods
NAME                     READY   STATUS    RESTARTS   AGE
redis-8464b6fbc9-sj6tm   1/1     Running   0          17h
[root@master1 ~]# kubectl delete deployment nginx
deployment.apps "nginx" deleted
[root@master1 ~]#  kubectl get pod
NAME                     READY   STATUS    RESTARTS   AGE
my-nginx                 1/1     Running   0          33m
redis-8464b6fbc9-sj6tm   1/1     Running   0          18h

[root@node1 harbor]# kubectl run my-nginx --image=192.168.100.13/k8s/nginx:latest  --port=80
pod/my-nginx created
[root@node1 harbor]# kubectl get pods
NAME                     READY   STATUS    RESTARTS   AGE
my-nginx                 1/1     Running   0          34m
redis-8464b6fbc9-sj6tm   1/1     Running   0          18h


[root@node1 harbor]# kubectl create deployment my-nginx   --image=my-nginx
deployment.apps/my-nginx created
[root@node1 harbor]# 
[root@node1 harbor]# kubectl get pods
NAME                       READY   STATUS              RESTARTS   AGE
my-nginx                   1/1     Running             0          43m
my-nginx-8796bf77c-h6cfn   0/1     ContainerCreating   0          6s
redis-8464b6fbc9-sj6tm     1/1     Running             0          18h

[root@node1 harbor]# kubectl scale deployment/my-nginx --replicas=3
deployment.apps/my-nginx scaled
[root@node1 harbor]# 
[root@node1 harbor]# kubectl get pods
NAME                       READY   STATUS              RESTARTS   AGE
my-nginx                   1/1     Running             0          48m
my-nginx-8796bf77c-gp8kb   0/1     ContainerCreating   0          3s
my-nginx-8796bf77c-h6cfn   0/1     ContainerCreating    0          5m23s
my-nginx-8796bf77c-zg4bp   0/1     ContainerCreating   0          3s
redis-8464b6fbc9-sj6tm     1/1     Running             0          18h


[root@master1 ~]# kubectl get deployment 
NAME       READY   UP-TO-DATE   AVAILABLE   AGE
my-nginx   0/3     3            0           10m
redis      1/1     1            1           18h


[root@master1 ~]# kubectl delete pods my-nginx --grace-period=0 --force
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
pod "my-nginx" force deleted
[root@master1 ~]# 


[root@master1 ~]#  kubectl delete deployment my-nginx
deployment.apps "my-nginx" deleted
[root@master1 ~]# 
[root@master1 ~]#  kubectl get pod
NAME                     READY   STATUS    RESTARTS      AGE
redis-8464b6fbc9-sj6tm   1/1     Running   1 (21m ago)   21h
  

到了这里,关于k8s集群部署harbor镜像仓库的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • k8s使用helm部署Harbor镜像仓库并启用SSL

    参照:https://zhaoll.blog.csdn.net/article/details/128155767 有多种安装方式,根据自己的k8s版本选择合适的helm版本 参考:https://blog.csdn.net/qq_30614345/article/details/131669319 我们这里使用helm安装harbor,项目地址:https://github.com/goharbor/harbor-helm (1)拉取项目文件 (2)解压并修改配置 tar -z

    2024年02月16日
    浏览(28)
  • k8s harbor镜像仓库搭建

    1.前言 Harbor 是一个开源的云原生镜像仓库,用于存储和分发 Docker 镜像。它提供了一些安全性和管理方面的功能,使得用户可以更好地管理和共享 Docker 镜像 2.配置harbor搭建环境 harbor的搭建需要用到docker、docker-compose服务 docker搭建参考:部署docker-ce_Apex Predator的博客-CSDN博客

    2024年02月16日
    浏览(32)
  • K8s拉取Harbor私有仓库镜像

    提示:需要先部署Harbor私有镜像库。 insecure-registries对应可信任的镜像服务地址,如果有多个地址,还可以用“,”隔开,配置多个。 提示:每个k8s节点都需要配置,完成之后需要重启docker服务。 选择需要的命名空间,创建密文。 如果没有密文,后面的配置,都会明文数据

    2024年02月16日
    浏览(32)
  • k8s服务部署核心流程:以Jenkins为核心,从Gitee拉取代码,然后进行maven构建,之后使用docker命令打镜像,并推送镜像到harbor仓库,之后远程调用k8s命令创建服务

    前提是我们在自己电脑上模拟整个流程。 假设我们需要搭建一主一从的k8s集群,那就需要安装VMvare和Centos7(点击我查看安装文档), 然后就可以在这两个虚拟机上搭建k8s集群了(点击我查看安装文档), 一个最简单的devops流程已经在标题中写明了, 其中可以搭建gitlab(点

    2024年02月02日
    浏览(34)
  • 新版K8s:v1.28拉取Harbor仓库镜像以及本地镜像(docker弃用改用containerd,纯纯踩坑)

    使用Kuboard作为k8s集群的管理平台,Harbor作为镜像仓库,拉取Harbor镜像仓库的镜像运行。 从K8s1.24版本之后,k8s就逐渐弃用了docker,采用containerd来管理,这个很重要。 服务器 IP地址 备注 K8sMaster 192.168.2.138 kuboard,Master管理节点 K8sWorker01 192.168.2.139 Worker工作节点 K8sWorker02 192.168.

    2024年01月20日
    浏览(35)
  • K8S搭建自动化部署环境(五)Harbor私有仓库的搭建全过程

    各位大佬,前文如下: K8S搭建自动化部署环境(一)安装Kubernetes K8S搭建自动化部署环境(二)安装K8S管理工具Kuboard V3 K8S搭建自动化部署环境(三)Jenkins下载、安装和启动 K8S搭建自动化部署环境(四)Jenkins多分支流水线Blue Ocean的安装和使用 本文正文: 首先,下载harbor包,

    2024年02月05日
    浏览(30)
  • K8S:kubeadm搭建K8S+Harbor 私有仓库

    主机名及主机大小 主机ip 安装软件 master(2C/4G,cpu核心数要求大于2) 192.168.245.113 docker、kubeadm、kubelet、kubectl、flannel node01(2C/2G) 192.168.245.114 docker、kubeadm、kubelet、kubectl、flannel node02(2C/2G) 192.168.245.115 docker、kubeadm、kubelet、kubectl、flannel Harbor节点(hub.blue.com) 192.168.245

    2024年02月09日
    浏览(33)
  • k8s使用私有镜像仓库的访问凭据配置

    k8s创建私有仓库凭据有两种方式 1.使用kubectl命令创建secret 2.使用docker凭证作为k8s的凭据。 name:凭据名称 DOCKER_REGISTRY_SERVER:私有服务地址 DOCKER_USER:登录账号 DOCKER_PASSWORD:密码 DOCKER_EMAIL:邮箱 1.首先登录私有服务 2.查看auth文件内容 3.基于auth文件创建secret

    2024年02月06日
    浏览(26)
  • kubeasz一键部署harbor、containerd运行时、高可用k8s(1.26.x)集群-Day 02

    如果自建机房,请把核心组件的机器分布到不同机柜中。 服务器可以是私有云的虚拟机或物理机,也可以是公有云环境的虚拟机环境,如果是公司托管的IDC环境,可以直 接将harbor和node节点部署在物理机环境,master节点、etcd、负载均衡等可以是虚拟机。 下面是我的学习环境

    2024年02月09日
    浏览(28)
  • Gitlab+Jenkins+Docker+Harbor+K8s集群搭建CICD平台(持续集成部署Hexo博客Demo)

    目录 涉及内容: 一、CICD服务器环境搭建 1、docker 环境安装 (1)、拉取镜像,启动并设置开机自启 (2)、配置docker加速器 2、安装并配置GitLab (1)、创建共享卷目录 (2)、创建 gitlab 容器 (3)、关闭容器修改配置文件 (4)、修改完配置文件之后。直接启动容器 (5)、相关

    2024年03月15日
    浏览(44)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包