OpenShift 4.2 etcd operatorhub离线环境部署
2024-08-31 15:58:45
本文记录在OperatorHub中存在界面但缺少镜像的环境下如何安装部署。感谢王征提供的大力支持和指导。
现在一个在线环境找到etcd所需要的镜像
quay.io/coreos/etcd-operator@sha256:66a37fd61a06a43969854ee6d3e21087a98b93838e284a6086b13917f96b0d9b quay.io/coreos/etcd:v3.2.13
docker.io/library/busybox:1.28.-glibc
找一个能上网的机器,建立registry.redhat.ren的docker-distribution,通过oc image mirror命令把镜像的相关信息复制到本地
oc image mirror quay.io/coreos/etcd-operator@sha256:66a37fd61a06a43969854ee6d3e21087a98b93838e284a6086b13917f96b0d9b registry.redhat.ren/quay.io/coreos/etcd-operator
将本地的registry打包成tgz文件,
tar zcvf registry-etcd.tgz registry
然后上传到自己离线的registry,然后解压。
修改helper机器上的image.registries.conf,添加如下记录
[[registry]]
location = "quay.io/coreos/etcd-operator"
insecure = false
blocked = false
mirror-by-digest-only = false
prefix = "" [[registry.mirror]]
location = "registry.redhat.ren/quay.io/coreos/etcd-operator"
insecure = true [[registry]]
location = "docker.io/library/busybox"
insecure = false
blocked = false
mirror-by-digest-only = false
prefix = "" [[registry.mirror]]
location = "registry.redhat.ren/docker.io/library/busybox"
insecure = true [[registry]]
location = "quay.io/coreos/etcd"
insecure = false
blocked = false
mirror-by-digest-only = false
prefix = "" [[registry.mirror]]
location = "registry.redhat.ren/quay.io/coreos/etcd"
insecure = true
然后运行
config_source=$(cat ./image.registries.conf | python3 -c "import sys, urllib.parse; print(urllib.parse.quote(''.join(sys.stdin.readlines())))" ) cat <<EOF > -worker-container-registries.yaml
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: worker
name: -worker-container-registries
spec:
config:
ignition:
version: 2.2.
storage:
files:
- contents:
source: data:text/plain,${config_source}
verification: {}
filesystem: root
mode:
path: /etc/containers/registries.conf
EOF cat <<EOF > -master-container-registries.yaml
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: master
name: -master-container-registries
spec:
config:
ignition:
version: 2.2.
storage:
files:
- contents:
source: data:text/plain,${config_source}
verification: {}
filesystem: root
mode:
path: /etc/containers/registries.conf
EOF
oc apply -f ./-worker-container-registries.yaml -n openshift-config
oc apply -f ./-master-container-registries.yaml -n openshift-config
通过podman push把另外两个镜像推入到正确的位置,然后安装etcd Operator, 再建立etcd cluster.
[root@helper ocp4]# oc get pods
NAME READY STATUS RESTARTS AGE
etcd-operator-7f95f8497c-cczf9 / Running 3h46m
example-f6jg6px9q4 / Running 3h44m
example-mvlbn7v2tl / Running 3h43m
example-wkgcgjgpw4 / Running 3h43m
最新文章
- SAP CRM 性能小技巧
- [OC]宏与const 的使用
- 使用GDB 修改MySQL参数不重启
- 深入理解java虚拟机(1)------内存区域与内存溢出
- 查看Linux服务器各种信息方法
- ACM2035_(递归法求幂)
- UI设计网站参考
- 百度2017笔试题:寻找n个员工中未打卡的那一个
- POJ 2387 Til the Cows Come Home(dij+邻接矩阵)
- 获取Excel数据(或部分数据)并导出成txt文本格式
- android TextView实现滚动显示效果
- Apache+PHP+Mysql中文配置
- 【Bootstrap】 一些提示信息插件
- php网上支付易宝
- git 的简单实用
- 个人项目 Individual Project
- HDU-6370 Werewolf(杭电多校6I)
- NSL:CPK_NN神经网络实现预测哪个样本与哪个样本处在同一层,从而科学规避我国煤矿突水灾难—Jason niu
- Python3 tkinter基础 Entry insert delete 点击按钮 向输入框赋值 或 清空
- 网络基础之 tcp/ip五层协议 socket
热门文章
- Educational Codeforces Round 69 D. Yet Another Subarray Problem
- c语言联合union的使用用途
- Objective-C Classes Are also Objects
- react hooks沉思录
- (转)虚拟文件系统(VFS)浅析
- ES6学习笔记--default,rest
- Nginx是什么及作用?
- new String(";123";) 创建了几个对象?
- html 复习(for循环不同内容的div)
- 反射调用异常InvocationTargetException和代理类抛出异常