OKD 4.9单节点安装
OKD 4.9 single node installation
我正在尝试按照有关如何从这些链接安装单节点 OKD 4.9 集群的官方文档进行操作:
- https://docs.okd.io/4.9/installing/installing_sno/install-sno-preparing-to-install-sno.html
- https://docs.okd.io/4.9/installing/installing_sno/install-sno-installing-sno.html
这是我的网络拓扑:
这是使所有主机都具有静态 IP 地址的 pfsense DHCP 配置:
这里是 pfsence DNS 配置:
这是我的 install-config.yaml
:
apiVersion: v1
baseDomain: lan
compute:
- name: worker
replicas: 0
controlPlane:
name: master
replicas: 1
metadata:
name: okd
networking:
networkType: OVNKubernetes
clusterNetwork:
- cidr: 192.168.222.0/24
hostPrefix: 24
serviceNetwork:
- 172.30.0.0/16
platform:
none: {}
BootstrapInPlace:
InstallationDisk: /dev/sda
pullSecret: '{"auths":{"fake":{"auth": "bar"}}}'
sshKey: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDMkC4l/XYNdhPv1yp1boHACNWEde/QdWRPBKzqepHXI93n70kzqrbXEG8dmRRrSYifvvoLa8+3speBrDmuiuUcXCCXrhWWExCTzVcxjL/MeRxK8XSXmmT39DVF+lQbpS0zfv2wA7cr5Hy894nyI3k2UD1awjGD3S2cnfHFrowwRXh1SAPJZy3H4wvC2+Ff0VaLe0Z3j+HBnFsVshdhQRxybccnLR8101+kVbeCgslF+QoNSKCreU/y3OZ1fU34ft0chWy/Kr8IjFPcCR2jRbc/L1IZd8QI4/ujOLUiNe4uW8CLD3JRKCHkttx5oLVQqxxLsDhdsdmCq9Z6uu/t1pL+uxt+Aab/wy/lpEuzmbVrPz3Fg1bNNSpm5ul8Zwql02bqu3QFzOjhI4r/ua/f36RASa+Ij9deYl8BrzFz0uXGiwMoEJlhAahu/MhfuABBUIg8g/dS4dkEU9cSelipWynDvz95MkvWED5fzRWTSUpkZWsXM87UJ0Ty8yor7diAyK0= admin@okd-admin.lan'
当我在 okd-admin
节点上使用发现 ISO 和 运行 ./openshift-install --dir=ocp wait-for install-complete
启动 okd-master
机器时,出现以下错误:
E0201 01:30:03.627445 5642 reflector.go:138] k8s.io/client-go/tools/watch/informerwatcher.go:146: Failed to watch *v1.ClusterVersion: failed to list *v1.ClusterVersion: Get "https://api.okd.lan:6443/apis/config.openshift.io/v1/clusterversions?fieldSelector=metadata.name%3Dversion&limit=500&resourceVersion=0": dial tcp 192.168.222.2:6443: connect: connection refused
从错误消息中可以看出,api.okd.lan
域名已正确解析为 192.168.222.2
。
但是 okd-master
节点上的端口 6443
上没有任何监听。
我不明白这是怎么回事。
更新
我制作了这个 Dockerfile 来快速生成新的 ISO-s 用于测试:
FROM fedora
ENV OKD_VERSION="4.9.0-0.okd-2022-01-29-035536"
RUN dnf install -y wget coreos-installer
RUN cd /home && \
wget https://github.com/openshift/okd/releases/download/$OKD_VERSION/openshift-client-linux-$OKD_VERSION.tar.gz -O oc.tar.gz && \
tar zxf oc.tar.gz && \
chmod +x oc
RUN cd /home && \
wget https://github.com/openshift/okd/releases/download/$OKD_VERSION/openshift-install-linux-$OKD_VERSION.tar.gz -O openshift-install-linux.tar.gz && \
tar zxvf openshift-install-linux.tar.gz && \
chmod +x openshift-install
RUN cd /home && \
ISO_URL=$(./openshift-install coreos print-stream-json | grep location | grep x86_64 | grep iso | cut -d\" -f4) && \
wget $ISO_URL -O fcos-live.x86_64.iso
COPY install-config.yaml /home/ocp/install-config.yaml
RUN cd /home && \
./openshift-install --dir=ocp create single-node-ignition-config
RUN cd /home && \
cp ocp/bootstrap-in-place-for-live-iso.ign iso.ign && \
coreos-installer iso ignition embed -fi iso.ign fcos-live.x86_64.iso
此脚本为我生成 ISO:
@echo off
docker build -t okd-iso-maker .
docker run --name okd-iso-maker odk-iso-maker
docker stop okd-iso-maker
docker cp odk-iso-maker:/home/fcos-live.x86_64.iso ./fcos-live.x86_64.iso
echo ISO generation complete!
pause
我想出了如何通过 SSH 进入 okd-master
并检查日志。
运行 journalctl -u bootkube.service
我得到了这些 logs.
这两个文档链接似乎是一个谎言:
- https://docs.okd.io/4.9/installing/installing_sno/install-sno-preparing-to-install-sno.html
- https://docs.okd.io/4.9/installing/installing_sno/install-sno-installing-sno.html
根据这两个问题:
- https://github.com/openshift/okd/discussions/1012
- https://github.com/openshift/openshift-docs/issues/39759
OKD 不支持“使用辅助安装程序安装”,这些链接是“使用辅助安装程序安装”。
好浪费时间。
我正在尝试按照有关如何从这些链接安装单节点 OKD 4.9 集群的官方文档进行操作:
- https://docs.okd.io/4.9/installing/installing_sno/install-sno-preparing-to-install-sno.html
- https://docs.okd.io/4.9/installing/installing_sno/install-sno-installing-sno.html
这是我的网络拓扑:
这是使所有主机都具有静态 IP 地址的 pfsense DHCP 配置:
这里是 pfsence DNS 配置:
这是我的 install-config.yaml
:
apiVersion: v1
baseDomain: lan
compute:
- name: worker
replicas: 0
controlPlane:
name: master
replicas: 1
metadata:
name: okd
networking:
networkType: OVNKubernetes
clusterNetwork:
- cidr: 192.168.222.0/24
hostPrefix: 24
serviceNetwork:
- 172.30.0.0/16
platform:
none: {}
BootstrapInPlace:
InstallationDisk: /dev/sda
pullSecret: '{"auths":{"fake":{"auth": "bar"}}}'
sshKey: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDMkC4l/XYNdhPv1yp1boHACNWEde/QdWRPBKzqepHXI93n70kzqrbXEG8dmRRrSYifvvoLa8+3speBrDmuiuUcXCCXrhWWExCTzVcxjL/MeRxK8XSXmmT39DVF+lQbpS0zfv2wA7cr5Hy894nyI3k2UD1awjGD3S2cnfHFrowwRXh1SAPJZy3H4wvC2+Ff0VaLe0Z3j+HBnFsVshdhQRxybccnLR8101+kVbeCgslF+QoNSKCreU/y3OZ1fU34ft0chWy/Kr8IjFPcCR2jRbc/L1IZd8QI4/ujOLUiNe4uW8CLD3JRKCHkttx5oLVQqxxLsDhdsdmCq9Z6uu/t1pL+uxt+Aab/wy/lpEuzmbVrPz3Fg1bNNSpm5ul8Zwql02bqu3QFzOjhI4r/ua/f36RASa+Ij9deYl8BrzFz0uXGiwMoEJlhAahu/MhfuABBUIg8g/dS4dkEU9cSelipWynDvz95MkvWED5fzRWTSUpkZWsXM87UJ0Ty8yor7diAyK0= admin@okd-admin.lan'
当我在 okd-admin
节点上使用发现 ISO 和 运行 ./openshift-install --dir=ocp wait-for install-complete
启动 okd-master
机器时,出现以下错误:
E0201 01:30:03.627445 5642 reflector.go:138] k8s.io/client-go/tools/watch/informerwatcher.go:146: Failed to watch *v1.ClusterVersion: failed to list *v1.ClusterVersion: Get "https://api.okd.lan:6443/apis/config.openshift.io/v1/clusterversions?fieldSelector=metadata.name%3Dversion&limit=500&resourceVersion=0": dial tcp 192.168.222.2:6443: connect: connection refused
从错误消息中可以看出,api.okd.lan
域名已正确解析为 192.168.222.2
。
但是 okd-master
节点上的端口 6443
上没有任何监听。
我不明白这是怎么回事。
更新
我制作了这个 Dockerfile 来快速生成新的 ISO-s 用于测试:
FROM fedora
ENV OKD_VERSION="4.9.0-0.okd-2022-01-29-035536"
RUN dnf install -y wget coreos-installer
RUN cd /home && \
wget https://github.com/openshift/okd/releases/download/$OKD_VERSION/openshift-client-linux-$OKD_VERSION.tar.gz -O oc.tar.gz && \
tar zxf oc.tar.gz && \
chmod +x oc
RUN cd /home && \
wget https://github.com/openshift/okd/releases/download/$OKD_VERSION/openshift-install-linux-$OKD_VERSION.tar.gz -O openshift-install-linux.tar.gz && \
tar zxvf openshift-install-linux.tar.gz && \
chmod +x openshift-install
RUN cd /home && \
ISO_URL=$(./openshift-install coreos print-stream-json | grep location | grep x86_64 | grep iso | cut -d\" -f4) && \
wget $ISO_URL -O fcos-live.x86_64.iso
COPY install-config.yaml /home/ocp/install-config.yaml
RUN cd /home && \
./openshift-install --dir=ocp create single-node-ignition-config
RUN cd /home && \
cp ocp/bootstrap-in-place-for-live-iso.ign iso.ign && \
coreos-installer iso ignition embed -fi iso.ign fcos-live.x86_64.iso
此脚本为我生成 ISO:
@echo off
docker build -t okd-iso-maker .
docker run --name okd-iso-maker odk-iso-maker
docker stop okd-iso-maker
docker cp odk-iso-maker:/home/fcos-live.x86_64.iso ./fcos-live.x86_64.iso
echo ISO generation complete!
pause
我想出了如何通过 SSH 进入 okd-master
并检查日志。
运行 journalctl -u bootkube.service
我得到了这些 logs.
这两个文档链接似乎是一个谎言:
- https://docs.okd.io/4.9/installing/installing_sno/install-sno-preparing-to-install-sno.html
- https://docs.okd.io/4.9/installing/installing_sno/install-sno-installing-sno.html
根据这两个问题:
- https://github.com/openshift/okd/discussions/1012
- https://github.com/openshift/openshift-docs/issues/39759
OKD 不支持“使用辅助安装程序安装”,这些链接是“使用辅助安装程序安装”。 好浪费时间。