Several ways to kubernetes external access

Source: Internet
Author: User

Tag: data adb supports using the log Web to restrict class load

1: The most used is Nodeport, the following Nginx service, the type is set to Nodeport, while Nodeport is set to 30010 (k8s in order not to conflict with the host port, the default limit of 30000 ports below)

This allows access to Nginx via any node ip+30010

apiVersion:v1kind:Servicemetadata:  name:my-nginx  Labels:    run:my-Nginxspec:  Ports:   -port:80    protocol:tcp    30010  type:nodeport  selector:    run:my-nginx

2:loadbalancer mode, only cloud provider support is available. The same type can be set

3:hostport, access to the host ip+8081 port, but only one pod per unit, otherwise the port will conflict, there is no service load June very

apiVersion:v1kind:Podmetadata:  name:webapp  Labels:    app:webappspec  : Containers:- name:webapp    image:kubeguide/tomcat-app:v2    ports:    -containerport:8080       8081

Several ways to kubernetes external access

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.