Service 개요
Service Manifest
Service 실습
ClusterIP (default)
NodePort
LoadBalancer
nginx-svc-lb.yaml
apiVersion: v1 kind: Service metadata: labels: app: myapp-svc type: front-end name: nginx-svc-lb spec: type: LoadBalancer ports: - port: 80 protocol: TCP targetPort: 80 selector: type: front-end
sansae@sansaeAir15m2 k8s-lab-workspace % k apply -f nginx-svc-lb.yaml service/nginx-svc-lb created sansae@sansaeAir15m2 k8s-lab-workspace % k get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes ClusterIP 10.0.0.1 <none> 443/TCP 29h nginx-svc ClusterIP 10.0.133.111 <none> 80/TCP 5h50m nginx-svc-lb LoadBalancer 10.0.69.70 <pending> 80:32050/TCP 5s nginx-svc-nodeport NodePort 10.0.159.138 <none> 80:30008/TCP 11m sansae@sansaeAir15m2 k8s-lab-workspace % k get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes ClusterIP 10.0.0.1 <none> 443/TCP 29h nginx-svc ClusterIP 10.0.133.111 <none> 80/TCP 5h50m nginx-svc-lb LoadBalancer 10.0.69.70 20.249.176.154 80:32050/TCP 18s nginx-svc-nodeport NodePort 10.0.159.138 <none> 80:30008/TCP 11m sansae@sansaeAir15m2 k8s-lab-workspace %
LoadBalancer Type의 Service가 생성한 EXTERNAL-IP로 호출 확인
Azure Cloud Native LoadBalancer확인
2 Comments
Anonymous
Anonymous