Kubernetes Creating a Tomcat container

Source: Internet
Author: User

Not tested

Kubectl Run Tomcat-hui--image=tomcat7--replicas=2

1. Create Tomcat.yaml

Tomcat.yaml


 apiversion:extensions/v1beta1 
kind:daemonset
metadata:
Name:tomcat-ds
spec:
Template:
App:tomcat
Span class= "line" > Spec:
containers:
-Name:tomcat
Image:tomcat:8.0. 30-jre8
ports:
-Containerport: 8080


2. Create
-F Tomcat.yaml



Other:

If it is used internally, then you can not set the type of service (default is Clusterip), otherwise, the service type can be set to Nodeport, through the port of node exposed to external use;
Or LoadBalancer, the cloud service provider provides a load balancer that hangs directly on the services. Here we use Nodeport, exposing 30088 ports for external use.
If you do not specify a nodeport, then kubernetes randomly generates one.



Kubernetes Creating a Tomcat container

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.