NodePort란?

오른쪽 하단에 위치한 외부의 End user가 접속 할 수 있도록 worker node에 port를 열어주는 역할

kubectl config use-context k8s로 설정하십시오.app: webui 포드 선택자를 가진 nginx 포드에 대해 포트 32767로 유형이 NodePort인 서비스를 생성하십시오.apiVersion: v1
kind: Service
metadata:
name: my-service(임의로 지정하면 됌)
spec:
type: NodePort
selector:
app.kubernetes.io/name: MyApp
ports:
-port: 80
# By default and for convenience, the `targetPort` is set to
# the same value as the `port` field.
targetPort: 80
# Optional field
# By default and for convenience, the Kubernetes control plane
# will allocate a port from a range (default: 30000-32767)
nodePort: 30007
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
type: NodePort
selector:
app: webui
ports:
-port: 80
targetPort: 80
nodePort: 32767
⇒ 문제에 주어진 대로 값 변경