Kubernetes 기초 (12) - NodePort 실습

이것저것 개발자·2023년 4월 3일
0

kubernetes 기초

목록 보기
12/16
post-custom-banner

Service - Order

apiVersion: v1
kind: Service
metadata:
  name: order
  namespace: snackbar
  labels:
    service: order
    project: snackbar
spec:
  type: NodePort
  selector:
    service: order
    project: snackbar
  ports:
    - port: 80
      targetPort: 8080

Service - Payment

apiVersion: v1
kind: Service
metadata:
  name: payment
  namespace: snackbar
  labels:
    service: payment
    project: snackbar
spec:
  type: ClusterIP
  selector:
    service: payment
    project: snackbar
  ports:
    - port: 80
      targetPort: 8080

Deployment는 11강과 동일


order, payment Servcie 리소스 상세 조회

kubectl get svc -l project=snackbar -n snackbar -o wide

외부에서 NodePort로 방화벽 해제 설정

- GCP
gcloud compute firewall-rules create <name> --allow tcp:<port>
profile
조호영, Developing something
post-custom-banner

0개의 댓글