From 63861f4e8819e9d742843c4990fbc1384ffb03f7 Mon Sep 17 00:00:00 2001 From: Tim Bannister Date: Thu, 28 Feb 2019 05:11:22 +0000 Subject: [PATCH] =?UTF-8?q?Reference=20glossary=20definitions=20in=20?= =?UTF-8?q?=E2=80=9CConnect=20a=20Front=20End=20to=20a=20Back=20End=20Usin?= =?UTF-8?q?g=20a=20Service=E2=80=9D=20=20(#12706)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Reference terms in glossary * Enable syntax highlighting for shell snippets --- .../connecting-frontend-backend.md | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/content/en/docs/tasks/access-application-cluster/connecting-frontend-backend.md b/content/en/docs/tasks/access-application-cluster/connecting-frontend-backend.md index 0033f51c9b28c..c35dd3571b4d6 100644 --- a/content/en/docs/tasks/access-application-cluster/connecting-frontend-backend.md +++ b/content/en/docs/tasks/access-application-cluster/connecting-frontend-backend.md @@ -8,14 +8,15 @@ weight: 70 This task shows how to create a frontend and a backend microservice. The backend microservice is a hello greeter. The -frontend and backend are connected using a Kubernetes Service object. +frontend and backend are connected using a Kubernetes +{{< glossary_tooltip term_id="service" >}} object. {{% /capture %}} {{% capture objectives %}} -* Create and run a microservice using a Deployment object. +* Create and run a microservice using a {{< glossary_tooltip term_id="deployment" >}} object. * Route traffic to the backend using a frontend. * Use a Service object to connect the frontend application to the backend application. @@ -47,13 +48,13 @@ file for the backend Deployment: Create the backend Deployment: -``` +```shell kubectl create -f https://k8s.io/examples/service/access/hello.yaml ``` View information about the backend Deployment: -``` +```shell kubectl describe deployment hello ``` @@ -99,7 +100,8 @@ Events: The key to connecting a frontend to a backend is the backend Service. A Service creates a persistent IP address and DNS name entry so that the backend microservice can always be reached. A Service uses -selector labels to find the Pods that it routes traffic to. +{{< glossary_tooltip text="selectors" term_id="selector" >}} to find +the Pods that it routes traffic to. First, explore the Service configuration file: @@ -110,7 +112,7 @@ that have the labels `app: hello` and `tier: backend`. Create the `hello` Service: -``` +```shell kubectl create -f https://k8s.io/examples/service/access/hello-service.yaml ``` @@ -137,7 +139,7 @@ the Service uses the default load balancer of your cloud provider. Create the frontend Deployment and Service: -``` +```shell kubectl create -f https://k8s.io/examples/service/access/frontend.yaml ``` @@ -161,7 +163,7 @@ so that you can change the configuration more easily. Once you’ve created a Service of type LoadBalancer, you can use this command to find the external IP: -``` +```shell kubectl get service frontend --watch ``` @@ -189,8 +191,8 @@ cluster. The frontend and backends are now connected. You can hit the endpoint by using the curl command on the external IP of your frontend Service. -``` -curl http:// +```shell +curl http://${EXTERNAL_IP} # replace this with the EXTERNAL-IP you saw earlier ``` The output shows the message generated by the backend: