diff --git a/_data/tasks.yml b/_data/tasks.yml index d180badb03..c933e70633 100644 --- a/_data/tasks.yml +++ b/_data/tasks.yml @@ -63,6 +63,7 @@ toc: section: - docs/tasks/access-application-cluster/port-forward-access-application-cluster.md - docs/tasks/access-application-cluster/load-balance-access-application-cluster.md + - docs/tasks/access-application-cluster/connecting-frontend-backend.md - docs/tasks/access-application-cluster/create-external-load-balancer.md - docs/tasks/access-application-cluster/configure-cloud-provider-firewall.md - title: Setting Up and Configuring DNS diff --git a/_data/tutorials.yml b/_data/tutorials.yml index 20618c3a07..1e8ebd5745 100644 --- a/_data/tutorials.yml +++ b/_data/tutorials.yml @@ -46,9 +46,6 @@ toc: section: - docs/tutorials/stateful-application/basic-stateful-set.md - docs/tutorials/stateful-application/zookeeper.md -- title: Connecting Applications - section: - - docs/tutorials/connecting-apps/connecting-frontend-backend.md - title: Clusters section: - docs/tutorials/clusters/apparmor.md diff --git a/docs/tutorials/connecting-apps/connecting-frontend-backend.md b/docs/tasks/access-application-cluster/connecting-frontend-backend.md similarity index 86% rename from docs/tutorials/connecting-apps/connecting-frontend-backend.md rename to docs/tasks/access-application-cluster/connecting-frontend-backend.md index 553017a109..6ba4964e87 100644 --- a/docs/tutorials/connecting-apps/connecting-frontend-backend.md +++ b/docs/tasks/access-application-cluster/connecting-frontend-backend.md @@ -3,11 +3,13 @@ title: Connecting a Front End to a Back End Using a Service redirect_from: - "/docs/user-guide/services/operations/" - "/docs/user-guide/services/operations.html" +- "/docs/tutorials/connecting-apps/connecting-frontend-backend/" +- "/docs/tutorials/connecting-apps/connecting-frontend-backend.html" --- {% capture overview %} -This tutorial shows how to create a frontend and a backend +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. @@ -28,7 +30,7 @@ frontend and backend are connected using a Kubernetes Service object. * {% include task-tutorial-prereqs.md %} -* This tutorial uses +* This task uses [Services with external load balancers](/docs/tasks/access-application-cluster/create-external-load-balancer/), which require a supported environment. If your environment does not support this, you can use a Service of type @@ -44,12 +46,12 @@ frontend and backend are connected using a Kubernetes Service object. The backend is a simple hello greeter microservice. Here is the configuration file for the backend Deployment: -{% include code.html language="yaml" file="hello.yaml" ghlink="/docs/tutorials/connecting-apps/hello.yaml" %} +{% include code.html language="yaml" file="hello.yaml" ghlink="/docs/tasks/access-application-cluster/hello.yaml" %} Create the backend Deployment: ``` -kubectl create -f http://k8s.io/docs/tutorials/connecting-apps/hello.yaml +kubectl create -f http://k8s.io/docs/tasks/access-application-cluster/hello.yaml ``` View information about the backend Deployment: @@ -87,7 +89,7 @@ selector labels to find the Pods that it routes traffic to. First, explore the Service configuration file: -{% include code.html language="yaml" file="hello-service.yaml" ghlink="/docs/tutorials/connecting-apps/hello-service.yaml" %} +{% include code.html language="yaml" file="hello-service.yaml" ghlink="/docs/tasks/access-application-cluster/hello-service.yaml" %} In the configuration file, you can see that the Service routes traffic to Pods that have the labels `app: hello` and `tier: backend`. @@ -95,7 +97,7 @@ that have the labels `app: hello` and `tier: backend`. Create the `hello` Service: ``` -kubectl create -f http://k8s.io/docs/tutorials/connecting-apps/hello-service.yaml +kubectl create -f http://k8s.io/docs/tasks/access-application-cluster/hello-service.yaml ``` At this point, you have a backend Deployment running, and you have a @@ -111,18 +113,18 @@ of the `name` field in the preceding Service configuration file. The Pods in the frontend Deployment run an nginx image that is configured to find the hello backend Service. Here is the nginx configuration file: -{% include code.html file="frontend/frontend.conf" ghlink="/docs/tutorials/connecting-apps/frontend/frontend.conf" %} +{% include code.html file="frontend/frontend.conf" ghlink="/docs/tasks/access-application-cluster/frontend/frontend.conf" %} Similar to the backend, the frontend has a Deployment and a Service. The configuration for the Service has `type: LoadBalancer`, which means that the Service uses the default load balancer of your cloud provider. -{% include code.html language="yaml" file="frontend.yaml" ghlink="/docs/tutorials/connecting-apps/frontend.yaml" %} +{% include code.html language="yaml" file="frontend.yaml" ghlink="/docs/tasks/access-application-cluster/frontend.yaml" %} Create the frontend Deployment and Service: ``` -kubectl create -f http://k8s.io/docs/tutorials/connecting-apps/frontend.yaml +kubectl create -f http://k8s.io/docs/tasks/access-application-cluster/frontend.yaml ``` The output verifies that both resources were created: @@ -133,7 +135,7 @@ service "frontend" created ``` **Note**: The nginx configuration is baked into the -[container image](/docs/tutorials/connecting-apps/frontend/Dockerfile). +[container image](/docs/tasks/access-application-cluster/frontend/Dockerfile). A better way to do this would be to use a [ConfigMap](/docs/tasks/configure-pod-container/configmap/), so that you can change the configuration more easily. diff --git a/docs/tutorials/connecting-apps/frontend.yaml b/docs/tasks/access-application-cluster/frontend.yaml similarity index 100% rename from docs/tutorials/connecting-apps/frontend.yaml rename to docs/tasks/access-application-cluster/frontend.yaml diff --git a/docs/tutorials/connecting-apps/frontend/Dockerfile b/docs/tasks/access-application-cluster/frontend/Dockerfile similarity index 100% rename from docs/tutorials/connecting-apps/frontend/Dockerfile rename to docs/tasks/access-application-cluster/frontend/Dockerfile diff --git a/docs/tutorials/connecting-apps/frontend/frontend.conf b/docs/tasks/access-application-cluster/frontend/frontend.conf similarity index 100% rename from docs/tutorials/connecting-apps/frontend/frontend.conf rename to docs/tasks/access-application-cluster/frontend/frontend.conf diff --git a/docs/tutorials/connecting-apps/hello-service.yaml b/docs/tasks/access-application-cluster/hello-service.yaml similarity index 100% rename from docs/tutorials/connecting-apps/hello-service.yaml rename to docs/tasks/access-application-cluster/hello-service.yaml diff --git a/docs/tutorials/connecting-apps/hello.yaml b/docs/tasks/access-application-cluster/hello.yaml similarity index 100% rename from docs/tutorials/connecting-apps/hello.yaml rename to docs/tasks/access-application-cluster/hello.yaml diff --git a/docs/tutorials/connecting-apps/hello/Dockerfile b/docs/tasks/access-application-cluster/hello/Dockerfile similarity index 100% rename from docs/tutorials/connecting-apps/hello/Dockerfile rename to docs/tasks/access-application-cluster/hello/Dockerfile diff --git a/docs/tutorials/connecting-apps/hello/README b/docs/tasks/access-application-cluster/hello/README similarity index 100% rename from docs/tutorials/connecting-apps/hello/README rename to docs/tasks/access-application-cluster/hello/README diff --git a/docs/tutorials/connecting-apps/hello/main.go b/docs/tasks/access-application-cluster/hello/main.go similarity index 100% rename from docs/tutorials/connecting-apps/hello/main.go rename to docs/tasks/access-application-cluster/hello/main.go