Skip to content

Commit e2118a7

Browse files
steveperry-53k8s-ci-robot
authored andcommitted
Move files out of old user-guide directory. (#7384)
1 parent ef265d7 commit e2118a7

File tree

6 files changed

+22
-57
lines changed

6 files changed

+22
-57
lines changed

docs/concepts/cluster-administration/manage-deployment.md

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,19 @@ title: Managing Resources
88

99
You've deployed your application and exposed it via a service. Now what? Kubernetes provides a number of tools to help you manage your application deployment, including scaling and updating. Among the features that we will discuss in more depth are [configuration files](/docs/concepts/configuration/overview/) and [labels](/docs/concepts/overview/working-with-objects/labels/).
1010

11-
You can find all the files for this example [in our docs
12-
repo here](https://github.com/kubernetes/website/tree/{{page.docsbranch}}/docs/user-guide/).
13-
1411
* TOC
1512
{:toc}
1613

1714
## Organizing resource configurations
1815

1916
Many applications require multiple resources to be created, such as a Deployment and a Service. Management of multiple resources can be simplified by grouping them together in the same file (separated by `---` in YAML). For example:
2017

21-
{% include code.html language="yaml" file="nginx-app.yaml" ghlink="/docs/user-guide/nginx-app.yaml" %}
18+
{% include code.html language="yaml" file="nginx-app.yaml" ghlink="/docs/concepts/cluster-administration/nginx-app.yaml" %}
2219

2320
Multiple resources can be created the same way as a single resource:
2421

2522
```shell
26-
$ kubectl create -f docs/user-guide/nginx-app.yaml
23+
$ kubectl create -f https://k8s.io/docs/concepts/cluster-administration/nginx-app.yaml
2724
service "my-nginx-svc" created
2825
deployment "my-nginx" created
2926
```
@@ -33,13 +30,13 @@ The resources will be created in the order they appear in the file. Therefore, i
3330
`kubectl create` also accepts multiple `-f` arguments:
3431

3532
```shell
36-
$ kubectl create -f docs/user-guide/nginx/nginx-svc.yaml -f docs/user-guide/nginx/nginx-deployment.yaml
33+
$ kubectl create -f https://k8s.io/docs/concepts/cluster-administration/nginx/nginx-svc.yaml -f https://k8s.io/docs/concepts/cluster-administration/nginx/nginx-deployment.yaml
3734
```
3835

3936
And a directory can be specified rather than or in addition to individual files:
4037

4138
```shell
42-
$ kubectl create -f docs/user-guide/nginx/
39+
$ kubectl create -f https://k8s.io/docs/concepts/cluster-administration/nginx/
4340
```
4441

4542
`kubectl` will read any files with suffixes `.yaml`, `.yml`, or `.json`.
@@ -49,7 +46,7 @@ It is a recommended practice to put resources related to the same microservice o
4946
A URL can also be specified as a configuration source, which is handy for deploying directly from configuration files checked into github:
5047

5148
```shell
52-
$ kubectl create -f https://raw.githubusercontent.com/kubernetes/website/master/docs/user-guide/nginx-deployment.yaml
49+
$ kubectl create -f https://raw.githubusercontent.com/kubernetes/website/master/docs/concepts/cluster-administration/nginx-deployment.yaml
5350
deployment "nginx-deployment" created
5451
```
5552

@@ -58,7 +55,7 @@ deployment "nginx-deployment" created
5855
Resource creation isn't the only operation that `kubectl` can perform in bulk. It can also extract resource names from configuration files in order to perform other operations, in particular to delete the same resources you created:
5956

6057
```shell
61-
$ kubectl delete -f docs/user-guide/nginx/
58+
$ kubectl delete -f https://k8s.io/docs/concepts/cluster-administration/nginx/
6259
deployment "my-nginx" deleted
6360
service "my-nginx-svc" deleted
6461
```
@@ -80,12 +77,12 @@ service "my-nginx-svc" deleted
8077
Because `kubectl` outputs resource names in the same syntax it accepts, it's easy to chain operations using `$()` or `xargs`:
8178

8279
```shell
83-
$ kubectl get $(kubectl create -f docs/user-guide/nginx/ -o name | grep service)
80+
$ kubectl get $(kubectl create -f docs/concepts/cluster-administration/nginx/ -o name | grep service)
8481
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
8582
my-nginx-svc 10.0.0.208 <pending> 80/TCP 0s
8683
```
8784

88-
With the above commands, we first create resources under `docs/user-guide/nginx/` and print the resources created with `-o name` output format
85+
With the above commands, we first create resources under `docs/concepts/cluster-administration/nginx/` and print the resources created with `-o name` output format
8986
(print each resource as resource/name). Then we `grep` only the "service", and then print it with `kubectl get`.
9087

9188
If you happen to organize your resources across several subdirectories within a particular directory, you can recursively perform the operations on the subdirectories also, by specifying `--recursive` or `-R` alongside the `--filename,-f` flag.
@@ -131,7 +128,7 @@ deployment "my-deployment" created
131128
persistentvolumeclaim "my-pvc" created
132129
```
133130

134-
If you're interested in learning more about `kubectl`, go ahead and read [kubectl Overview](/docs/user-guide/kubectl-overview).
131+
If you're interested in learning more about `kubectl`, go ahead and read [kubectl Overview](/docs/reference/kubectl/overview/).
135132

136133
## Using labels effectively
137134

@@ -256,7 +253,7 @@ my-nginx-2035384211-u3t6x 1/1 Running 0 23m fe
256253

257254
This outputs all "app=nginx" pods, with an additional label column of pods' tier (specified with `-L` or `--label-columns`).
258255

259-
For more information, please see [labels](/docs/concepts/overview/working-with-objects/labels/) and [kubectl label](/docs/user-guide/kubectl/{{page.version}}/#label) document.
256+
For more information, please see [labels](/docs/concepts/overview/working-with-objects/labels/) and [kubectl label](/docs/reference/generated/kubectl/kubectl-commands/#label).
260257

261258
## Updating annotations
262259

@@ -273,7 +270,7 @@ metadata:
273270
...
274271
```
275272

276-
For more information, please see [annotations](/docs/concepts/overview/working-with-objects/annotations/) and [kubectl annotate](/docs/user-guide/kubectl/{{page.version}}/#annotate) document.
273+
For more information, please see [annotations](/docs/concepts/overview/working-with-objects/annotations/) and [kubectl annotate](/docs/reference/generated/kubectl/kubectl-commands/#annotate) document.
277274

278275
## Scaling your application
279276

@@ -301,7 +298,7 @@ deployment "my-nginx" autoscaled
301298

302299
Now your nginx replicas will be scaled up and down as needed, automatically.
303300

304-
For more information, please see [kubectl scale](/docs/user-guide/kubectl/{{page.version}}/#scale), [kubectl autoscale](/docs/user-guide/kubectl/{{page.version}}/#autoscale) and [horizontal pod autoscaler](/docs/tasks/run-application/horizontal-pod-autoscale/) document.
301+
For more information, please see [kubectl scale](/docs/reference/generated/kubectl/kubectl-commands/#scale), [kubectl autoscale](/docs/reference/generated/kubectl/kubectl-commands/#autoscale) and [horizontal pod autoscaler](/docs/tasks/run-application/horizontal-pod-autoscale/) document.
305302

306303

307304
## In-place updates of resources
@@ -312,12 +309,12 @@ Sometimes it's necessary to make narrow, non-disruptive updates to resources you
312309

313310
It is suggested to maintain a set of configuration files in source control (see [configuration as code](http://martinfowler.com/bliki/InfrastructureAsCode.html)),
314311
so that they can be maintained and versioned along with the code for the resources they configure.
315-
Then, you can use [`kubectl apply`](/docs/user-guide/kubectl/{{page.version}}/#apply) to push your configuration changes to the cluster.
312+
Then, you can use [`kubectl apply`](/docs/reference/generated/kubectl/kubectl-commands/#apply) to push your configuration changes to the cluster.
316313

317314
This command will compare the version of the configuration that you're pushing with the previous version and apply the changes you've made, without overwriting any automated changes to properties you haven't specified.
318315

319316
```shell
320-
$ kubectl apply -f docs/user-guide/nginx/nginx-deployment.yaml
317+
$ kubectl apply -f docs/concepts/cluster-administration/nginx/nginx-deployment.yaml
321318
deployment "my-nginx" configured
322319
```
323320

@@ -351,22 +348,22 @@ $ rm /tmp/nginx.yaml
351348

352349
This allows you to do more significant changes more easily. Note that you can specify the editor with your `EDITOR` or `KUBE_EDITOR` environment variables.
353350

354-
For more information, please see [kubectl edit](/docs/user-guide/kubectl/{{page.version}}/#edit) document.
351+
For more information, please see [kubectl edit](/docs/reference/generated/kubectl/kubectl-commands/#edit) document.
355352

356353
### kubectl patch
357354

358355
You can use `kubectl patch` to update API objects in place. This command supports JSON patch,
359356
JSON merge patch, and strategic merge patch. See
360357
[Update API Objects in Place Using kubectl patch](/docs/tasks/run-application/update-api-object-kubectl-patch/)
361358
and
362-
[kubectl patch](/docs/user-guide/kubectl/{{page.version}}/#patch).
359+
[kubectl patch](/docs/reference/generated/kubectl/kubectl-commands/#patch).
363360

364361
## Disruptive updates
365362

366363
In some cases, you may need to update resource fields that cannot be updated once initialized, or you may just want to make a recursive change immediately, such as to fix broken pods created by a Deployment. To change such fields, use `replace --force`, which deletes and re-creates the resource. In this case, you can simply modify your original configuration file:
367364

368365
```shell
369-
$ kubectl replace -f docs/user-guide/nginx/nginx-deployment.yaml --force
366+
$ kubectl replace -f docs/concepts/cluster-administration/nginx/nginx-deployment.yaml --force
370367
deployment "my-nginx" deleted
371368
deployment "my-nginx" replaced
372369
```

docs/user-guide/nginx-app.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

test/examples_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,15 @@ func TestExampleObjectSchemas(t *testing.T) {
298298
"counter-pod": {&api.Pod{}},
299299
"fluentd-sidecar-config": {&api.ConfigMap{}},
300300
"nginx-app": {&api.Service{}, &extensions.Deployment{}},
301+
"nginx-deployment": {&extensions.Deployment{}},
301302
"two-files-counter-pod": {&api.Pod{}},
302303
"two-files-counter-pod-agent-sidecar": {&api.Pod{}},
303304
"two-files-counter-pod-streaming-sidecar": {&api.Pod{}},
304305
},
306+
"../docs/concepts/cluster-administration/nginx": {
307+
"nginx-deployment": {&extensions.Deployment{}},
308+
"nginx-svc": {&api.Service{}},
309+
},
305310
"../docs/concepts/configuration": {
306311
"commands": {&api.Pod{}},
307312
"pod": {&api.Pod{}},
@@ -516,7 +521,6 @@ func TestExampleObjectSchemas(t *testing.T) {
516521
"multi-pod": {&api.Pod{}, &api.Pod{}},
517522
"new-nginx-deployment": {&extensions.Deployment{}},
518523
"nginx-app": {&api.Service{}, &extensions.Deployment{}},
519-
"nginx-deployment": {&extensions.Deployment{}},
520524
"nginx-init-containers": {&api.Pod{}},
521525
"nginx-lifecycle-deployment": {&extensions.Deployment{}},
522526
"nginx-probe-deployment": {&extensions.Deployment{}},
@@ -557,10 +561,6 @@ func TestExampleObjectSchemas(t *testing.T) {
557561
"http-liveness": {&api.Pod{}},
558562
"http-liveness-named-port": {&api.Pod{}},
559563
},
560-
"../docs/user-guide/nginx": {
561-
"nginx-deployment": {&extensions.Deployment{}},
562-
"nginx-svc": {&api.Service{}},
563-
},
564564
"../docs/user-guide/node-selection": {
565565
"pod": {&api.Pod{}},
566566
"pod-with-node-affinity": {&api.Pod{}},

0 commit comments

Comments
 (0)