- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 google cloud k8s 集群中有一个私有(private) docker 注册表,只能通过 IP 访问。
我尝试过的事情:
/etc/ssl/certs/registry-proxy-ca.pem
并运行 update-ca-certificates && systemctl restart docker
.我希望客户端自签名证书在尝试创建 pod 并从 docker registry 中拉取图像时得到 k8s 节点的批准。
但是还是报错:
x509: certificate signed by unknown authority
谁能帮助我理解我做错了什么?我的脚本:
IP=10.3.240.100
LIFESPAN_DAYS=35600
CERTS_DIR=platform/cert-customizations/certs
CA_KEY=$CERTS_DIR/registry-proxy-ca.key
CA_PEM=$CERTS_DIR/registry-proxy-ca.pem
OPENSSL_CONFIG=$CERTS_DIR/openssl.cnf
REGISTRY_CERT_DIR=platform/registry-proxy/certs
REGISTRY_CERT_KEY=$REGISTRY_CERT_DIR/tls.key
REGISTRY_CERT=$REGISTRY_CERT_DIR/tls.crt
REGISTRY_CSR=$REGISTRY_CERT_DIR/registry-proxy.csr
REGISTRY_EXTFILE=$REGISTRY_CERT_DIR/extfile.cnf
echo subjectAltName = IP:$IP > $REGISTRY_EXTFILE
cat >>$OPENSSL_CONFIG <<EOL
[ req ]
default_bits = 2048
req_extensions = req_ext
x509_extensions = x509_ext
string_mask = utf8only
distinguished_name = subject
[ subject ]
# For simplicity, I will skip over the contents.
# ...
[ x509_ext ]
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment
subjectAltName = @alternate_names
[ req_ext ]
subjectKeyIdentifier = hash
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment
subjectAltName = @alternate_names
[ alternate_names ]
IP.1 = ${IP}
EOL
# Private key
openssl genrsa -out $CA_KEY 2048
# Public root CA
openssl req -subj "/CN=Nerdia Root CA" -x509 -new -nodes -key $CA_KEY -sha256 -days $LIFESPAN_DAYS -out $CA_PEM
# Create a cert for docker registry
openssl genrsa -out $REGISTRY_CERT_KEY 2048
openssl req -subj "/CN=${IP}" -config $OPENSSL_CONFIG -new -key $REGISTRY_CERT_KEY -out $REGISTRY_CSR
openssl x509 -req -in $REGISTRY_CSR -CA $CA_PEM -CAkey $CA_KEY -CAcreateserial -out $REGISTRY_CERT -days $LIFESPAN_DAYS -sha256 -extfile $REGISTRY_EXTFILE
最佳答案
此特定问题中的问题与 GKE
正在使用的 CRI
相关。
引用稍微修改过的官方文档(部分):
OS Node images Description Container-Optimized OS Container-Optimized OS with Containerd (cos_containerd) The cos_containerd
image uses Containerd as the container runtime directly integrated with Kubernetes. For more information, see Using Containerd imagesContainer-Optimized OS with Docker (cos) The cos
image uses the Docker container runtime-- Cloud.google.com: Kubernetes Engine: Docs: Concepts: Node images: Available Node images
具体图片:
gke-1199-gke1400-cos-85-13310-1209-12-v210407-c-pre
正在使用 containerd
作为 CRI
而不是 Docker
(参见 -c-
)。因此:$ systemctl restart docker
没有给出预期的结果。解决方案是在 systemctl restart ...
中将 docker
替换为 containerd
。
您可以通过以下任一方式检查您使用的是哪个 CRI
:
$ kubectl get nodes --output wide
Cloud Console
(网页界面)旁注!
Running Docker commands on Containerd nodes
While the Docker binary is currently available on Containerd nodes, we do not recommend using it after you migrate to Containerd. Docker does not manage the containers Kubernetes runs on Containerd nodes, thus you cannot use it to view or interact with running Kubernetes containers using Docker commands or the Docker API.
Warning: Docker cannot view or access containers or images managed by Kubernetes. Your applications should not interact with Docker directly. For general troubleshooting or debugging, use crictl instead.
-- Cloud.google.com: Kubernetes Engine: Docs: Concepts: Using containerd: Migrating
其他资源:
关于docker - 如何为IP地址(不带域名)生成自签名证书?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67771013/
以下帖子可能看起来相同,但在尝试作为答案提供的所有解决方案后,我无法纠正问题。(Login failed for user 'DOMAIN\MACHINENAME$') 我的问题 我正在 Window
域名、虚拟主机是什么意思?有的新手用户不理解,为什么做网站要买域名和空间才行。这里我们来分别介绍下域名和虚拟主机。 关于域名 域名通俗的说,就是你网站的名号,你注册域名之后就以这个名号去宣传
我有一台具有2个域名的服务器(比如domain1.com和domain2.com)。 我可以通过ssh user@domain1.com和ssh user@domain2.com SSH进入服务器。我
我已经设置了一个 Ubuntu LAMP 服务器,并且我的网站可以正常运行 phpmyadmin。但是,我最近不得不为我的 IP 地址创建一个虚拟主机,以避免 Tomcat 中的目录列表出现安全问题,
Nginx可以为某一个域名单独加用户认证,具体做法如下: 1. 生成用户认证的用户名和密码: 复制代码代码如下: #wget -c soft.vpser.net/ln
Centos中基于IP的虚拟主机搭建 首先,检查是否已安装httpd软件包 安装httpd软件包 安装完成 启动服务 主配置文件是/etc/httpd/conf/htt
1、什么是泛域名解析? 泛域名解析是指将*.域名解析到同一IP。 在域名前添加任何子域名,均可访问到所指向的WEB地址。也就是客户的域名a.com之下所设的*.a.com全部解析到同一个IP地
我知道 WordNet 有域层次结构:例如运动->足球。 1) 是否可以列出所有与“sport->football”子域相关的单词? Response: goalkeeper, forward,
我正在尝试为我正在处理的项目的 URL 缩短器设置一个带有 .ka 后缀的域。例如类似于 drbl.in。我在网上查了一下,这个后缀似乎还没有在任何国家注册过,也没有出现过任何域名服务。关于如何解决这
我在设置 Openfire 时遇到问题。 Openfire 设置中的默认 XMPP 域名显示我的计算机名称,因此每当我通过 Spark 进行测试时,它都不起作用。 我尝试了我拥有的域,但在 openf
我正在使用 Joomla 的 JSN Uniform 插件来接收电子邮件,但它不接受 .company 域作为有效域。它接受常用域(com、net、org、info、biz 等),但不接受 .comp
我创建了一个域名并将其重新定义为您的外部 IP 地址。同时启动 nginx 和 tomcat。将域重新定义为外部 IP 地址。 truckpart4you.com:8081/spring 我想隐藏80
与子域相反。 我试过了。 var a = window.location.hostname.match(/(www.)?([^\.]*)\./)[2]; 但这会抢 frozen-dusk-2587
我正在使用 django 的 send_mail 发送一封电子邮件(使用模板),其中包含以下行: 要重置密码,请点击以下链接: http://localhost:8000/{% url 'reset_
来自 Scrapy 教程: domain_name: identifies the Spider. It must be unique, that is, you can’t set the same
一个快速简单的正则表达式问题 我在字符串中有一个域名,我需要删除它 - 总是有 http://www. 并且域总是以“/”结尾 g_adv_fullpath_old = g_adv_fullpath_
我需要 xslt 版本 2 在记录或元素级别为“xml”属性前缀 (xml:lang="en-us") 生成域名: xmlns:xml="http://www.w3.org/XML/1998/name
如何获取机器的域名(如果机器实际上已加入域)? 当然,如果机器没有加入域,函数应该返回 null,或 空字符串,或 机器的名称,或 "." 注意事项: NetGetJoinInformation Wi
这个手机号码正则验证函数可以说是最新的都支持的,里面有详细的介绍说明,不论以后增加什么号段大家都非常容易的稍微修改一下即可。 javascript 手机号码正则表达式验证函数 复制代码 代码如下:
我使用 Google 域在 Github Pages 上托管我的网站,在 Chrome 中的 iPhone 上运行完美 但是在我的桌面上,Chrome(我的普通浏览器(我确实检查了缓存))或 Fire
我是一名优秀的程序员,十分优秀!