5

NOTE: If we write kubernetes client in Rust

 2 years ago
source link: https://dannypsnl.github.io/blog/2019/12/13/cs/if-write-kube-client-go-in-rust/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

First, we can make in cluster config became more evident. Then we can mix get/list by providing type parameters:NOTE: If we write kubernetes client in Rust

Email: [email protected]
GitHub: @dannypsnl
Twitter: @dannypsnl

Programming Language Theory • System Programming

NOTE: If we write kubernetes client in Rust

First, we can make in cluster config became more evident.

let cfg = Config::InCluster
// or
let cfg = Config::Path("~/.kube/config")
let cluster = kube::attach_cluster(cfg);

Then we can mix get/list by providing type parameters:

let nginx_pod = cluster.get::<Pod>(Namespace::Name("default"), "nginx-se3jn1-34jbk");
// list
let pods = cluster.list::<Pod>(Namespace::All);

author: Lîm Tsú-thuàn/林子篆/Danny

category:cs

tag:noteprogrammingkubernetesrust

Similar Articles

All works in this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
©2022 dannypsnl(林子篆)

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK