Kubernetes

김덕근·2023년 5월 26일
0

Kubernetes

목록 보기
1/1

Kubernetes

Docker 설정에서 Kubernetes 선택 후
Enable Kubernetes (check) -> Apply & restart (button)

KubeTestWeb폴더 생성
Dockerfile.txt 생성
FROM tomcat:9.0.75-jdk11
WORKDIR /usr/local/tomcat/webapps
RUN mkdir ./ROOT
ADD index.jsp ./ROOT
ENV TZ=Asia/Seoul
EXPOSE 8080
CMD ["catalina.sh","run"]

index.jsp생성
<%@ page language="java" import="java.net.InetAddress" %>
<% InetAddress inet = InetAddress.getLocalHost(); %>
<h1>TEST WEB v1</h1>
Server IP Address : <%=inet.getHostAddress()%>

docker build . -f Dockerfile.txt -t testweb:1.0
http://localhost:30000
docker run -d --name tweb1 -p 30000:8080 testweb:1.0

kubectl run kuweb1 --image=testweb:1.0 --port=8080
kubectl get pods
kubectl get pods -o wide
kubectl describe pods
kubectl exec kuweb1 -- pwd  현재 작업경로 보여줌

kubectl run -it kuserver --image=centos:7
yum -y install curl
profile
안녕하세요!

0개의 댓글