@@ -61,9 +61,48 @@ Then manually install the following JARs:
6161
6262## Example
6363
64- list all pods:
64+ We prepared a few examples for common use-cases which are shown below:
65+ - __ Configuration__ :
66+ - [ InClusterClientExample] ( https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/InClusterClientExample.java ) :
67+ Configure a client while running inside the Kubernetes cluster.
68+ - [ KubeConfigFileClientExample] ( https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/KubeConfigFileClientExample.java ) :
69+ Configure a client to access a Kubernetes cluster from outside.
70+ - __ Basics__ :
71+ - [ SimpleExample] ( https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/Example.java ) :
72+ Simple minimum example of how to use the client.
73+ - [ ProtoExample] ( https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/ProtoExample.java ) :
74+ Request/receive payloads in protobuf serialization protocol.
75+ - [ PatchExample] ( https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/PatchExample.java ) :
76+ Patch resource objects in various supported patch formats, equal to ` kubectl patch ` .
77+ - [ FluentExample] ( https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/FluentExample.java ) :
78+ Construct arbitrary resource in a fluent builder style.
79+ - __ Streaming__ :
80+ - [ WatchExample] ( https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/WatchExample.java ) :
81+ Subscribe watch events from certain resources, equal to ` kubectl get <resource> -w ` .
82+ - [ LogsExample] ( https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/LogsExample.java ) :
83+ Fetch logs from running containers, equal to ` kubectl logs ` .
84+ - [ ExecExample] ( https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/ExecExample.java ) :
85+ Establish an "exec" session with running containers, equal to ` kubectl exec ` .
86+ - [ PortForwardExample] ( https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/PortForwardExample.java ) :
87+ Maps local port to a port on the pod, equal to ` kubectl port-forward ` .
88+ - [ AttachExample] ( https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/AttachExample.java ) :
89+ Attach to a process that is already running inside an existing container, equal to ` kubectl attach ` .
90+ - [ CopyExample] ( https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/CopyExample.java ) :
91+ Copy files and directories to and from containers, equal to ` kubectl cp ` .
92+ - [ WebSocketExample] ( https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/WebSocketExample.java ) :
93+ Establish an arbitrary web-socket session to certain resources.
94+ - __ Advanced__ :
95+ - [ InformerExample] ( https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/InformerExample.java ) :
96+ Build an informer which list-watches resources and reflects the notifications to a local cache.
97+ - [ LeaderElectionExample] ( https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/LeaderElectionExample.java ) :
98+ Leader election utilities to help implement HA controllers.
99+ - [ PagerExample] ( https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/PagerExample.java ) :
100+ Support Pagination (only for the list request) to ease server-side loads/network congestion.
101+
102+
103+ __ list all pods__ :
65104
66- ``` java
105+ ```
67106import io.kubernetes.client.ApiClient;
68107import io.kubernetes.client.ApiException;
69108import io.kubernetes.client.Configuration;
@@ -88,9 +127,9 @@ public class Example {
88127}
89128```
90129
91- watch on namespace object :
130+ __ watch on namespace object __ :
92131
93- ``` java
132+ ```
94133import com.google.gson.reflect.TypeToken;
95134import io.kubernetes.client.ApiClient;
96135import io.kubernetes.client.ApiException;
0 commit comments