Create a service named ads-app-service:

Each field in the yamL file of the Service is specified in Kubernetes API documentation.

Kubernetes. IO/docs/refere…

How do I find this URL?

Reference – > API Reference – > v1.12:

For example, the fields required to appear in the Spec field of the Service YAML file are specified in the help documentation:

The ports subregion of the Spec section can define multiple ports, representing an array-like structure with the “-” symbol:

The ports array contains fields for each element:

  • name
  • nodePort
  • port
  • protocol
  • targetPort

Create the service with kubectl create -f. Because the type is set to ClusterIP, but no specific IP address is specified, one is automatically generated when the service is created.

Create another Deployment:

This deployment uses the image address as follows:

We also need to create a Kubernetes Ingress, yaml file like this:

The Ingress is required because, in general, the IP of the Service and pod are only accessible within the Kubernetes cluster. Requests from outside the cluster need to be load-balanced to the NodePort exposed by the service on the Node, and then forwarded to the relevant kube-proxy

Pod.

Ingress, as one of the standard objects in Kubernetes, is responsible for providing services with urls for external cluster access, load balancing, SSL termination, HTTP routing, and so on.

Every time an AD request is made, the request is forwarded to adS-app-service.

To access this application, concatenate /ads with the url contained in host:

Click tile to go to the details page:

The application uses the SAP UI5 framework for its UI display, responds to HTTP requests via a SpringBoot application in the background, and stores data in PostgreSQL.

Enter the pod corresponding to Deployment and you can see the JAR file and JDK environment corresponding to the Java application.

For more of Jerry’s original articles, please follow the public account “Wang Zixi “: