인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

인프런 커뮤니티 질문&답변

Jong Hyeok Lee님의 프로필 이미지
Jong Hyeok Lee

작성한 질문수

그림으로 배우는 쿠버네티스(v1.30) - {{ x86-64, arm64 }}

1.5.쿠버네티스_컨트롤플레인_노드와_워커_노드_그리고 kubeadm으로 쿠버네티스 직접 구성하기-v1.30

controlplane_node.sh 실행 오류 문의

작성

·

50

·

수정됨

0

질문 답변을 제공하지만, 강의 비용에는 Q&A는 포함되어 있지 않습니다.
다만 실습이 안되거나, 잘못된 내용의 경우는 알려주시면 가능한 빠르게 조치하겠습니다!

[질문 전 답변]
1. 강의에서 다룬 내용과 관련된 질문인가요? 예
2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예
3. 질문 잘하기 법을 읽어보셨나요? [예 | 아니요]
(https://www.inflearn.com/blogs/1719)
4. 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
5. vagrant up 에서 발생하는 문제는 주로 호스트 시스템(Windows, MacOS)과 연관된 다양한 조건에 의해 발생합니다. 따라서 이를 모두 제가 파악할 수 없어서 해결이 어렵습니다. vagrant up으로 진행이 어렵다면 제공해 드리는 가상 머신(VM) 이미지를 import해서 진행하시기 바랍니다.
(https://www.inflearn.com/questions/992407/comment/281901)

[질문 하기]

controlplane_node.sh 실행시 오류가 발생합니다.

 

cp: cannot stat '/etc/kubernetes/admin.conf': No such file or directory

라고 출력됩니다.

 

실제로 cp-k8s 컨테이너 안에 해당 경로 파일이 존재하지 않습니다.

 

제가 더 확인해야 할게 있을까요?

아래 내용은 진행해 보았습니다.

 

2.코드 새로 내려받기 (https://github.com/sysnet4admin/_Lecture_k8s_learning.kit)

3.호스트에서 여기 접속되는지 확인 (https://raw.githubusercontent.com/sysnet4admin/IaC/main/k8s/CNI/172.16_net_calico_v3.26.0.yaml)

4.문제발생시 cp-k8s에 접속해서 (https://raw.githubusercontent.com/sysnet4admin/IaC/main/k8s/CNI/172.16_net_calico_v3.26.0.yaml 접속되는지 확인. curl로 확인하시면 됩니다.)

 

controlplane_node.sh  k8s_env_build.sh  k8s_pkg_cfg.sh  _Lecture_k8s_starter.kit  tabby-v1.0.207  Vagrantfile  vagrant-v2.4.1  virtualbox-v7.0.18  worker_nodes.sh
root@cp-k8s:~/_Lecture_k8s_learning.kit/ch1/1.5# ./controlplane_node.sh 
I1222 18:00:09.315839    3931 version.go:256] remote version is much newer: v1.32.0; falling back to: stable-1.30
[init] Using Kubernetes version: v1.30.8
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR FileContent--proc-sys-net-ipv4-ip_forward]: /proc/sys/net/ipv4/ip_forward contents are not set to 1
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher
cp: cannot stat '/etc/kubernetes/admin.conf': No such file or directory
chown: cannot access '/root/.kube/config': No such file or directory
error: error validating "https://raw.githubusercontent.com/sysnet4admin/IaC/main/k8s/CNI/172.16_net_calico_v3.26.0.yaml": error validating data: failed to download openapi: Get "http://localhost:8080/openapi/v2?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused; if you choose to ignore these errors, turn validation off with --validate=false
fatal: destination path '_Lecture_k8s_starter.kit' already exists and is not an empty directory.
mv: cannot stat '/home/vagrant/_Lecture_k8s_starter.kit': No such file or directory
find: ‘/root/_Lecture_k8s_starter.kit’: No such file or directory
Cloning into '/tmp/update-kube-cert'...
remote: Enumerating objects: 166, done.
remote: Counting objects: 100% (54/54), done.
remote: Compressing objects: 100% (45/45), done.
remote: Total 166 (delta 18), reused 20 (delta 8), pack-reused 112 (from 1)
Receiving objects: 100% (166/166), 63.56 KiB | 7.95 MiB/s, done.
Resolving deltas: 100% (81/81), done.
CERTIFICATE                                       EXPIRES                       
grep: /etc/kubernetes/controller-manager.conf: No such file or directory
Could not read certificate from /dev/fd/63
Unable to load certificate
/etc/kubernetes/controller-manager.config                                       
grep: /etc/kubernetes/scheduler.conf: No such file or directory
Could not read certificate from /dev/fd/63
Unable to load certificate
/etc/kubernetes/scheduler.config                                                
grep: /etc/kubernetes/admin.conf: No such file or directory
Could not read certificate from /dev/fd/63
Unable to load certificate
/etc/kubernetes/admin.config                                                    
Could not open file or uri for loading certificate from /etc/kubernetes/pki/ca.crt
402726755D7F0000:error:16000069:STORE routines:ossl_store_get0_loader_int:unregistered scheme:../crypto/store/store_register.c:237:scheme=file
402726755D7F0000:error:80000002:system library:file_open:No such file or directory:../providers/implementations/storemgmt/file_store.c:267:calling stat(/etc/kubernetes/pki/ca.crt)
Unable to load certificate
/etc/kubernetes/pki/ca.crt                                                      
Could not open file or uri for loading certificate from /etc/kubernetes/pki/apiserver.crt
4067E2CBF37F0000:error:16000069:STORE routines:ossl_store_get0_loader_int:unregistered scheme:../crypto/store/store_register.c:237:scheme=file
4067E2CBF37F0000:error:80000002:system library:file_open:No such file or directory:../providers/implementations/storemgmt/file_store.c:267:calling stat(/etc/kubernetes/pki/apiserver.crt)
Unable to load certificate
/etc/kubernetes/pki/apiserver.crt                                               
Could not open file or uri for loading certificate from /etc/kubernetes/pki/apiserver-kubelet-client.crt
4037BCF84B7F0000:error:16000069:STORE routines:ossl_store_get0_loader_int:unregistered scheme:../crypto/store/store_register.c:237:scheme=file
4037BCF84B7F0000:error:80000002:system library:file_open:No such file or directory:../providers/implementations/storemgmt/file_store.c:267:calling stat(/etc/kubernetes/pki/apiserver-kubelet-client.crt)
Unable to load certificate
/etc/kubernetes/pki/apiserver-kubelet-client.crt                                
Could not open file or uri for loading certificate from /etc/kubernetes/pki/front-proxy-ca.crt
40D7C0B37F7F0000:error:16000069:STORE routines:ossl_store_get0_loader_int:unregistered scheme:../crypto/store/store_register.c:237:scheme=file
40D7C0B37F7F0000:error:80000002:system library:file_open:No such file or directory:../providers/implementations/storemgmt/file_store.c:267:calling stat(/etc/kubernetes/pki/front-proxy-ca.crt)
Unable to load certificate
/etc/kubernetes/pki/front-proxy-ca.crt                                          
Could not open file or uri for loading certificate from /etc/kubernetes/pki/front-proxy-client.crt
40F732D0707F0000:error:16000069:STORE routines:ossl_store_get0_loader_int:unregistered scheme:../crypto/store/store_register.c:237:scheme=file
40F732D0707F0000:error:80000002:system library:file_open:No such file or directory:../providers/implementations/storemgmt/file_store.c:267:calling stat(/etc/kubernetes/pki/front-proxy-client.crt)
Unable to load certificate
/etc/kubernetes/pki/front-proxy-client.crt                                      
Could not open file or uri for loading certificate from /etc/kubernetes/pki/etcd/ca.crt
40478D1F957F0000:error:16000069:STORE routines:ossl_store_get0_loader_int:unregistered scheme:../crypto/store/store_register.c:237:scheme=file
40478D1F957F0000:error:80000002:system library:file_open:No such file or directory:../providers/implementations/storemgmt/file_store.c:267:calling stat(/etc/kubernetes/pki/etcd/ca.crt)
Unable to load certificate
/etc/kubernetes/pki/etcd/ca.crt                                                 
Could not open file or uri for loading certificate from /etc/kubernetes/pki/etcd/server.crt
4067A803637F0000:error:16000069:STORE routines:ossl_store_get0_loader_int:unregistered scheme:../crypto/store/store_register.c:237:scheme=file
4067A803637F0000:error:80000002:system library:file_open:No such file or directory:../providers/implementations/storemgmt/file_store.c:267:calling stat(/etc/kubernetes/pki/etcd/server.crt)
Unable to load certificate
/etc/kubernetes/pki/etcd/server.crt                                             
Could not open file or uri for loading certificate from /etc/kubernetes/pki/etcd/peer.crt
40374471317F0000:error:16000069:STORE routines:ossl_store_get0_loader_int:unregistered scheme:../crypto/store/store_register.c:237:scheme=file
40374471317F0000:error:80000002:system library:file_open:No such file or directory:../providers/implementations/storemgmt/file_store.c:267:calling stat(/etc/kubernetes/pki/etcd/peer.crt)
Unable to load certificate
/etc/kubernetes/pki/etcd/peer.crt                                               
Could not open file or uri for loading certificate from /etc/kubernetes/pki/etcd/healthcheck-client.crt
405798E15C7F0000:error:16000069:STORE routines:ossl_store_get0_loader_int:unregistered scheme:../crypto/store/store_register.c:237:scheme=file
405798E15C7F0000:error:80000002:system library:file_open:No such file or directory:../providers/implementations/storemgmt/file_store.c:267:calling stat(/etc/kubernetes/pki/etcd/healthcheck-client.crt)
Unable to load certificate
/etc/kubernetes/pki/etcd/healthcheck-client.crt                                 
Could not open file or uri for loading certificate from /etc/kubernetes/pki/apiserver-etcd-client.crt
40473BA4FA7F0000:error:16000069:STORE routines:ossl_store_get0_loader_int:unregistered scheme:../crypto/store/store_register.c:237:scheme=file
40473BA4FA7F0000:error:80000002:system library:file_open:No such file or directory:../providers/implementations/storemgmt/file_store.c:267:calling stat(/etc/kubernetes/pki/apiserver-etcd-client.crt)
Unable to load certificate
/etc/kubernetes/pki/apiserver-etcd-client.crt                                   
[2024-12-22T18:00:11.00+0900][WARNING] does not backup, /etc/kubernetes.old-20241222 already exists
[2024-12-22T18:00:11.00+0900][INFO] updating...
Wait 30 seconds for restarting the Control-Plane Node...
root@cp-k8s:~/_Lecture_k8s_learning.kit/ch1/1.5# ls
controlplane_node.sh  k8s_env_build.sh  k8s_pkg_cfg.sh  _Lecture_k8s_starter.kit  tabby-v1.0.207  Vagrantfile  vagrant-v2.4.1  virtualbox-v7.0.18  worker_nodes.sh
root@cp-k8s:~/_Lecture_k8s_learning.kit/ch1/1.5# ls /etc/kubernetes
manifests
root@cp-k8s:~/_Lecture_k8s_learning.kit/ch1/1.5# 

답변 2

1

강사님 말씀대로 vagrant destory, up 이후에 실행하니 정상 동작 합니다.!!

다시 생각해보니 tabby가 열리지 않아서,, VM을 재기동했더라구요. 바쁘실텐데 답변 감사드립니다.

 

그럼 완강하겠습니다.~!

조훈(Hoon Jo)님의 프로필 이미지
조훈(Hoon Jo)
지식공유자

다행이네요 🙂 앞으로도 진행하시면서 어려운 점 있으면 말씀해 주세요!

감사합니다.

1

조훈(Hoon Jo)님의 프로필 이미지
조훈(Hoon Jo)
지식공유자

안녕하세요

vagrant up으로 생성된 cp-k8s에 이 부분이 가상머신의 처음 시작에만 적용되도록 설정되어 있기 때문에 가상머신(VM)을 껐다가 켜서 1.5부터 다시 하시면 실습이 1.5 진행이 되지 않습니다.

참고 링크:

https://github.com/sysnet4admin/_Lecture_k8s_learning.kit/blob/main/ch1/1.5/k8s_env_build.sh#L31-L32

다시 vagrant up부터 다시 하시거나...위의 소스 부분

# packets traversing the bridge are processed by iptables for filtering
echo 1 > /proc/sys/net/ipv4/ip_forward

을 실행하고 ./controlplane_node.sh 를 실행하시면 정상적으로 동작할 것 같습니다.

해보시고 혹시 안되시면 말씀 부탁드려도 될까요?

Jong Hyeok Lee님의 프로필 이미지
Jong Hyeok Lee

작성한 질문수

질문하기