1.Start build and save the container image 2.Deploy the application and expose the service
We will define and apply a deployment configuration (yaml) to create a Pod with our Microservice We will define a service which routes requests to the Pod with our Microservice
cloud-native-starter/authors-java-jee
REMEMBER: You should know this from the prerequisites.
$ROOT_FOLDER/authors-java-jee
)[YOUR_REGISTRY] = us.icr.io
[YOUR_REGISTRY_NAMESPACE] = cloud-native-suedbro
us.icr.io/cloud-native-suedbro/authors
and save it somewhere, we need this later in the deployment.yaml
configuration.A Pod is the basic building block of Kubernetes-the smallest and simplest unit in the Kubernetes object model that you create or deploy. A Pod represents processes running on your Cluster .
kind
defines this as a Deployment
configuration.spec
section we specify an app name and version label.name
for the container and we provide the container image
location, e.g. where the container can be found in the Container Registry.containerPort
depends on the port definition inside our Dockerfile and in our server.xml.livenessProbe
definition.$ROOT_FOLDER/authors-java-jee/deployment
../authors-java-jee/deployment/deployment.yaml
file with a editor and replace the value for the container image location with the path we got from the IBM Container Registry and just replace the authors:1
text, and add following statement imagePullPolicy: Always
and save the file.imagePullPolicy: Always
we force that the image is pulled from the IBM Cloud Container Registry and not cashed image in Kubernetes is possible used, when we change our container image IBM Cloud Container Registry.A Kubernetes Service is an abstraction which defines a logical set of Pods and a policy by which to access them - sometimes called a micro-service. The set of Pods targeted by a Service is (usually) determined by a Label Selector.
$ROOT_FOLDER/authors-java-jee/deployment
Expose a public port on your worker node and use the public IP address of the worker node to access your service in the cluster publicly from the internet.