K8S异常之Harbor证书过期处理(完整版流程)

2023-05-16

在这里插入图片描述

1、背景

如图所示,在登录harbor仓库时, 提示证书已经过期。
在这里插入图片描述

2、更新证书

2.1 停止harbor

docker-compose down
[root@nb001 harbor]# ls
common  common.sh  data  docker-compose.yml  docker-compose.yml.2022-1-7  harbor.v2.3.2.tar.gz  harbor.yml  harbor.yml.2022-1-7  harbor.yml.tmpl  install.sh  LICENSE  prepare  reg  ssl
[root@nb001 harbor]# docker-compose down
Stopping nginx             ... done
Stopping harbor-jobservice ... done
Stopping harbor-core       ... done
Stopping registry          ... done
Stopping registryctl       ... done
Stopping harbor-db         ... done
Stopping redis             ... done
Stopping harbor-portal     ... done
Stopping harbor-log        ... done
Removing nginx             ... done
Removing harbor-jobservice ... done
Removing harbor-core       ... done
Removing registry          ... done
Removing registryctl       ... done
Removing harbor-db         ... done
Removing redis             ... done
Removing harbor-portal     ... done
Removing harbor-log        ... done
Removing network harbor_harbor

2.2 更换证书

编辑harbor.yml文件:更换新的证书文件路径
在这里插入图片描述

2.3 重新执行./prepare

说明: 过期替换证书需要重新执行prepare, 否则只重启替换证书不生效,客户端仍然报证书过期。
在这里插入图片描述
执行过程如下:

[root@nb001 harbor]# ./prepare 
prepare base dir is set to /data/harbor
Unable to find image 'goharbor/prepare:v2.3.2' locally
v2.3.2: Pulling from goharbor/prepare
4fc7e8c5dda0: Already exists 
e101789e272e: Pull complete 
3356ca67bae9: Pull complete 
3d33c71b0e90: Pull complete 
ab76e2d8736b: Pull complete 
9d7f4a6ec28e: Pull complete 
2f6837c65c74: Pull complete 
bc8d1bca5b85: Pull complete 
Digest: sha256:e6ae1e30c8897ca54bcc89682dbb10c2dbd08d6c9bba647eacdef6fa776d6428
Status: Downloaded newer image for goharbor/prepare:v2.3.2
Clearing the configuration file: /config/portal/nginx.conf
Clearing the configuration file: /config/log/logrotate.conf
Clearing the configuration file: /config/log/rsyslog_docker.conf
Clearing the configuration file: /config/nginx/nginx.conf
Clearing the configuration file: /config/core/env
Clearing the configuration file: /config/core/app.conf
Clearing the configuration file: /config/registry/passwd
Clearing the configuration file: /config/registry/config.yml
Clearing the configuration file: /config/registry/root.crt
Clearing the configuration file: /config/registryctl/env
Clearing the configuration file: /config/registryctl/config.yml
Clearing the configuration file: /config/db/env
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

2.4 启动harbor

docker-compose up -d

第一次启动:如下,是提示80端口被占用了

[root@nb001 harbor]# docker-compose up -d
Creating network "harbor_harbor" with the default driver
Creating harbor-log ... done
Creating harbor-portal ... done
Creating registryctl   ... done
Creating redis         ... done
Creating harbor-db     ... done
Creating registry      ... done
Creating harbor-core   ... done
Creating nginx         ... 
Creating nginx             ... error
WARNING: Host is already in use by another container

Creating harbor-jobservice ... done

ERROR: for proxy  Cannot start service proxy: driver failed programming external connectivity on endpoint nginx (c4956aad4a480bf00a4146d0d6c295959ebd3dbdaa972e50594c781eb5e10204): Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use
ERROR: Encountered errors while bringing up the project.

解决:编辑vim docker-compose.yml
将80端口改成没有被占用的端口
在这里插入图片描述
第二次启动:docker-compose up -d

[root@nb001 harbor]# docker-compose up -d
harbor-log is up-to-date
harbor-portal is up-to-date
registry is up-to-date
registryctl is up-to-date
redis is up-to-date
harbor-db is up-to-date
harbor-core is up-to-date
Recreating nginx ... 
Recreating nginx ... done

再次访问,问题消失!

END

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

K8S异常之Harbor证书过期处理(完整版流程) 的相关文章

  • Android——RuntimePermission介绍

    1 介绍 androidM版本上 xff0c 对permission的管理做了部分改动 xff0c 针对dangerous permission xff0c 不在安装的时候给予权限 xff0c 而是在运行过程中咨询用户是否给予app响应的权
  • Android中launcherMode="singleTask"详解【android源码解析六】

    android中launcherMode有4中属性 xff1a standard 默认 xff0c singleTop xff0c singleTask和 singleInstance xff1b 网上有好多例子讲解这四种关系的 xff1a
  • Android闹钟最终版【android源码闹钟解析】

    我以前写了个复杂闹钟的demo xff0c 参见 Android闹钟 复杂版 大明进化十五 但是里面的bug有一些 xff0c 好多人留言 xff0c 所以我就看看源码 xff0c 找找原因 xff1f 顺便把源码代码整理出来 xff0c
  • Smali--Dalvik虚拟机指令语言-->【android_smali语法学习一】

    最近一周在研究rom移植 xff0c 所以就对Smali语言学习了一下 xff0c Smali语言其实就是Davlik的寄存器语言 xff1b Smali语言就是android的应用程序 apk通过apktool反编译出来的都有一个smal
  • 程序员平均月薪过万,想当程序员的话,大学学那些专业会更好呢?

    在互联网时代 xff0c 程序员成为炙手可热的职业 虽然加班累成狗 xff0c 也有可能面临英年早秃的局面 xff0c 但是不得不说程序员的工资高于很多很多传统行业职位的工资 据统计 xff0c 应届程序员毕业生在一线城市平均月薪达到8k
  • android4.0自定义锁屏总结【android锁屏研究一】

    最近搬家了 xff0c 从北京 gt 深圳 xff0c 除了天气有点不同外 xff0c 其他的都差不多 xff0c 工作性质和以前也类似 xff01 纪念一下自己的迁移 题外话 转载请表明出处 xff1a http blog csdn ne
  • android系统锁屏详解【android锁屏解析二】

    谷歌的代码写的确实不错 xff0c 我很幸运 xff0c 一开始接触代码就赶上了谷歌这个开源的系统 xff0c 让我的视野开阔了很多 xff0c 也让我看到了优秀的代码工程师写到的代码 心怀感恩之心 题记 我的有篇文章说了这个锁屏 xff0
  • 单片机学习笔记8--按键和外部中断(基于百问网STM32F103系列教程)

    第八章 按键和外部中断 第一节 按键原理 GPIO内部上拉较弱 xff0c 可根据满足电路需求选择是用内部的上拉还是自己外接上拉 根据原理图可知 xff0c 当按键松开时 xff0c 单片机引脚连接在高电平上 xff0c GPIO口输入高电
  • ARM架构与编程6--重定位(基于百问网ARM架构与编程教程视频)

    一 启动程序流程 我们之前讲过 xff0c 单片机有根据boot的不同 xff0c 有三种启动方式 xff1a boot0boot1启动模式0Xflash启动10系统存储器11内置SRAM 单片机上电复位后 xff0c 运行main函数 以
  • LVGL8.1版本笔记

    之前学过LVGL6 xff0c 现在版本更新到LVGL8了 xff0c 学习下新版本 xff0c 本文主要是记录一些LVGL8的新特性 xff0c 区别和lvgl6的不同之处 lv task handler 的作用 链接 lv task h
  • STM32F407定时器输入捕获

    STM32F407定时器一共有14个 其中分为基本定时器 通用定时器 高级定时器 具体功能如上图所示 下面介绍下输入捕获模式 输入捕获 xff1a 通过检测TIMx CHx上的边沿信号 在边沿信号发生跳变的时候 将当前的定时器的值 TIMx
  • 几种常见的存储器

    存储器分为易失性存储器和非易失性存储器 其中的易失性是指存储器掉电是否能保存数据 易失性存储器 xff1a 就是我们常说的RAM xff0c 这种存储器掉电后所有数据都消失 xff0c 不会被保存 xff0c 重新上电之后 xff0c 原来
  • FreeRTOS初级篇----优先级实验

    FreeRTOS创建任务时 xff0c 可以设置任务的优先级 在FreeRTOS中优先级的值越小 xff0c 优先级越低 xff0c 其他的RTOS都是优先级值越小 xff0c 优先级越高 xff0c 这点需要注意 任务优先级实验 xff1
  • FreeRTOS初级篇----删除任务

    任务既然可以被创建 xff0c 那么自然也可以被删除 xff0c 对于某些执行一次或几次就不需要的任务来说 xff0c 可以在执行完成后 xff0c 把此任务删除 xff0c 可以通过别的任务将其删除 xff0c 也可以任务自己删除自己 任
  • FreeRTOS初级篇----一个函数创建多个任务

    之前说过 xff0c 创建任务的时候 xff0c 可以传递给任务参数 xff0c 下面通过实验 xff0c 对一个任务函数传入不同的参数展示如何使用一个函数创建多个任务 任务函数 xff1a 把传入的数据转换为int型数据然后打印出来 sp
  • 大学生想要通过看书自学编程,却始终没成功,是因为你没有技巧!

    在大学里面 xff0c 有很多的方式来学习编程 xff0c 从在线教程到完成在线课程 xff0c 到密集编程的新手训练营 教程都很棒 xff0c 但它们通常只给你基础知识 与此同时 xff0c 在线教程和线下课程可能非常昂贵 xff0c 虽
  • FreeRTOS初级篇----任务管理

    一 任务状态 再FreeRTOS中 xff0c CPU同一时刻只执行一个任务 xff0c 只不过是所有任务切换的速度特别快 xff0c 默认1ms切换一次任务 xff0c 所以宏观上来看就是CPU再同时运行所有任务 根据任务的执行情况 xf
  • FreeRTOS中级篇

    一 内存管理 1 五种内存管理模式 FreeRTOS提供了5种内存管理实现方法 xff0c 可以根据不同的使用场合选择不同的模式 关于5中内存管理模式可以看下面这篇文章 链接 https zhuanlan zhihu com p 11527
  • LVGL8移植FATFS并适配到STM32F407

    目前LVGL版本已经更新到8 3版本 xff0c FATFS也是在嵌入式领域常用的文件系统 网上许多在LVGL上移植FATFS的教程大都是基于LVGL7版本的 xff0c 而且过程较为凌乱 本文旨在帮助大家了解在LVGL8上移植FATFS文
  • openstack dashboard简体中文汉化

    这里阐述的是fuel工具部署的openstack 环境的dashboard进行简体中文汉化 1 xff09 直接运行 apt get install gettext 命令 2 xff09 转到fuel已经配置好的中文配置文件夹下 cd us

随机推荐