Skip to content

Commit d1d6eda

Browse files
committed
Clean up change-default-storage-class.md
1 parent 942e9f9 commit d1d6eda

File tree

2 files changed

+84
-63
lines changed

2 files changed

+84
-63
lines changed

content/en/docs/tasks/administer-cluster/access-cluster-api.md

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,14 @@ kubectl. Complete documentation is found in the [kubectl manual](/docs/reference
3939
kubectl handles locating and authenticating to the API server. If you want to directly access the REST API with an http client like
4040
`curl` or `wget`, or a browser, there are multiple ways you can locate and authenticate against the API server:
4141

42-
1. Run kubectl in proxy mode (recommended). This method is recommended, since it uses the stored apiserver location and verifies the identity of the API server using a self-signed cert. No man-in-the-middle (MITM) attack is possible using this method.
43-
1. Alternatively, you can provide the location and credentials directly to the http client. This works with client code that is confused by proxies. To protect against man in the middle attacks, you'll need to import a root cert into your browser.
42+
1. Run kubectl in proxy mode (recommended). This method is recommended, since it uses
43+
the stored API server location and verifies the identity of the API server using a
44+
self-signed certificate. No man-in-the-middle (MITM) attack is possible using this method.
45+
1. Alternatively, you can provide the location and credentials directly to the http client.
46+
This works with client code that is confused by proxies. To protect against man in the
47+
middle attacks, you'll need to import a root cert into your browser.
4448

45-
Using the Go or Python client libraries provides accessing kubectl in proxy mode.
49+
Using the Go or Python client libraries provides accessing kubectl in proxy mode.
4650

4751
#### Using kubectl proxy
4852

@@ -151,16 +155,23 @@ describes how you can configure this as a cluster administrator.
151155

152156
### Programmatic access to the API
153157

154-
Kubernetes officially supports client libraries for [Go](#go-client), [Python](#python-client), [Java](#java-client), [dotnet](#dotnet-client), [JavaScript](#javascript-client), and [Haskell](#haskell-client). There are other client libraries that are provided and maintained by their authors, not the Kubernetes team. See [client libraries](/docs/reference/using-api/client-libraries/) for accessing the API from other languages and how they authenticate.
158+
Kubernetes officially supports client libraries for [Go](#go-client), [Python](#python-client),
159+
[Java](#java-client), [dotnet](#dotnet-client), [JavaScript](#javascript-client), and
160+
[Haskell](#haskell-client). There are other client libraries that are provided and maintained by
161+
their authors, not the Kubernetes team. See [client libraries](/docs/reference/using-api/client-libraries/)
162+
for accessing the API from other languages and how they authenticate.
155163

156164
#### Go client
157165

158-
* To get the library, run the following command: `go get k8s.io/client-go@kubernetes-` See [https://github.com/kubernetes/client-go/releases](https://github.com/kubernetes/client-go/releases) to see which versions are supported.
166+
* To get the library, run the following command: `go get k8s.io/client-go@kubernetes-`
167+
See [https://github.com/kubernetes/client-go/releases](https://github.com/kubernetes/client-go/releases)
168+
to see which versions are supported.
159169
* Write an application atop of the client-go clients.
160170

161171
{{< note >}}
162172

163-
client-go defines its own API objects, so if needed, import API definitions from client-go rather than from the main repository. For example, `import "k8s.io/client-go/kubernetes"` is correct.
173+
`client-go` defines its own API objects, so if needed, import API definitions from client-go rather than
174+
from the main repository. For example, `import "k8s.io/client-go/kubernetes"` is correct.
164175

165176
{{< /note >}}
166177

@@ -190,14 +201,18 @@ func main() {
190201
}
191202
```
192203

193-
If the application is deployed as a Pod in the cluster, see [Accessing the API from within a Pod](/docs/tasks/access-application-cluster/access-cluster/#accessing-the-api-from-a-pod).
204+
If the application is deployed as a Pod in the cluster, see
205+
[Accessing the API from within a Pod](/docs/tasks/access-application-cluster/access-cluster/#accessing-the-api-from-a-pod).
194206

195207
#### Python client
196208

197-
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.
209+
To use [Python client](https://github.com/kubernetes-client/python), run the following command:
210+
`pip install kubernetes`. See [Python Client Library page](https://github.com/kubernetes-client/python)
211+
for more installation options.
198212

199213
The Python client can use the same [kubeconfig file](/docs/concepts/configuration/organize-cluster-access-kubeconfig/)
200-
as the kubectl CLI does to locate and authenticate to the API server. See this [example](https://github.com/kubernetes-client/python/blob/master/examples/out_of_cluster_config.py):
214+
as the kubectl CLI does to locate and authenticate to the API server. See this
215+
[example](https://github.com/kubernetes-client/python/blob/master/examples/out_of_cluster_config.py):
201216

202217
```python
203218
from kubernetes import client, config
@@ -224,10 +239,12 @@ cd java
224239
mvn install
225240
```
226241

227-
See [https://github.com/kubernetes-client/java/releases](https://github.com/kubernetes-client/java/releases) to see which versions are supported.
242+
See [https://github.com/kubernetes-client/java/releases](https://github.com/kubernetes-client/java/releases)
243+
to see which versions are supported.
228244

229245
The Java client can use the same [kubeconfig file](/docs/concepts/configuration/organize-cluster-access-kubeconfig/)
230-
as the kubectl CLI does to locate and authenticate to the API server. See this [example](https://github.com/kubernetes-client/java/blob/master/examples/examples-release-15/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java):
246+
as the kubectl CLI does to locate and authenticate to the API server. See this
247+
[example](https://github.com/kubernetes-client/java/blob/master/examples/examples-release-15/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java):
231248

232249
```java
233250
package io.kubernetes.client.examples;
@@ -278,10 +295,16 @@ public class KubeConfigFileClientExample {
278295

279296
#### dotnet client
280297

281-
To use [dotnet client](https://github.com/kubernetes-client/csharp), run the following command: `dotnet add package KubernetesClient --version 1.6.1` See [dotnet Client Library page](https://github.com/kubernetes-client/csharp) for more installation options. See [https://github.com/kubernetes-client/csharp/releases](https://github.com/kubernetes-client/csharp/releases) to see which versions are supported.
298+
To use [dotnet client](https://github.com/kubernetes-client/csharp),
299+
run the following command: `dotnet add package KubernetesClient --version 1.6.1`.
300+
See [dotnet Client Library page](https://github.com/kubernetes-client/csharp)
301+
for more installation options. See
302+
[https://github.com/kubernetes-client/csharp/releases](https://github.com/kubernetes-client/csharp/releases)
303+
to see which versions are supported.
282304

283305
The dotnet client can use the same [kubeconfig file](/docs/concepts/configuration/organize-cluster-access-kubeconfig/)
284-
as the kubectl CLI does to locate and authenticate to the API server. See this [example](https://github.com/kubernetes-client/csharp/blob/master/examples/simple/PodList.cs):
306+
as the kubectl CLI does to locate and authenticate to the API server. See this
307+
[example](https://github.com/kubernetes-client/csharp/blob/master/examples/simple/PodList.cs):
285308

286309
```csharp
287310
using System;
@@ -313,10 +336,14 @@ namespace simple
313336

314337
#### JavaScript client
315338

316-
To install [JavaScript client](https://github.com/kubernetes-client/javascript), run the following command: `npm install @kubernetes/client-node`. See [https://github.com/kubernetes-client/javascript/releases](https://github.com/kubernetes-client/javascript/releases) to see which versions are supported.
339+
To install [JavaScript client](https://github.com/kubernetes-client/javascript),
340+
run the following command: `npm install @kubernetes/client-node`. See
341+
[https://github.com/kubernetes-client/javascript/releases](https://github.com/kubernetes-client/javascript/releases)
342+
to see which versions are supported.
317343

318344
The JavaScript client can use the same [kubeconfig file](/docs/concepts/configuration/organize-cluster-access-kubeconfig/)
319-
as the kubectl CLI does to locate and authenticate to the API server. See this [example](https://github.com/kubernetes-client/javascript/blob/master/examples/example.js):
345+
as the kubectl CLI does to locate and authenticate to the API server. See this
346+
[example](https://github.com/kubernetes-client/javascript/blob/master/examples/example.js):
320347

321348
```javascript
322349
const k8s = require('@kubernetes/client-node');
@@ -333,10 +360,13 @@ k8sApi.listNamespacedPod('default').then((res) => {
333360

334361
#### Haskell client
335362

336-
See [https://github.com/kubernetes-client/haskell/releases](https://github.com/kubernetes-client/haskell/releases) to see which versions are supported.
363+
See [https://github.com/kubernetes-client/haskell/releases](https://github.com/kubernetes-client/haskell/releases)
364+
to see which versions are supported.
337365

338-
The [Haskell client](https://github.com/kubernetes-client/haskell) can use the same [kubeconfig file](/docs/concepts/configuration/organize-cluster-access-kubeconfig/)
339-
as the kubectl CLI does to locate and authenticate to the API server. See this [example](https://github.com/kubernetes-client/haskell/blob/master/kubernetes-client/example/App.hs):
366+
The [Haskell client](https://github.com/kubernetes-client/haskell) can use the same
367+
[kubeconfig file](/docs/concepts/configuration/organize-cluster-access-kubeconfig/)
368+
as the kubectl CLI does to locate and authenticate to the API server. See this
369+
[example](https://github.com/kubernetes-client/haskell/blob/master/kubernetes-client/example/App.hs):
340370

341371
```haskell
342372
exampleWithKubeConfig :: IO ()

content/en/docs/tasks/administer-cluster/change-default-storage-class.md

Lines changed: 36 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,10 @@ weight: 90
88
This page shows how to change the default Storage Class that is used to
99
provision volumes for PersistentVolumeClaims that have no special requirements.
1010

11-
12-
1311
## {{% heading "prerequisites" %}}
1412

15-
1613
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
1714

18-
19-
2015
2116

2217
## Why change the default storage class?
@@ -39,67 +34,63 @@ for details about addon manager and how to disable individual addons.
3934

4035
## Changing the default StorageClass
4136

42-
1. List the StorageClasses in your cluster:
37+
1. List the StorageClasses in your cluster:
4338

44-
```bash
45-
kubectl get storageclass
46-
```
39+
```bash
40+
kubectl get storageclass
41+
```
4742

48-
The output is similar to this:
43+
The output is similar to this:
4944

50-
```bash
51-
NAME PROVISIONER AGE
52-
standard (default) kubernetes.io/gce-pd 1d
53-
gold kubernetes.io/gce-pd 1d
54-
```
45+
```bash
46+
NAME PROVISIONER AGE
47+
standard (default) kubernetes.io/gce-pd 1d
48+
gold kubernetes.io/gce-pd 1d
49+
```
5550

56-
The default StorageClass is marked by `(default)`.
51+
The default StorageClass is marked by `(default)`.
5752

5853
1. Mark the default StorageClass as non-default:
5954

60-
The default StorageClass has an annotation
61-
`storageclass.kubernetes.io/is-default-class` set to `true`. Any other value
62-
or absence of the annotation is interpreted as `false`.
55+
The default StorageClass has an annotation
56+
`storageclass.kubernetes.io/is-default-class` set to `true`. Any other value
57+
or absence of the annotation is interpreted as `false`.
6358

64-
To mark a StorageClass as non-default, you need to change its value to `false`:
59+
To mark a StorageClass as non-default, you need to change its value to `false`:
6560

66-
```bash
67-
kubectl patch storageclass standard -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
68-
```
61+
```bash
62+
kubectl patch storageclass standard -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
63+
```
6964

70-
where `standard` is the name of your chosen StorageClass.
65+
where `standard` is the name of your chosen StorageClass.
7166

7267
1. Mark a StorageClass as default:
7368

74-
Similar to the previous step, you need to add/set the annotation
75-
`storageclass.kubernetes.io/is-default-class=true`.
69+
Similar to the previous step, you need to add/set the annotation
70+
`storageclass.kubernetes.io/is-default-class=true`.
7671

77-
```bash
78-
kubectl patch storageclass gold -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
79-
```
72+
```bash
73+
kubectl patch storageclass gold -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
74+
```
8075

81-
Please note that at most one StorageClass can be marked as default. If two
82-
or more of them are marked as default, a `PersistentVolumeClaim` without `storageClassName` explicitly specified cannot be created.
76+
Please note that at most one StorageClass can be marked as default. If two
77+
or more of them are marked as default, a `PersistentVolumeClaim` without
78+
`storageClassName` explicitly specified cannot be created.
8379

8480
1. Verify that your chosen StorageClass is default:
8581

86-
```bash
87-
kubectl get storageclass
88-
```
89-
90-
The output is similar to this:
91-
92-
```bash
93-
NAME PROVISIONER AGE
94-
standard kubernetes.io/gce-pd 1d
95-
gold (default) kubernetes.io/gce-pd 1d
96-
```
82+
```bash
83+
kubectl get storageclass
84+
```
9785

86+
The output is similar to this:
9887

88+
```bash
89+
NAME PROVISIONER AGE
90+
standard kubernetes.io/gce-pd 1d
91+
gold (default) kubernetes.io/gce-pd 1d
92+
```
9993

10094
## {{% heading "whatsnext" %}}
10195

10296
* Learn more about [PersistentVolumes](/docs/concepts/storage/persistent-volumes/).
103-
104-
105-

0 commit comments

Comments
 (0)