Comments (15)
(by @powerkimhub)
제가 SP, TB, LB 만 실행하고
CB-Dragonfly 는 실행하지 않은 상태였습니다.
CB-Dragonfly 가 실행되어 있었으면
CB-Tumblebug 이 VM을 생성하고 CB-Dragonfly 모니터링 에이전트를 설치하는 과정에서
SSH 접속이 가능하다는 것이 검증되므로
CB-Ladybug이 SSH 접속에 실패하지 않았을 것입니다.
from cb-ladybug.
- 아래 의견도 참고해보시기 바랍니다.
- cloud-barista/cb-spider#436 (comment)
- 관련 논의는 여기에서 다루도록 하지요.
- Ladybug 의견을 들어보고, 최종 결정하도록하겠습니다.
from cb-ladybug.
두 번째 시도에서는 성공했습니다.
(MCIR 삭제하지 않고 재활용)
INFO[7365] create MCIS OK.. (name=sjh1)
INFO[7365] start k8s bootstrap
INFO[7369] start script file copy (vm=sjh1-w-2-lj1o0, src=/home/jhseo/go/src/github.com/cloud-barista/cb-ladybug/src/scripts, dest=/tmp)
INFO[7369] start script file copy (vm=sjh1-w-1-hxxrm, src=/home/jhseo/go/src/github.com/cloud-barista/cb-ladybug/src/scripts, dest=/tmp)
INFO[7372] end script file copy (vm=sjh1-w-1-hxxrm, server=34.64.215.181:22)
INFO[7373] end script file copy (vm=sjh1-w-2-lj1o0, server=34.64.173.210:22)
Created symlink /etc/systemd/system/kubelet.service.wants/ladybug-bootstrap.service → /lib/systemd/system/ladybug-bootstrap.service.
Created symlink /etc/systemd/system/kubelet.service.wants/ladybug-bootstrap.service → /lib/systemd/system/ladybug-bootstrap.service.
INFO[7384] start script file copy (vm=sjh1-c-1-9k16i, src=/home/jhseo/go/src/github.com/cloud-barista/cb-ladybug/src/scripts, dest=/tmp)
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:
Warning: apt-key output should not be parsed (stdout is not a terminal)
Warning: apt-key output should not be parsed (stdout is not a terminal)
...
INFO[7676] install networkCNI
INFO[7678] end k8s init
INFO[7678] start k8s join
INFO[7678] worker join (vm=sjh1-w-1-hxxrm)
W0708 10:27:02.911064 14105 join.go:346] [preflight] WARNING: JoinControlPane.controlPlane settings will be ignored when control-plane flag is not set.
INFO[7699] worker join (vm=sjh1-w-2-lj1o0)
W0708 10:27:23.498776 13779 join.go:346] [preflight] WARNING: JoinControlPane.controlPlane settings will be ignored when control-plane flag is not set.
INFO[7708] end k8s join
INFO[7708] duration := 6m30.624747945s
from cb-ladybug.
-
현 이슈는 Spider로 이관합니다. 🕷 -
다음 이슈 참고하시기 바랍니다.
-
현 이슈는 판단하시어 close해도 될 것 같습니다.
from cb-ladybug.
CB-Dragonfly 가 실행되어 있었으면
CB-Tumblebug 이 VM을 생성하고 CB-Dragonfly 모니터링 에이전트를 설치하는 과정에서
SSH 접속이 가능하다는 것이 검증되므로
CB-Ladybug이 SSH 접속에 실패하지 않았을 것입니다.
이 문구 관련해서, 오해의 소지가 있는 듯해서 댓글을 답니다.
CB-TB 가 Dragonfly Agent 를 MCIS(VM) 생성시, 디폴트로 SSH 접속 여부도 확인하고 Agent 설치를 지속적으로 Try 하지만
Agent 설치가 가능하다는 것과 그 이후로도 SSH가 계속 가능하다는 것을 보장하지는 않습니다.
따라서, Spider나 TB에 의존하기 보다는,
CB-ladybug도 SSH 불가 가능성을 염두에 두고 관련 로직이 처리되는 것이 바람직하지 않을까 생각합니다.
(CB-Ladybug에서 당연히 그렇게 해나가실거라 생각합니다..^^)
from cb-ladybug.
- 의견을 주시기 바랍니다.
- 위에서 감안하시어 처리한다면, Spider에서는 추가 작업을 하지 않겠습니다.
from cb-ladybug.
- 현재 CB-LB에서는 SSH 접속 시도를 2회만 수행한 후 접속되지 않으면 그대로 진행되면서 이후 작업이 실패하게 됩니다.
- 혹시 CB-TB에서 MCIS 단위나 VM단위로 로컬파일의 업로드 기능(k8s provisioning 등 script 복사용)을 제공하여 SSH 접속 여부까지 확인 후 처리해준다면 이 API와 원격 명령 실행 API 등을 활용할 수 있을 것 같고, 제공되지 않는다면 현재 CB-TB에서 Dragonfly 설치 시 사용하는 방식과 유사하게 처리하는 것이 나을 것 같습니다.
CB-TB의 SSH 가능 여부 확인 API를 호출도 유사하게 n번 retry 방식으로 처리될 것으로 보여서(이건 맞나요?). 구현상 큰 차이가 있어 보이진 않습니다.
from cb-ladybug.
@sykim-etri @seokho-son @jihoon-seo
-
Spider에서 처리하게 되면, 상위 계층(TB, LB 등)에서 편의성은 증가하겠지만, Spider 정책을 따를 수 밖에 없습니다.
- 예를 들면,
- sshd check timeout을 5분을 걸면, 5분 동안 SSHD가 안올라오면 무조건 fail을 return할 것입니다. 모든 상황에서.
-
상위 계층에서 여러 상황을 감안하여 자율적으로 대처하고 싶다면,
- 상위 계층에서 처리하는 것이 좀더 유연하겠습니다.
-
당초에는 유사 오류 방지 및 편의성 제공을 감안하여 반영코자하였습니다만,
-
의견 수집 및 현황을 다시 파악해본 결과, 현재의 모습으로 유연성을 유지토록 하겠습니다.
-
의견 수렴에 캄사 드립니다.
[처리 결과]
- 관련한 추가 작업 취소
- 사용 가이드에 관련 내용 추가: 참고
from cb-ladybug.
@seokho-son 현재 CB-TB에서 SSH 접속 여부 체크 방식은 어디서 확인할 수 있을까요?
from cb-ladybug.
@sykim-etri
https://cloud-barista.github.io/cb-tumblebug-api-web/?url=https://raw.githubusercontent.com/cloud-barista/cb-tumblebug/main/src/api/rest/docs/swagger.yaml#/%5BMCIS%5D%20Remote%20command/post_ns__nsId__cmd_mcis__mcisId_
따로 SSH 접속 여부 체크 기능을 API로 제공하지는 않고욤.
원격 거맨드 기능으로 임의의 명령을 수행해보시면 될 것 같습니다. (TB에서는 hostname이나 ls를 해보고 있습니다.)
from cb-ladybug.
@seokho-son
제가 질문을 잘못했습니다. 현재 CB-TB에서 Dragonfly 설치를 위해 SSH 접속을 시도하는 코드를 어디서 찾으면 좋을까요? 현재 CB-LB는 2회만 접속시도하므로 CB-TB와 동일한 수준에서 접속을 시도하려고 합니다.ㅎㅎ
from cb-ladybug.
https://github.com/cloud-barista/cb-tumblebug/blob/be7aeb8720c25be657a92afc3557f8d71176bb00/src/core/mcis/control.go#L314
여기에서 verifySSHUserName 을 하고, SSH 가능 여부가 확인 되게 됩니다.
- vm status 확인 (running 아니면 추가 진행하지 않음)
- vm ip 확인 (ip 지정되어 있지 않으면 추가 진행하지 않음)
- ssh를 위한 username이 CB-TB에 의해 검증되었는지 확인
- 검증이 안 되어 있는 경우, TCP SSH 포트가 열려있는지 VM 연결성 재확인 10회 (타임아웃: 10초, 매 2초 슬립)
: https://github.com/cloud-barista/cb-tumblebug/blob/be7aeb8720c25be657a92afc3557f8d71176bb00/src/core/mcis/sshrun.go#L189 - username 탐색을 위해 ssh (
ls
) 를 수행하여 정상 응답이 오는지 확인
실재 Agent 를 탑재하는 코드는
https://github.com/cloud-barista/cb-tumblebug/blob/be7aeb8720c25be657a92afc3557f8d71176bb00/src/core/mcis/control.go#L2000
이고,
VM 생성 후 강제로 20초의 딜레이를 주고
에이전트 설치 전에 상기 verifySSHUserName 를 수행합니다.
일단 CB-TB는 초안으로 이렇게 되어 있고요.. (상당히 오래 여러번 확인...하는 방어적인 코드..)
CB-LB에서는 더 바람직한 방법으로 하시면 좋을 것 같습니다. (저는 프로그래밍을 잘하는 사람이 아니어요...ㅠㅠ)
from cb-ladybug.
@seokho-son
상세한 안내 감사합니다. 안정성 제공을 위한 CB-TB의 노력을 간접적으로 확인할 수 있었습니다.^^
from cb-ladybug.
일부 CSP(오픈스택)에서 생성한 VM의 경우 cloud-init 스크립트 실행으로 SSHD 실행이 꽤 지연되는 경우도 있음. 이를 고려한 해결 방안이 필요합니다.
https://cloud-barista.slack.com/archives/CLFCLNFTJ/p1625817016229400?thread_ts=1625801251.224700&cid=CLFCLNFTJ
from cb-ladybug.
참조: https://www.golinuxcloud.com/test-ssh-connection/
# cat /tmp/check_connectivity.sh
#!/bin/bash
server=10.10.10.10 # server IP
port=22 # port
connect_timeout=5 # Connection timeout
ssh -q -o BatchMode=yes -o StrictHostKeyChecking=no -o ConnectTimeout=$connect_timeout $server 'exit 0'
if [ $? == 0 ];then
echo "SSH Connection to $server over port $port is possible"
else
echo "SSH connection to $server over port $port is not possible"
fi
from cb-ladybug.
Related Issues (20)
- Read node's Kubernetes labels on each node
- Support user defined disk volume size when creating a cluster or nod HOT 2
- Support user defined ssh public key HOT 1
- Sync a node name on MCKS and Kubernetes
- Delete all namespaces when creating a new namespace in ns-create.sh HOT 1
- What action is needed when failing to delete a cluster HOT 5
- Support kubernetes addon management HOT 1
- Duplicated private-ip problem on multiple regions HOT 4
- HTTP GET Method RFC2731 Compliance Request HOT 3
- Implement API that provides VM specs that can be deployed and operated by CSP HOT 1
- Command-line option enhancement
- Need to cleanup all kubernetes' resources when deleting a cluster
- refactor: create a cluster api structure
- Development Guide for supporting new CSP
- Handling when MCIS status is 'Failed'
- Empty mcis.VMs[*].Namespace/mcisName After mcis.POST() HOT 2
- Fail to add nodes after creating a cluster
- CRI v1 runtime API is not implemented for endpoint HOT 1
- Replace deprecated `set-output` command with environment file
- Add label and description fields in some clusterAPIs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cb-ladybug.