-
Notifications
You must be signed in to change notification settings - Fork 107
Better documentation #77
Comments
To your specific question, you'd do something like: var d appsv1.Deployment
if err := client.Get(ctx, "my-namespace", "my-deployment", &d); err != nil {
// Handle error
}
d.Spec.Replicas = k8s.Int32(10)
if err := client.Update(ctx, d); err != nil {
// Handle error
}
I can see how that might happen. Would adding API reference links help? For example: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.9/ Or some example of "how do I track down an object?" like mapping
to the associated godocs: https://godoc.org/github.com/ericchiang/k8s/apis/networking/v1#NetworkPolicy |
My main confusion is/was around how the API worked. With your sample I was able to figure out the apis folder contains lots of the types that when they are pointers can be used as k8s.Resources. It would be nice to document the api folder is where all the types live and is the crux to knowing how to get / update k8s.Resources. the README shows where corev1 is, but i'm not a k8s expert and I don't fully understand what the apiVersions are in k8s still. so it depends on how easy you want beginners to use your API. I was hoping the API would abstract away a lot of the need to understand fine grain details of how k8s works internally, but maybe that's just a mis-guided approach. Also thanks for your help. I was able to get scale / set image working. |
This most recent rewrite I am having a difficult time digging to see how to do basic things. ie: How do I scale a deployment, how do I update an image for a deployment? I have been able to pull out a pod list, iterate to find the container status where images are listed and altered those structures and attempted to update. No errors, but the images aren't changing. I haven't found any clue from the code how you could possibly scale a deployment either. I want this library to work with its less dependencies, but it seem very unfriendly for non experts of kubernetes now. Can you help me with these specific actions, and enhance the documentation or point me in the right place
I'm sorry if an Issue is the incorrect place for this kind of comment. I just don't know where else to go.
The text was updated successfully, but these errors were encountered: