Skip to content

Commit a8d8313

Browse files
authored
Merge pull request #23017 from tengqm/links-tasks-2
Tune links in tasks section (2/2)
2 parents 8cb1149 + 92ae1a9 commit a8d8313

29 files changed

+379
-372
lines changed

content/en/docs/tasks/access-application-cluster/access-cluster.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ content_type: concept
88

99
This topic discusses multiple ways to interact with clusters.
1010

11-
12-
13-
1411
<!-- body -->
1512

1613
## Accessing for the first time with kubectl
@@ -29,8 +26,9 @@ Check the location and credentials that kubectl knows about with this command:
2926
kubectl config view
3027
```
3128

32-
Many of the [examples](/docs/user-guide/kubectl-cheatsheet) provide an introduction to using
33-
kubectl and complete documentation is found in the [kubectl manual](/docs/user-guide/kubectl-overview).
29+
Many of the [examples](/docs/reference/kubectl/cheatsheet/) provide an introduction to using
30+
kubectl and complete documentation is found in the
31+
[kubectl manual](/docs/reference/kubectl/overview/).
3432

3533
## Directly accessing the REST API
3634

@@ -165,7 +163,7 @@ client libraries.
165163
* To get the library, run the following command: `go get k8s.io/client-go@kubernetes-<kubernetes-version-number>`, see [INSTALL.md](https://github.com/kubernetes/client-go/blob/master/INSTALL.md#for-the-casual-user) for detailed installation instructions. See [https://github.com/kubernetes/client-go](https://github.com/kubernetes/client-go#compatibility-matrix) to see which versions are supported.
166164
* Write an application atop of the client-go clients. Note that client-go defines its own API objects, so if needed, please import API definitions from client-go rather than from the main repository, e.g., `import "k8s.io/client-go/kubernetes"` is correct.
167165

168-
The Go client can use the same [kubeconfig file](/docs/concepts/cluster-administration/authenticate-across-clusters-kubeconfig/)
166+
The Go client can use the same [kubeconfig file](/docs/concepts/configuration/organize-cluster-access-kubeconfig/)
169167
as the kubectl CLI does to locate and authenticate to the apiserver. See this [example](https://git.k8s.io/client-go/examples/out-of-cluster-client-configuration/main.go).
170168

171169
If the application is deployed as a Pod in the cluster, please refer to the [next section](#accessing-the-api-from-a-pod).
@@ -174,7 +172,7 @@ If the application is deployed as a Pod in the cluster, please refer to the [nex
174172

175173
To use [Python client](https://github.com/kubernetes-client/python), run the following command: `pip install kubernetes`. See [Python Client Library page](https://github.com/kubernetes-client/python) for more installation options.
176174

177-
The Python client can use the same [kubeconfig file](/docs/concepts/cluster-administration/authenticate-across-clusters-kubeconfig/)
175+
The Python client can use the same [kubeconfig file](/docs/concepts/configuration/organize-cluster-access-kubeconfig/)
178176
as the kubectl CLI does to locate and authenticate to the apiserver. See this [example](https://github.com/kubernetes-client/python/tree/master/examples).
179177

180178
### Other languages
@@ -219,7 +217,9 @@ In each case, the credentials of the pod are used to communicate securely with t
219217

220218
The previous section was about connecting the Kubernetes API server. This section is about
221219
connecting to other services running on Kubernetes cluster. In Kubernetes, the
222-
[nodes](/docs/admin/node), [pods](/docs/user-guide/pods) and [services](/docs/user-guide/services) all have
220+
[nodes](/docs/concepts/architecture/nodes/),
221+
[pods](/docs/concepts/workloads/pods/) and
222+
[services](/docs/concepts/services-networking/service/) all have
223223
their own IPs. In many cases, the node IPs, pod IPs, and some service IPs on a cluster will not be
224224
routable, so they will not be reachable from a machine outside the cluster,
225225
such as your desktop machine.
@@ -230,7 +230,7 @@ You have several options for connecting to nodes, pods and services from outside
230230

231231
- Access services through public IPs.
232232
- Use a service with type `NodePort` or `LoadBalancer` to make the service reachable outside
233-
the cluster. See the [services](/docs/user-guide/services) and
233+
the cluster. See the [services](/docs/concepts/services-networking/service/) and
234234
[kubectl expose](/docs/reference/generated/kubectl/kubectl-commands/#expose) documentation.
235235
- Depending on your cluster environment, this may just expose the service to your corporate network,
236236
or it may expose it to the internet. Think about whether the service being exposed is secure.

content/en/docs/tasks/access-application-cluster/communicate-containers-same-pod-shared-volume.md

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,14 @@ weight: 110
77
<!-- overview -->
88

99
This page shows how to use a Volume to communicate between two Containers running
10-
in the same Pod. See also how to allow processes to communicate by [sharing process namespace](/docs/tasks/configure-pod-container/share-process-namespace/) between containers.
11-
12-
13-
10+
in the same Pod. See also how to allow processes to communicate by
11+
[sharing process namespace](/docs/tasks/configure-pod-container/share-process-namespace/)
12+
between containers.
1413

1514
## {{% heading "prerequisites" %}}
1615

17-
1816
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
1917

20-
21-
22-
2318
<!-- steps -->
2419

2520
## Creating a Pod that runs two Containers
@@ -103,14 +98,15 @@ The output is similar to this:
10398
Recall that the debian Container created the `index.html` file in the nginx root
10499
directory. Use `curl` to send a GET request to the nginx server:
105100

106-
root@two-containers:/# curl localhost
101+
```
102+
root@two-containers:/# curl localhost
103+
```
107104

108105
The output shows that nginx serves a web page written by the debian container:
109106

110-
Hello from the debian container
111-
112-
113-
107+
```
108+
Hello from the debian container
109+
```
114110

115111
<!-- discussion -->
116112

@@ -128,28 +124,18 @@ The Volume in this exercise provides a way for Containers to communicate during
128124
the life of the Pod. If the Pod is deleted and recreated, any data stored in
129125
the shared Volume is lost.
130126

131-
132-
133-
134127
## {{% heading "whatsnext" %}}
135128

136129

137-
* Learn more about
138-
[patterns for composite containers](https://kubernetes.io/blog/2015/06/the-distributed-system-toolkit-patterns).
130+
* Learn more about [patterns for composite containers](https://kubernetes.io/blog/2015/06/the-distributed-system-toolkit-patterns).
139131

140-
* Learn about
141-
[composite containers for modular architecture](http://www.slideshare.net/Docker/slideshare-burns).
132+
* Learn about [composite containers for modular architecture](https://www.slideshare.net/Docker/slideshare-burns).
142133

143-
* See
144-
[Configuring a Pod to Use a Volume for Storage](/docs/tasks/configure-pod-container/configure-volume-storage/).
134+
* See [Configuring a Pod to Use a Volume for Storage](/docs/tasks/configure-pod-container/configure-volume-storage/).
145135

146136
* See [Configure a Pod to share process namespace between containers in a Pod](/docs/tasks/configure-pod-container/share-process-namespace/)
147137

148138
* See [Volume](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#volume-v1-core).
149139

150140
* See [Pod](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#pod-v1-core).
151141

152-
153-
154-
155-

content/en/docs/tasks/access-application-cluster/connecting-frontend-backend.md

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,21 @@ microservice. The backend microservice is a hello greeter. The
1111
frontend and backend are connected using a Kubernetes
1212
{{< glossary_tooltip term_id="service" >}} object.
1313

14-
15-
16-
1714
## {{% heading "objectives" %}}
1815

19-
2016
* Create and run a microservice using a {{< glossary_tooltip term_id="deployment" >}} object.
2117
* Route traffic to the backend using a frontend.
2218
* Use a Service object to connect the frontend application to the
2319
backend application.
2420

25-
26-
27-
2821
## {{% heading "prerequisites" %}}
2922

23+
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
3024

31-
* {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
32-
33-
* This task uses
34-
[Services with external load balancers](/docs/tasks/access-application-cluster/create-external-load-balancer/), which
35-
require a supported environment. If your environment does not
36-
support this, you can use a Service of type
37-
[NodePort](/docs/concepts/services-networking/service/#nodeport) instead.
38-
39-
40-
25+
This task uses
26+
[Services with external load balancers](/docs/tasks/access-application-cluster/create-external-load-balancer/), which
27+
require a supported environment. If your environment does not support this, you can use a Service of type
28+
[NodePort](/docs/concepts/services-networking/service/#nodeport) instead.
4129

4230
<!-- lessoncontent -->
4331

@@ -153,8 +141,8 @@ service/frontend created
153141
```
154142

155143
{{< note >}}
156-
The nginx configuration is baked into the [container
157-
image](/examples/service/access/Dockerfile). A better way to do this would
144+
The nginx configuration is baked into the
145+
[container image](/examples/service/access/Dockerfile). A better way to do this would
158146
be to use a
159147
[ConfigMap](/docs/tasks/configure-pod-container/configure-pod-configmap/),
160148
so that you can change the configuration more easily.
@@ -203,27 +191,22 @@ The output shows the message generated by the backend:
203191
{"message":"Hello"}
204192
```
205193

206-
207-
208194
## {{% heading "cleanup" %}}
209195

210-
211196
To delete the Services, enter this command:
212197

213-
kubectl delete services frontend hello
198+
```shell
199+
kubectl delete services frontend hello
200+
```
214201

215202
To delete the Deployments, the ReplicaSets and the Pods that are running the backend and frontend applications, enter this command:
216203

217-
kubectl delete deployment frontend hello
218-
219-
204+
```shell
205+
kubectl delete deployment frontend hello
206+
```
220207

221208
## {{% heading "whatsnext" %}}
222209

223-
224210
* Learn more about [Services](/docs/concepts/services-networking/service/)
225211
* Learn more about [ConfigMaps](/docs/tasks/configure-pod-container/configure-pod-configmap/)
226212

227-
228-
229-

content/en/docs/tasks/access-application-cluster/list-all-running-container-images.md

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@ weight: 100
99
This page shows how to use kubectl to list all of the Container images
1010
for Pods running in a cluster.
1111

12-
13-
1412
## {{% heading "prerequisites" %}}
1513

16-
1714
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
1815

19-
20-
2116
<!-- steps -->
2217

2318
In this exercise you will use kubectl to fetch all of the Pods
@@ -30,14 +25,14 @@ of Containers for each.
3025
- Format the output to include only the list of Container image names
3126
using `-o jsonpath={..image}`. This will recursively parse out the
3227
`image` field from the returned json.
33-
- See the [jsonpath reference](/docs/user-guide/jsonpath/)
28+
- See the [jsonpath reference](/docs/reference/kubectl/jsonpath/)
3429
for further information on how to use jsonpath.
3530
- Format the output using standard tools: `tr`, `sort`, `uniq`
3631
- Use `tr` to replace spaces with newlines
3732
- Use `sort` to sort the results
3833
- Use `uniq` to aggregate image counts
3934

40-
```sh
35+
```shell
4136
kubectl get pods --all-namespaces -o jsonpath="{..image}" |\
4237
tr -s '[[:space:]]' '\n' |\
4338
sort |\
@@ -52,7 +47,7 @@ field within the Pod. This ensures the correct field is retrieved
5247
even when the field name is repeated,
5348
e.g. many fields are called `name` within a given item:
5449

55-
```sh
50+
```shell
5651
kubectl get pods --all-namespaces -o jsonpath="{.items[*].spec.containers[*].image}"
5752
```
5853

@@ -74,7 +69,7 @@ Pod is returned instead of a list of items.
7469
The formatting can be controlled further by using the `range` operation to
7570
iterate over elements individually.
7671

77-
```sh
72+
```shell
7873
kubectl get pods --all-namespaces -o=jsonpath='{range .items[*]}{"\n"}{.metadata.name}{":\t"}{range .spec.containers[*]}{.image}{", "}{end}{end}' |\
7974
sort
8075
```
@@ -84,7 +79,7 @@ sort
8479
To target only Pods matching a specific label, use the -l flag. The
8580
following matches only Pods with labels matching `app=nginx`.
8681

87-
```sh
82+
```shell
8883
kubectl get pods --all-namespaces -o=jsonpath="{..image}" -l app=nginx
8984
```
9085

@@ -93,7 +88,7 @@ kubectl get pods --all-namespaces -o=jsonpath="{..image}" -l app=nginx
9388
To target only pods in a specific namespace, use the namespace flag. The
9489
following matches only Pods in the `kube-system` namespace.
9590

96-
```sh
91+
```shell
9792
kubectl get pods --namespace kube-system -o jsonpath="{..image}"
9893
```
9994

@@ -102,27 +97,14 @@ kubectl get pods --namespace kube-system -o jsonpath="{..image}"
10297
As an alternative to jsonpath, Kubectl supports using [go-templates](https://golang.org/pkg/text/template/)
10398
for formatting the output:
10499

105-
106-
```sh
100+
```shell
107101
kubectl get pods --all-namespaces -o go-template --template="{{range .items}}{{range .spec.containers}}{{.image}} {{end}}{{end}}"
108102
```
109103

110-
111-
112-
113-
114-
<!-- discussion -->
115-
116-
117-
118104
## {{% heading "whatsnext" %}}
119105

120-
121106
### Reference
122107

123-
* [Jsonpath](/docs/user-guide/jsonpath/) reference guide
108+
* [Jsonpath](/docs/reference/kubectl/jsonpath/) reference guide
124109
* [Go template](https://golang.org/pkg/text/template/) reference guide
125110

126-
127-
128-

0 commit comments

Comments
 (0)