Skip to content

Commit 6df6f21

Browse files
ahmetbk8s-publish-robot
authored andcommitted
clientgo/examples: add ToC for examples
Also add authenticate- prefix to auth samples. Signed-off-by: Ahmet Alp Balkan <[email protected]> Kubernetes-commit: 62d1251874cb259d38d727300ac4b2646c4122c8
1 parent 2163038 commit 6df6f21

File tree

8 files changed

+37
-8
lines changed

8 files changed

+37
-8
lines changed

examples/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# client-go Examples
2+
3+
This directory contains examples that cover various use cases and functionality
4+
for client-go.
5+
6+
### Configuration
7+
8+
- [**Authenticate in cluster**](./in-cluster-client-configuration): Configure a
9+
client while running inside the Kubernetes cluster.
10+
- [**Authenticate out of cluster**](./out-of-cluster-client-configuration):
11+
Configure a client to access a Kubernetes cluster from outside.
12+
13+
### Basics
14+
15+
- [**Managing resources with API**](./create-update-delete-deployment): Create,
16+
get, update, delete a Deployment resource.
17+
18+
### Advanced Concepts
19+
20+
- [**Work queues**](./workqueue): Create a hotloop-free controller with the
21+
rate-limited workqueue and the [informer framework][informer].
22+
- [**Third-party resources (deprecated)**](./third-party-resources-deprecated):
23+
Register a custom resource type with the API, create/update/query this custom
24+
type, and write a controller drives the cluster state based on the changes to
25+
the custom resources.
26+
27+
[informer]: https://godoc.org/k8s.io/client-go/tools/cache#NewInformer
28+

examples/in-cluster/BUILD renamed to examples/in-cluster-client-configuration/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ load(
99
)
1010

1111
go_binary(
12-
name = "in-cluster",
12+
name = "in-cluster-client-configuration",
1313
library = ":go_default_library",
1414
tags = ["automanaged"],
1515
)

examples/in-cluster/README.md renamed to examples/in-cluster-client-configuration/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Authenticating inside the cluster
22

3-
This example shows you how you can write an application that authenticates to
4-
the Kubernetes API while it is running on a Kubernetes cluster.
3+
This example shows you how to configure a client with client-go to authenticate
4+
to the Kubernetes API from an application running inside the Kubernetes cluster.
55

66
client-go uses the [Service Account token][sa] mounted inside the Pod at the
77
`/var/run/secrets/kubernetes.io/serviceaccount` path when the
@@ -11,7 +11,7 @@ client-go uses the [Service Account token][sa] mounted inside the Pod at the
1111

1212
First compile the application for Linux:
1313

14-
cd in-cluster
14+
cd in-cluster-client-configuration
1515
GOOS=linux go build -o ./app .
1616

1717
Then package it to a docker image using the provided Dockerfile to run it on

examples/out-of-cluster/BUILD renamed to examples/out-of-cluster-client-configuration/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ load(
99
)
1010

1111
go_binary(
12-
name = "out-of-cluster",
12+
name = "out-of-cluster-client-configuration",
1313
library = ":go_default_library",
1414
tags = ["automanaged"],
1515
)

examples/out-of-cluster/README.md renamed to examples/out-of-cluster-client-configuration/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Authenticating outside the cluster
22

3-
This example shows you how to authenticate to the Kubernetes API from an
4-
application running outside the Kubernetes cluster with client-go.
3+
This example shows you how to configure a client with client-go to authenticate
4+
to the Kubernetes API from an application running outside the Kubernetes
5+
cluster.
56

67
You can use your kubeconfig file that contains the context information
78
of your cluster to initialize a client. The kubeconfig file is also used
@@ -14,7 +15,7 @@ Make sure your `kubectl` is configured and pointed to a cluster. Run
1415

1516
Run this application with:
1617

17-
cd out-of-cluster
18+
cd out-of-cluster-client-configuration
1819
go build -o app .
1920
./app
2021

0 commit comments

Comments
 (0)