brunch

You can make anything
by writing

C.S.Lewis

by Master Seo Mar 08. 2022

 쿠버3탄- 2. quake 게임

<1> 노트북에 쿠버네티스 실습 환경 구축하기

<2> 쿠버네티스에 서비스 올리기

<3> 사용하기

<4> 삭제 하기





<1> 노트북에 쿠버네티스 실습 환경 구축하기

<2> 쿠버네티스에 서비스 올리기

<3> 사용하기

<4> 삭제 하기




<1> 노트북에 쿠버네티스 실습 환경 구축하기


https://brunch.co.kr/@topasvga/1682



<2> 쿠버네티스에 서비스 올리기


cat <<EOF | kubectl create -f -

apiVersion: apps/v1

kind: Deployment

metadata:

  name: quake

:

:

EOF




deployment.apps/quake created

service/quake created

configmap/quake3-server-config created


2

kubectl get deploy,svc quake

(admin-k8s:default) root@k8s-m:~# kubectl get deploy,svc quake

NAME                    READY   UP-TO-DATE   AVAILABLE   AGE

deployment.apps/quake   0/1     1            0           21s

NAME            TYPE       CLUSTER-IP     EXTERNAL-IP   PORT(S)                                         AGE

service/quake   NodePort   10.97.51.237   <none>        8080:31252/TCP,27960:31364/TCP,9090:32141/TCP   21s

(admin-k8s:default) root@k8s-m:~#


# 게임파드가 배포된 노드의 IP 확인

QNAME=$(kubectl get pod -l run=quake -o jsonpath='{.items[0].metadata.name}')

QNODE=$(kubectl get pod $QNAME -o jsonpath={.spec.nodeName})

QNODEIP=$(kubectl get node $QNODE -o jsonpath={.status.addresses[0].address})


# 게임 접속하기 위한 NodePort

QPORT=$(kubectl get service quake -o jsonpath='{.spec.ports[0].nodePort}')


# 게임 접속 웹 URL 접속 확인

echo -e "Quake3 Game Web URL = http://$QNODEIP:$QPORT"

(admin-k8s:default) root@k8s-m:~# echo -e "Quake3 Game Web URL = http://$QNODEIP:$QPORT"

Quake3 Game Web URL = http://192.168.100.102:31252





<3> 사용하기


접속

http://192.168.100.102:31252/

NodePort 웹 접속(http) → 화살표키, CTRL키 , ALT키, Space키




<4> 삭제 하기


kubectl delete deploy,svc quake



https://brunch.co.kr/@topasvga/1656



참고 자료


https://gasidaseo.notion.site/MSA-12-382799b72d5d49a9a15dcafd123c1aa8


https://hub.docker.com/r/criticalstack/quake



https://www.slideshare.net/openstack_kr/openinfra-days-korea-2018-track-4-provisioning-dedicated-game-server-on-kubernetes-cluster



감사합니다.






        

매거진의 이전글 쿠버3탄-1. 채팅 서비스

작품 선택

키워드 선택 0 / 3 0

댓글여부

afliean
브런치는 최신 브라우저에 최적화 되어있습니다. IE chrome safari