Commit Graph

6 Commits

Author SHA1 Message Date
Johannes Würbach
164b2f8a05 Remove outdated rollback step from CRUD deployment example
The code was already removed, remove the rollback step also from the README

Kubernetes-commit: e6e3b78f7549d6bae33664af87bf34fd425528c3
2019-01-02 20:52:34 +01:00
SataQiu
ed35c194bb Remove the redundant space
Kubernetes-commit: c9bc62542892a4f568a60cd423807e078c4e3ac9
2018-09-30 11:09:32 +08:00
halfcrazy
b6a34c5a00 fix typo in client-go
Kubernetes-commit: 86801dee64215e76080fe8df83ffd1fb7df9e093
2018-02-01 02:33:45 +08:00
John Kelly
ddf6c35ca5 client-go: use retry util in CRUD example
This updates the create-update-delete-deployment example with the following:
Make use of client-go retry util in Update() steps instead of simple for loops.
Using RetryOnConflict is generally better practice as it won't become stuck in a retry loop and uses exponential backoff to prevent exhausting the apiserver.
Instead of changing annotations to demonstrate Updates/Rollbacks, change the container image as it is less confusing for readers and a better real-world example.
Improve comments and README to reflect above changes.

Signed-off-by: John Kelly <jekohk@gmail.com>

Kubernetes-commit: 94f5bcf6f77d5b35074dfab47b5de37096d8ee00
2017-10-05 19:07:57 -04:00
John Kelly
4e80b27156 client-go: Update CRUD example
This updates the create-update-delete-deployment example with the following:
Add rollback step to demonstrate rolling back deployments with client-go.
Modify the for-loops used in both Update steps to Get() the latest version
of the Deployment from the server before attempting Update().
This is necessary because the object returned by Create() does
not have the new resourceVersion, causing the initial Update() to always fail
due to conflicting resource versions. Putting the Get() at the top of the
loop seems to fix this bug.
Make -kubeconfig flag optional if config is in default location, using the
same method found in the out-of-cluster example.

Patch is motivated by effort to improve client-go examples.

Signed-off-by: John Kelly <jekohk@gmail.com>

Kubernetes-commit: ce73088a718c30d8a3577f5d0521584b9c201e69
2017-10-04 18:01:49 -04:00
Ahmet Alp Balkan
8787fb55e2 client-go: Add CRUD Deployment sample
This sample adds sample code for create/list/replace/delete operations for
Deployment resource for client-go library. This patch also contains
documentation explaining what the example application does and how it can be
executed.

This patch is part of the body of work improving the client library samples.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>

Kubernetes-commit: d75710f9f4d2e74979f6da07de31b02fae0392b0
2017-06-13 20:38:46 +00:00