ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 노드 포트 실습
    kubernetes 2023. 11. 1. 15:01

    문제1) consol/tomcat-7.0 이미지를 사용해 톰캣 디플로이먼트 배포하기

    문제2) tomcat을 너드포트로 서비스하기(30003번 포트 사용)

    문제3) tomcat을 로드밸런스로 서비스하기(80번 포트 사용)

     

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      creationTimestamp: null
      labels:
        app: tomcat
      name: tomcat
    spec:
      replicas: 10
      selector:
        matchLabels:
          app: tomcat
      strategy: {}
      template:
        metadata:
          creationTimestamp: null
          labels:
            app: tomcat
        spec:
          containers:
          - image: consol/tomcat-7.0
            name: tomcat
            ports:
            - containerPort: 8080
            resources: {}
    status: {}
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: tomcat-np
    spec:
      type: NodePort
      selector:
        app: tomcat
      ports:
        - port: 80
          targetPort: 8080
          nodePort: 30003
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: tomcat-lp
    spec:
      type: LoadBalancer
      selector:
        app: tomcat
      ports:
        - port: 80
          targetPort: 8080

     



    설치 확인

     

     

    노드포트 확인

     

     

    로드밸런스 확인

    'kubernetes' 카테고리의 다른 글

    서비스 노드 포트  (0) 2023.11.01
    mysql db 인중화  (0) 2023.10.31
    서비스 endpoints  (0) 2023.10.31
    서비스  (0) 2023.10.31
    버번패치 실습  (0) 2023.10.30
Designed by Tistory.