• 카테고리

    질문 & 답변
  • 세부 분야

    데브옵스 · 인프라

  • 해결 여부

    미해결

master init error

24.02.16 14:23 작성 조회수 192

0

안녕하세요.
열심히 열공 하고 있습니다.


저는 컴퓨터 환경이 우분투 데스크탑 서버 22.04 두대

우분투 라이브 서버 두대 이렇게 운영중에 있습니다.

kubernetes master init 에러

 

각 각 4대의 공유기로 따로 사설 Ip로 나가고 있습니다.

몇가지 궁금한 점
1. 4대의 pc가 내부 ip로 연결이 안 되어 있습니다.(랜 카드을 두개 설치해서 각각 내부 ip로 연결이 되어야 하는지 궁금합니다.)
2. Docker 서비스를 stop에서 사용해야 하는지 아니면 별개로 그냥 사용해도 되는지 궁금합니다.
3. 우분투 데스크탑 서버 22.04 두대에 설치을 하면
똑같은 kubernetes master init 에러
error execution phase addon/coredns: couldn't retrieve DNS addon deployments: Get "https://192.168.0.4:6443/apis/apps/v1/namespaces/kube-system/deployments?labelSelector=k8s-app%3Dkube-dns": net/http: request canceled (Client.Timeout exceeded while awaiting headers)

To see the stack trace of this error execute with --v=5 or higher

이 메세지가 출력됩니다.
4. kubeadm reset도 여러번 해봤습니다.
5. 공유기 포트포워딩 8080, 6443, 모든 포트 개방 DMZ도 활성화 했습니다.

답변 2

·

답변을 작성해보세요.

0

gasbugs님의 프로필

gasbugs

2024.02.18

안녕하세요 corp.starcoex님

답변이 늦어서 죄송합니다 ㅠ

말씀하신 증상이 나타나는 이유는 22.04를 사용해서 그렇습니다.

20.04와 22.04는 커널 버전이 달라 동일한 방법으로 설치가 어렵습니다.

20.04로 다시 설치 후 진행이 가능하실까요?

 

아니면 아래와 같은 방법으로 시도해보시면 좋을 것 같습니다. 저도 테스트후 말씀 드리겠습니다!
https://velog.io/@fill0006/Ubuntu-22.04-%EC%BF%A0%EB%B2%84%EB%84%A4%ED%8B%B0%EC%8A%A4-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0

혹시나 싶어서 올려드린 것인데 실행해보니 이 내용으로도 실행이 잘 안되네요 ㅠ 20.04 사용을 부탁드립니다.

 

감사합니다!

0

전체 메세지 입니다.

❯ sudo kubeadm init

I0216 13:56:13.803702 85082 version.go:256] remote version is much newer: v1.29.2; falling back to: stable-1.28

[init] Using Kubernetes version: v1.28.7

[preflight] Running pre-flight checks

[preflight] Pulling images required for setting up a Kubernetes cluster

[preflight] This might take a minute or two, depending on the speed of your internet connection

[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'

W0216 13:56:15.002836 85082 checks.go:835] detected that the sandbox image "registry.k8s.io/pause:3.6" of the container runtime is inconsistent with that used by kubeadm. It is recommended that using "registry.k8s.io/pause:3.9" as the CRI sandbox image.

[certs] Using certificateDir folder "/etc/kubernetes/pki"

[certs] Generating "ca" certificate and key

[certs] Generating "apiserver" certificate and key

[certs] apiserver serving cert is signed for DNS names [kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local starcoexfrist] and IPs [10.96.0.1 192.168.0.4]

[certs] Generating "apiserver-kubelet-client" certificate and key

[certs] Generating "front-proxy-ca" certificate and key

[certs] Generating "front-proxy-client" certificate and key

[certs] Generating "etcd/ca" certificate and key

[certs] Generating "etcd/server" certificate and key

[certs] etcd/server serving cert is signed for DNS names [localhost starcoexfrist] and IPs [192.168.0.4 127.0.0.1 ::1]

[certs] Generating "etcd/peer" certificate and key

[certs] etcd/peer serving cert is signed for DNS names [localhost starcoexfrist] and IPs [192.168.0.4 127.0.0.1 ::1]

[certs] Generating "etcd/healthcheck-client" certificate and key

[certs] Generating "apiserver-etcd-client" certificate and key

[certs] Generating "sa" key and public key

[kubeconfig] Using kubeconfig folder "/etc/kubernetes"

[kubeconfig] Writing "admin.conf" kubeconfig file

[kubeconfig] Writing "kubelet.conf" kubeconfig file

[kubeconfig] Writing "controller-manager.conf" kubeconfig file

[kubeconfig] Writing "scheduler.conf" kubeconfig file

[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"

[control-plane] Using manifest folder "/etc/kubernetes/manifests"

[control-plane] Creating static Pod manifest for "kube-apiserver"

[control-plane] Creating static Pod manifest for "kube-controller-manager"

[control-plane] Creating static Pod manifest for "kube-scheduler"

[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"

[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"

[kubelet-start] Starting the kubelet

[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s

[apiclient] All control plane components are healthy after 10.505890 seconds

[upload-config] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace

[kubelet] Creating a ConfigMap "kubelet-config" in namespace kube-system with the configuration for the kubelets in the cluster

[upload-certs] Skipping phase. Please see --upload-certs

[mark-control-plane] Marking the node starcoexfrist as control-plane by adding the labels: [node-role.kubernetes.io/control-plane node.kubernetes.io/exclude-from-external-load-balancers]

[mark-control-plane] Marking the node starcoexfrist as control-plane by adding the taints [node-role.kubernetes.io/control-plane:NoSchedule]

[bootstrap-token] Using token: mhnjn4.lztgktrm1xxdcwa7

[bootstrap-token] Configuring bootstrap tokens, cluster-info ConfigMap, RBAC Roles

[bootstrap-token] Configured RBAC rules to allow Node Bootstrap tokens to get nodes

[bootstrap-token] Configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials

[bootstrap-token] Configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token

[bootstrap-token] Configured RBAC rules to allow certificate rotation for all node client certificates in the cluster

[bootstrap-token] Creating the "cluster-info" ConfigMap in the "kube-public" namespace

[kubelet-finalize] Updating "/etc/kubernetes/kubelet.conf" to point to a rotatable kubelet client certificate and key

error execution phase addon/coredns: couldn't retrieve DNS addon deployments: Get "https://192.168.0.4:6443/apis/apps/v1/namespaces/kube-system/deployments?labelSelector=k8s-app%3Dkube-dns": net/http: request canceled (Client.Timeout exceeded while awaiting headers)

To see the stack trace of this error execute with --v=5 or higher