JINIers
pod 연습 본문
1. 모든 리소스 삭제
kubectl delete all --all
2. yaml 파일 이용 jenkins-manual pod 생성
# jenkins-manual-pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: jenkins-manual
spec:
containers:
- name: jenkins
image: jenkins/jenkins:lts
# image: jenkins 하니까 errimagepull이 떠서 버전명을 지정
ports:
- containerPort: 8080
pod 생성
kubectl create -f jenkins-manual-pod.yaml
3. jenkins pod에서 curl 명령어로 localhost:8080 접속
kubectl exec jenkins-manual -- curl 127.0.0.1:8080 -s
4. 포트 포워딩(→ 8888)
kubectl port-forward jenkins-manual 8888:8080
후 사이트로 접속(127.0.0.1:8888)
jenkins password 확인하기
kubectl logs jenkins-manuals
5. 현재 jenkins-manual 설정을 yaml로 출력
kubectl get pod jenkins-manual -o yaml
끗
'공부 > Docker&K8S' 카테고리의 다른 글
liveness pod (0) | 2023.02.20 |
---|---|
Probes(Liveness, Readiness, Startup) (0) | 2023.02.20 |
POD (0) | 2023.02.17 |
GKE와 온프레미스 차이 (0) | 2023.02.16 |
pod scale (0) | 2023.02.16 |
Comments