deployment, err := client.AppsV1().Deployments("mynamespace").Get("mydeployment", metav1.GetOptions{}) if err != nil { // handle error } // use the deployment object
secrets, err := client.CoreV1().Secrets("").List(metav1.ListOptions{}) if err != nil { // handle error } // use the secrets list
pod := &corev1.Pod{ Metadata: metav1.ObjectMeta{ Name: "mypod", Namespace: "mynamespace", }, Spec: corev1.PodSpec{ // pod spec here }, } createdPod, err := client.CoreV1().Pods("mynamespace").Create(pod) if err != nil { // handle error } // use the created pod objectThese examples use the clientset_generated/internalclientset interfaces in the k8s.io/kubernetes/pkg/client package library.