Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ 챕터 5.3 / P331 ] helm 을 이용한 jenkins 설치후 빌드 오류 발생. #32

Closed
osgeum opened this issue Nov 14, 2023 · 8 comments
Assignees
Labels
not issue This will not be worked on

Comments

@osgeum
Copy link

osgeum commented Nov 14, 2023

중요 이슈를 받기 어려운 사항은 다음과 같습니다.

  1. 책에 사용되는 환경 및 기술과 관련된 질문

    또는 책에서 구성한 환경외 조건에서 발생한 이슈

    goto

    1. 쿠버네티스 오픈 채팅: https://open.kakao.com/o/gxSooElb (암호: kubectl)
    2. 쿠버네티스 유저 그룹: https://www.facebook.com/groups/k8skr
  2. 개개인의 환경에 영향을 받는 vagrant 에러(error)와 관련된 이슈

    하지만 다음의 사항에 모두 해당 한다면 이슈를 부탁드립니다.

    • 초기화된(새로 설치) 노트북(또는 PC)
    • 책에서 제시한 프로그램과 동일한 버전 설치
    • 할리스(IP가 겹침)를 제외한 카페 또는 집에서 실행
    • 2대 이상 동일하게 문제가 발생함
  3. 책의 오타형식의 오류
    이와 같은 경우에는 다음의 절차를 따라서 진행

    • 길벗 홈페이지에 접속
    • 고객센터 클릭
    • 1:1문의 접속 후에 오류 및 문의 사항을 제보

위의 사항 외에 이슈라면 가능한 빨리(평균적으로 1일 이내) 회신드리도록 하겠습니다.

[ 내용 ]

도커 이미지 빌드시 오류 내용.
Checking out Revision 5ed2bf9132d6fabf9481ea8f90b1bdddd74490fe (refs/remotes/origin/main)

git config core.sparsecheckout # timeout=10
git checkout -f 5ed2bf9132d6fabf9481ea8f90b1bdddd74490fe # timeout=10
Commit message: "Update README.md"
First time build. Skipping changelog.
[dpy-fs-dir-prod] $ /bin/sh -xe /tmp/jenkins2525911456150578809.sh

  • docker build -t 192.168.1.10:8443/echo-ip .
    /bin/docker: 2: .: Can't open /etc/sysconfig/docker
    Build step 'Execute shell' marked build as failure
    Finished: FAILURE

해결방법
개인 적인 해결 방법

  1. page 331 에서 Add Volume 클릭후 Host Path Volume 아래 내용 추가 ( VM 재시작시 원래 상태로 돌아옮)
    hostPath: "/etc/sysconfig/docker"
    mountPath: "/etc/sysconfig/docker"
  2. jenkins-config.yaml 파일 60 번쨰 라인 이후 아래 내용 추가
  • hostPathVolume:
    hostPath: "/etc/sysconfig/docker"
    mountPath: "/etc/sysconfig/docker"
    개인 github에 수정된 jenkins-config.yaml 커밋후

jenkins-install.sh 파일의 5번 라인 개인 jenkins-config.yaml 파일 커밋된 개인 github 경로 수정후

helm uninstall jenkins 이후 ./jenkins-install.sh 재실행

인프런 질문에도 동일한 에러 문의를 확인 하였고, 저도 동일하게 에러가 발생되어 글남깁니다.
확인 부탁드립니다.

@sysnet4admin
Copy link
Owner

인프런과 책은 플랫폼(쿠버네티스 버전 등)이 다릅니다.
따라서 동일한 결과를 보장하지 않습니다.
책에서 제공하는 버전 그리고 해당 내용을 수행한 후에도 동일한 결과가 나오는지 확인 부탁드립니다.

@sysnet4admin sysnet4admin self-assigned this Nov 14, 2023
@sysnet4admin sysnet4admin added the not issue This will not be worked on label Nov 14, 2023
@osgeum
Copy link
Author

osgeum commented Nov 14, 2023

인프런의 그림으로 배우는 쿠버네티스 수강중이며, 제공해주신 vagrant로 프로비저닝한 VM을 사용중이며
버전은 아래와 같습니다.
[root@m-k8s ~]# k version --short
Client Version: v1.22.0
Server Version: v1.22.17

책 환경 또한 제공해주신 vagrant로 프로비저닝한 VM을 사용을 사용중이며,
버전은 아래와 같습니다.
[root@m-k8s ~]# k version --short
Client Version: v1.18.4
Server Version: v1.18.20

실습은 각각 버전에 맞게 진행을 하고 있습니다. 혹시 다른 분들이 동일 오류를 겪을시 도움이 될까하여 글 남겨 습니다.

좋은 강의 감사합니다.

@sysnet4admin
Copy link
Owner

친절한 안내에 감사드립니다.
내부적으로 해당 사항을 다시 검토 진행해 보고 공유드리겠습니다.

@sysnet4admin
Copy link
Owner

@osgeum
책에서 제공한 구성을 통하면 다음과 같이 구성되며, 이 경우 /etc/sysconfig/docker라는 파일 또는 디렉터리는 존재하지 않습니다.

[ 배포 상태 ]

[root@m-k8s ~]# uptime
 10:00:17 up 20 min,  1 user,  load average: 0.11, 0.25, 0.27
[root@m-k8s ~]# k get nodes
NAME     STATUS   ROLES    AGE     VERSION
m-k8s    Ready    master   16m     v1.18.4
w1-k8s   Ready    <none>   13m     v1.18.4
w2-k8s   Ready    <none>   10m     v1.18.4
w3-k8s   Ready    <none>   7m46s   v1.18.4
[root@m-k8s ~]# ls /etc/sys
sysconfig/          sysctl.conf         sysctl.d/           systemd/            system-release      system-release-cpe  
[root@m-k8s ~]# ls /etc/sysconfig/docker
ls: cannot access /etc/sysconfig/docker: No such file or directory
[root@m-k8s ~]# ls /etc/sysconfig/
anaconda    cbq      console   crond            firewalld  init              iptables-config  kdump   kubelet  modules     network          nfs    readonly-root  rpc-rquotad  rsyslog    selinux  wpa_supplicant
authconfig  chronyd  cpupower  ebtables-config  grub       ip6tables-config  irqbalance       kernel  man-db   netconsole  network-scripts  rdisc  rpcbind        rsyncd       run-parts  sshd
[root@m-k8s ~]# which docker
/usr/bin/docker

또한 /bin/docker에도 특별한 심볼릭 링크도 없습니다.

[root@m-k8s ~]# ls -l /bin/docker
-rwxr-xr-x. 1 root root 75496208 Sep  5  2019 /bin/docker

해당 사항을 재현할 수 있는 정보해 주실 수 있을까요?

@osgeum
Copy link
Author

osgeum commented Nov 15, 2023

저의 책 실습 환경 입니다.
[root@m-k8s ~]# ls ~
anaconda-ks.cfg _Book_k8sInfra
[root@m-k8s ~]# k get node
NAME STATUS ROLES AGE VERSION
m-k8s Ready master 60d v1.18.4
w1-k8s Ready 60d v1.18.4
w2-k8s Ready 60d v1.18.4
w3-k8s Ready 60d v1.18.4
[root@m-k8s ~]# docker --version
Docker version 1.13.1, build 7d71120/1.13.1
[root@m-k8s ~]# ll /etc/sysconfig/docker
-rw-r--r--. 1 root root 1094 Mar 3 2022 /etc/sysconfig/docker
[root@m-k8s ~]# file /etc/sysconfig/docker
/etc/sysconfig/docker: ASCII text

[root@m-k8s ~]# cat /etc/sysconfig/docker
# /etc/sysconfig/docker

# Modify these options if you want to change the way the docker daemon runs
OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false'
if [ -z "${DOCKER_CERT_PATH}" ]; then
    DOCKER_CERT_PATH=/etc/docker
fi

# Do not add registries in this file anymore. Use /etc/containers/registries.conf
# instead. For more information reference the registries.conf(5) man page.

# Location used for temporary files, such as those created by
# docker load and build operations. Default is /var/lib/docker/tmp
# Can be overriden by setting the following environment variable.
# DOCKER_TMPDIR=/var/tmp

# Controls the /etc/cron.daily/docker-logrotate cron job status.
# To disable, uncomment the line below.
# LOGROTATE=false

# docker-latest daemon can be used by starting the docker-latest unitfile.
# To use docker-latest client, uncomment below lines
#DOCKERBINARY=/usr/bin/docker-latest
#DOCKERDBINARY=/usr/bin/dockerd-latest
#DOCKER_CONTAINERD_BINARY=/usr/bin/docker-containerd-latest
#DOCKER_CONTAINERD_SHIM_BINARY=/usr/bin/docker-containerd-shim-latest

재현은 책 Page 303 ~ 쭉 실행하면서 Page 341 젠킨스 Freestyle project 설정, Page 344 Build Now 버튼 클릭후 빌드 실패,
P345 의 Console Ouput 클릭시 인프런 사이트에 다른분이 올려 주신 오류 화면이 저도 동일하게 발생 되었습니다.
https://www.inflearn.com/questions/1022900/jenkins-%EB%B9%8C%EB%93%9C-%EC%A4%91-%EB%B0%9C%EC%83%9D%ED%95%9C-%EC%98%A4%EB%A5%98

@sysnet4admin
Copy link
Owner

sysnet4admin commented Nov 15, 2023

참고
Docker multistage build 성공

[root@m-k8s 4.3.4]# docker build -t multistage-img .
Sending build context to Docker daemon  11.26kB
Step 1/12 : FROM openjdk:8 AS int-build
8: Pulling from library/openjdk
001c52e26ad5: Pull complete 
d9d4b9b6e964: Pull complete 
2068746827ec: Pull complete 
9daef329d350: Pull complete 
d85151f15b66: Pull complete 
52a8c426d30b: Pull complete 
8754a66e0050: Pull complete 
Digest: sha256:86e863cc57215cfb181bd319736d0baf625fe8f150577f9eb58bd937f5452cb8
Status: Downloaded newer image for openjdk:8

젠킨스 FreeStyle 성공


그리고 같은 분이 나오신 것도 중요한 UX 관점의 내용이겠지만...

현재 책은 순서대로 따라가게 되어 있습니다.
Ch4/4.3.4에 멀티스테이지 빌드를 위해서 전체 랩 환경을 업데이트하게 구성되어 있습니다.
해당 부분을 진행하시지 않은 것 같습니다.

Ch5를 진행할 때의 도커 버전은 다음과 같습니다.

[root@m-k8s 4.3.4]# docker version 
Client:
 Version:           18.09.9
 API version:       1.39
 Go version:        go1.11.13
 Git commit:        039a7df9ba
 Built:             Wed Sep  4 16:51:21 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.9
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.11.13
  Git commit:       039a7df
  Built:            Wed Sep  4 16:22:32 2019
  OS/Arch:          linux/amd64
  Experimental:     false

@sysnet4admin sysnet4admin pinned this issue Nov 15, 2023
@osgeum
Copy link
Author

osgeum commented Nov 15, 2023

아 그렇네요. 제가 그 부분을 건너 띄고 수행을 했네요.
저의 실수 였네요. 바쁘신데 확인 감사합니다^^

@osgeum osgeum closed this as completed Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not issue This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants