k8s

package module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2017 License: Apache-2.0 Imports: 48 Imported by: 0

README

A simple Go client for Kubernetes

GoDoc

A slimmed down Go client generated using Kubernetes' new protocol buffer support. This package behaves similarly to official Kubernetes' Go client, but only imports two external dependencies.

package main

import (
    "context"
    "fmt"
    "log"

    "github.com/ericchiang/k8s"
)

func main() {
    client, err := k8s.NewInClusterClient()
    if err != nil {
        log.Fatal(err)
    }

    nodes, err := client.CoreV1().ListNodes(context.Background())
    if err != nil {
        log.Fatal(err)
    }
    for _, node := range nodes.Items {
        fmt.Printf("name=%q schedulable=%t\n", node.Metadata.Name, !*node.Spec.Unschedulable)
    }
}

Requirements

Versioned supported

This client supports every API group version present since 1.3.

Usage

Namespaces
pods, err := client.ListPods(ctx, k8s.AllNamespaces) // Pods in all namespaces.
pods, err := client.ListPods(ctx, "custom-namespace") // Pods from the "custom-namespace"
Label selectors

Label selectors can be provided to any list operation.

l := new(k8s.LabelSelector)
l.Eq("tier", "production")
l.In("app", "database", "frontend")

pods, err := client.CoreV1().ListPods(ctx, "", l.Selector())
Working with resources

Use the generated API types directly to create and modify resources.

import (
    "context"

    "github.com/ericchiang/k8s"
    "github.com/ericchiang/k8s/api/v1"
    metav1 "github.com/ericchiang/k8s/apis/meta/v1"
)

func createConfigMap(client *k8s.Client, name string, values map[string]string) error {
    cm := &v1.ConfigMap{
        Metadata: &metav1.ObjectMeta{
            Name:      &name,
            Namespace: &client.Namespace,
        },
        Data: values,
    }
    // Will return the created configmap as well.
    _, err := client.CoreV1().CreateConfigMap(context.TODO(), cm)
    return err
}

API structs use pointers to int, bool, and string types to differentiate between the zero value and an unsupplied one. This package provides convenience methods for creating pointers to literals of basic types.

Creating out-of-cluster clients

Out-of-cluster clients can be constructed by either creating an http.Client manually or parsing a Config object. The following is an example of creating a client from a kubeconfig:

import (
    "io/ioutil"

    "github.com/ericchiang/k8s"

    "github.com/ghodss/yaml"
)

// loadClient parses a kubeconfig from a file and returns a Kubernetes
// client. It does not support extensions or client auth providers.
func loadClient(kubeconfigPath string) (*k8s.Client, error) {
    data, err := ioutil.ReadFile(kubeconfigPath)
    if err != nil {
        return nil, fmt.Errorf("read kubeconfig: %v", err)
    }

    // Unmarshal YAML into a Kubernetes config object.
    var config k8s.Config
    if err := yaml.Unmarshal(data, &config); err != nil {
        return nil, fmt.Errorf("unmarshal kubeconfig: %v", err)
    }
    return k8s.NewClient(&config)
}
Errors

Errors returned by the Kubernetes API are formatted as unversioned.Status objects and surfaced by clients as *k8s.APIErrors. Programs that need to inspect error codes or failure details can use a type cast to access this information.

// createConfigMap creates a configmap in the client's default namespace
// but does not return an error if a configmap of the same name already
// exists.
func createConfigMap(client *k8s.Client, name string, values map[string]string) error {
    cm := &v1.ConfigMap{
        Metadata: &metav1.ObjectMeta{
            Name:      &name,
            Namespace: &client.Namespace,
        },
        Data: values,
    }

    _, err := client.CoreV1().CreateConfigMap(context.TODO(), cm)

    // If an HTTP error was returned by the API server, it will be of type
    // *k8s.APIError. This can be used to inspect the status code.
    if apiErr, ok := err.(*k8s.APIError); ok {
        // Resource already exists. Carry on.
        if apiErr.Code == http.StatusConflict {
            return nil
        }
    }
    return fmt.Errorf("create configmap: %v", err)
}

Documentation

Overview

Package k8s implements a Kubernetes client.

c, err := k8s.NewInClusterClient()
if err != nil {
	// handle error
}
extensions := c.ExtensionsV1Beta1()

ingresses, err := extensions.ListIngresses(ctx, c.Namespace)
if err != nil {
	// handle error
}

Index

Constants

View Source
const (
	// Types for watch events.
	EventAdded    = "ADDED"
	EventDeleted  = "DELETED"
	EventModified = "MODIFIED"
	EventError    = "ERROR"
)
View Source
const (
	// AllNamespaces is given to list and watch operations to signify that the code should
	// list or watch resources in all namespaces.
	AllNamespaces = allNamespaces
)

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) *bool

Bool is a convinence for converting a bool literal to a pointer to a bool.

func Int

func Int(i int) *int

Int is a convinence for converting an int literal to a pointer to an int.

func String

func String(s string) *string

String returns a pointer to a string. Useful for creating API objects that take pointers instead of literals.

cm := &v1.ConfigMap{
	Metadata: &v1.ObjectMeta{
		Name:      k8s.String("myconfigmap"),
		Namespace: k8s.String("default"),
	},
	Data: map[string]string{
		"foo": "bar",
	},
}

Types

type APIError

type APIError struct {
	// The status object returned by the Kubernetes API,
	Status *unversioned.Status

	// Status code returned by the HTTP request.
	//
	// NOTE: For some reason the value set in Status.Code
	// doesn't correspond to the HTTP status code. Possibly
	// a bug?
	Code int
}

APIError is an error from a unexpected status code.

func (*APIError) Error

func (e *APIError) Error() string

type AppsV1Alpha1

type AppsV1Alpha1 struct {
	// contains filtered or unexported fields
}

AppsV1Alpha1 is a client for interacting with the apps/v1alpha1 API group.

func (*AppsV1Alpha1) CreatePetSet

func (c *AppsV1Alpha1) CreatePetSet(ctx context.Context, obj *appsv1alpha1.PetSet) (*appsv1alpha1.PetSet, error)

func (*AppsV1Alpha1) DeletePetSet

func (c *AppsV1Alpha1) DeletePetSet(ctx context.Context, name string, namespace string) error

func (*AppsV1Alpha1) GetPetSet

func (c *AppsV1Alpha1) GetPetSet(ctx context.Context, name, namespace string) (*appsv1alpha1.PetSet, error)

func (*AppsV1Alpha1) ListPetSets

func (c *AppsV1Alpha1) ListPetSets(ctx context.Context, namespace string, options ...Option) (*appsv1alpha1.PetSetList, error)

func (*AppsV1Alpha1) UpdatePetSet

func (c *AppsV1Alpha1) UpdatePetSet(ctx context.Context, obj *appsv1alpha1.PetSet) (*appsv1alpha1.PetSet, error)

func (*AppsV1Alpha1) WatchPetSets

func (c *AppsV1Alpha1) WatchPetSets(ctx context.Context, namespace string, options ...Option) (*AppsV1Alpha1PetSetWatcher, error)

type AppsV1Alpha1PetSetWatcher

type AppsV1Alpha1PetSetWatcher struct {
	// contains filtered or unexported fields
}

func (*AppsV1Alpha1PetSetWatcher) Close

func (w *AppsV1Alpha1PetSetWatcher) Close() error

func (*AppsV1Alpha1PetSetWatcher) Next

type AppsV1Beta1

type AppsV1Beta1 struct {
	// contains filtered or unexported fields
}

AppsV1Beta1 is a client for interacting with the apps/v1beta1 API group.

func (*AppsV1Beta1) CreateDeployment added in v0.3.0

func (c *AppsV1Beta1) CreateDeployment(ctx context.Context, obj *appsv1beta1.Deployment) (*appsv1beta1.Deployment, error)

func (*AppsV1Beta1) CreateScale added in v0.3.0

func (c *AppsV1Beta1) CreateScale(ctx context.Context, obj *appsv1beta1.Scale) (*appsv1beta1.Scale, error)

func (*AppsV1Beta1) CreateStatefulSet

func (c *AppsV1Beta1) CreateStatefulSet(ctx context.Context, obj *appsv1beta1.StatefulSet) (*appsv1beta1.StatefulSet, error)

func (*AppsV1Beta1) DeleteDeployment added in v0.3.0

func (c *AppsV1Beta1) DeleteDeployment(ctx context.Context, name string, namespace string) error

func (*AppsV1Beta1) DeleteScale added in v0.3.0

func (c *AppsV1Beta1) DeleteScale(ctx context.Context, name string, namespace string) error

func (*AppsV1Beta1) DeleteStatefulSet

func (c *AppsV1Beta1) DeleteStatefulSet(ctx context.Context, name string, namespace string) error

func (*AppsV1Beta1) GetDeployment added in v0.3.0

func (c *AppsV1Beta1) GetDeployment(ctx context.Context, name, namespace string) (*appsv1beta1.Deployment, error)

func (*AppsV1Beta1) GetScale added in v0.3.0

func (c *AppsV1Beta1) GetScale(ctx context.Context, name, namespace string) (*appsv1beta1.Scale, error)

func (*AppsV1Beta1) GetStatefulSet

func (c *AppsV1Beta1) GetStatefulSet(ctx context.Context, name, namespace string) (*appsv1beta1.StatefulSet, error)

func (*AppsV1Beta1) ListDeployments added in v0.3.0

func (c *AppsV1Beta1) ListDeployments(ctx context.Context, namespace string, options ...Option) (*appsv1beta1.DeploymentList, error)

func (*AppsV1Beta1) ListStatefulSets

func (c *AppsV1Beta1) ListStatefulSets(ctx context.Context, namespace string, options ...Option) (*appsv1beta1.StatefulSetList, error)

func (*AppsV1Beta1) UpdateDeployment added in v0.3.0

func (c *AppsV1Beta1) UpdateDeployment(ctx context.Context, obj *appsv1beta1.Deployment) (*appsv1beta1.Deployment, error)

func (*AppsV1Beta1) UpdateScale added in v0.3.0

func (c *AppsV1Beta1) UpdateScale(ctx context.Context, obj *appsv1beta1.Scale) (*appsv1beta1.Scale, error)

func (*AppsV1Beta1) UpdateStatefulSet

func (c *AppsV1Beta1) UpdateStatefulSet(ctx context.Context, obj *appsv1beta1.StatefulSet) (*appsv1beta1.StatefulSet, error)

func (*AppsV1Beta1) WatchDeployments added in v0.3.0

func (c *AppsV1Beta1) WatchDeployments(ctx context.Context, namespace string, options ...Option) (*AppsV1Beta1DeploymentWatcher, error)

func (*AppsV1Beta1) WatchStatefulSets

func (c *AppsV1Beta1) WatchStatefulSets(ctx context.Context, namespace string, options ...Option) (*AppsV1Beta1StatefulSetWatcher, error)

type AppsV1Beta1DeploymentWatcher added in v0.3.0

type AppsV1Beta1DeploymentWatcher struct {
	// contains filtered or unexported fields
}

func (*AppsV1Beta1DeploymentWatcher) Close added in v0.3.0

func (*AppsV1Beta1DeploymentWatcher) Next added in v0.3.0

type AppsV1Beta1StatefulSetWatcher

type AppsV1Beta1StatefulSetWatcher struct {
	// contains filtered or unexported fields
}

func (*AppsV1Beta1StatefulSetWatcher) Close

func (*AppsV1Beta1StatefulSetWatcher) Next

type AuthInfo

type AuthInfo struct {
	// ClientCertificate is the path to a client cert file for TLS.
	// +optional
	ClientCertificate string `json:"client-certificate,omitempty"`
	// ClientCertificateData contains PEM-encoded data from a client cert file for TLS. Overrides ClientCertificate
	// +optional
	ClientCertificateData []byte `json:"client-certificate-data,omitempty"`
	// ClientKey is the path to a client key file for TLS.
	// +optional
	ClientKey string `json:"client-key,omitempty"`
	// ClientKeyData contains PEM-encoded data from a client key file for TLS. Overrides ClientKey
	// +optional
	ClientKeyData []byte `json:"client-key-data,omitempty"`
	// Token is the bearer token for authentication to the kubernetes cluster.
	// +optional
	Token string `json:"token,omitempty"`
	// TokenFile is a pointer to a file that contains a bearer token (as described above).  If both Token and TokenFile are present, Token takes precedence.
	// +optional
	TokenFile string `json:"tokenFile,omitempty"`
	// Impersonate is the username to imperonate.  The name matches the flag.
	// +optional
	Impersonate string `json:"as,omitempty"`
	// Username is the username for basic authentication to the kubernetes cluster.
	// +optional
	Username string `json:"username,omitempty"`
	// Password is the password for basic authentication to the kubernetes cluster.
	// +optional
	Password string `json:"password,omitempty"`
	// AuthProvider specifies a custom authentication plugin for the kubernetes cluster.
	// +optional
	AuthProvider *AuthProviderConfig `json:"auth-provider,omitempty"`
	// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
	// +optional
	Extensions []NamedExtension `json:"extensions,omitempty"`
}

AuthInfo contains information that describes identity information. This is use to tell the kubernetes cluster who you are.

type AuthProviderConfig

type AuthProviderConfig struct {
	Name   string            `json:"name"`
	Config map[string]string `json:"config"`
}

AuthProviderConfig holds the configuration for a specified auth provider.

type AuthenticationV1 added in v0.3.0

type AuthenticationV1 struct {
	// contains filtered or unexported fields
}

AuthenticationV1 is a client for interacting with the authentication.k8s.io/v1 API group.

func (*AuthenticationV1) CreateTokenReview added in v0.3.0

func (*AuthenticationV1) DeleteTokenReview added in v0.3.0

func (c *AuthenticationV1) DeleteTokenReview(ctx context.Context, name string) error

func (*AuthenticationV1) GetTokenReview added in v0.3.0

func (c *AuthenticationV1) GetTokenReview(ctx context.Context, name string) (*authenticationv1.TokenReview, error)

func (*AuthenticationV1) UpdateTokenReview added in v0.3.0

type AuthenticationV1Beta1

type AuthenticationV1Beta1 struct {
	// contains filtered or unexported fields
}

AuthenticationV1Beta1 is a client for interacting with the authentication.k8s.io/v1beta1 API group.

func (*AuthenticationV1Beta1) CreateTokenReview

func (*AuthenticationV1Beta1) DeleteTokenReview

func (c *AuthenticationV1Beta1) DeleteTokenReview(ctx context.Context, name string) error

func (*AuthenticationV1Beta1) GetTokenReview

func (*AuthenticationV1Beta1) UpdateTokenReview

type AuthorizationV1 added in v0.3.0

type AuthorizationV1 struct {
	// contains filtered or unexported fields
}

AuthorizationV1 is a client for interacting with the authorization.k8s.io/v1 API group.

func (*AuthorizationV1) CreateLocalSubjectAccessReview added in v0.3.0

func (*AuthorizationV1) CreateSelfSubjectAccessReview added in v0.3.0

func (*AuthorizationV1) CreateSubjectAccessReview added in v0.3.0

func (*AuthorizationV1) DeleteLocalSubjectAccessReview added in v0.3.0

func (c *AuthorizationV1) DeleteLocalSubjectAccessReview(ctx context.Context, name string, namespace string) error

func (*AuthorizationV1) DeleteSelfSubjectAccessReview added in v0.3.0

func (c *AuthorizationV1) DeleteSelfSubjectAccessReview(ctx context.Context, name string) error

func (*AuthorizationV1) DeleteSubjectAccessReview added in v0.3.0

func (c *AuthorizationV1) DeleteSubjectAccessReview(ctx context.Context, name string) error

func (*AuthorizationV1) GetLocalSubjectAccessReview added in v0.3.0

func (c *AuthorizationV1) GetLocalSubjectAccessReview(ctx context.Context, name, namespace string) (*authorizationv1.LocalSubjectAccessReview, error)

func (*AuthorizationV1) GetSelfSubjectAccessReview added in v0.3.0

func (c *AuthorizationV1) GetSelfSubjectAccessReview(ctx context.Context, name string) (*authorizationv1.SelfSubjectAccessReview, error)

func (*AuthorizationV1) GetSubjectAccessReview added in v0.3.0

func (c *AuthorizationV1) GetSubjectAccessReview(ctx context.Context, name string) (*authorizationv1.SubjectAccessReview, error)

func (*AuthorizationV1) UpdateLocalSubjectAccessReview added in v0.3.0

func (*AuthorizationV1) UpdateSelfSubjectAccessReview added in v0.3.0

func (*AuthorizationV1) UpdateSubjectAccessReview added in v0.3.0

type AuthorizationV1Beta1

type AuthorizationV1Beta1 struct {
	// contains filtered or unexported fields
}

AuthorizationV1Beta1 is a client for interacting with the authorization.k8s.io/v1beta1 API group.

func (*AuthorizationV1Beta1) DeleteLocalSubjectAccessReview

func (c *AuthorizationV1Beta1) DeleteLocalSubjectAccessReview(ctx context.Context, name string, namespace string) error

func (*AuthorizationV1Beta1) DeleteSelfSubjectAccessReview

func (c *AuthorizationV1Beta1) DeleteSelfSubjectAccessReview(ctx context.Context, name string) error

func (*AuthorizationV1Beta1) DeleteSubjectAccessReview

func (c *AuthorizationV1Beta1) DeleteSubjectAccessReview(ctx context.Context, name string) error

func (*AuthorizationV1Beta1) GetLocalSubjectAccessReview

func (c *AuthorizationV1Beta1) GetLocalSubjectAccessReview(ctx context.Context, name, namespace string) (*authorizationv1beta1.LocalSubjectAccessReview, error)

func (*AuthorizationV1Beta1) GetSelfSubjectAccessReview

func (c *AuthorizationV1Beta1) GetSelfSubjectAccessReview(ctx context.Context, name string) (*authorizationv1beta1.SelfSubjectAccessReview, error)

func (*AuthorizationV1Beta1) GetSubjectAccessReview

func (c *AuthorizationV1Beta1) GetSubjectAccessReview(ctx context.Context, name string) (*authorizationv1beta1.SubjectAccessReview, error)

type AutoscalingV1

type AutoscalingV1 struct {
	// contains filtered or unexported fields
}

AutoscalingV1 is a client for interacting with the autoscaling/v1 API group.

func (*AutoscalingV1) CreateScale

func (c *AutoscalingV1) CreateScale(ctx context.Context, obj *autoscalingv1.Scale) (*autoscalingv1.Scale, error)

func (*AutoscalingV1) DeleteHorizontalPodAutoscaler

func (c *AutoscalingV1) DeleteHorizontalPodAutoscaler(ctx context.Context, name string, namespace string) error

func (*AutoscalingV1) DeleteScale

func (c *AutoscalingV1) DeleteScale(ctx context.Context, name string, namespace string) error

func (*AutoscalingV1) GetHorizontalPodAutoscaler

func (c *AutoscalingV1) GetHorizontalPodAutoscaler(ctx context.Context, name, namespace string) (*autoscalingv1.HorizontalPodAutoscaler, error)

func (*AutoscalingV1) GetScale

func (c *AutoscalingV1) GetScale(ctx context.Context, name, namespace string) (*autoscalingv1.Scale, error)

func (*AutoscalingV1) ListHorizontalPodAutoscalers

func (c *AutoscalingV1) ListHorizontalPodAutoscalers(ctx context.Context, namespace string, options ...Option) (*autoscalingv1.HorizontalPodAutoscalerList, error)

func (*AutoscalingV1) UpdateScale

func (c *AutoscalingV1) UpdateScale(ctx context.Context, obj *autoscalingv1.Scale) (*autoscalingv1.Scale, error)

func (*AutoscalingV1) WatchHorizontalPodAutoscalers

func (c *AutoscalingV1) WatchHorizontalPodAutoscalers(ctx context.Context, namespace string, options ...Option) (*AutoscalingV1HorizontalPodAutoscalerWatcher, error)

type AutoscalingV1HorizontalPodAutoscalerWatcher

type AutoscalingV1HorizontalPodAutoscalerWatcher struct {
	// contains filtered or unexported fields
}

func (*AutoscalingV1HorizontalPodAutoscalerWatcher) Close

func (*AutoscalingV1HorizontalPodAutoscalerWatcher) Next

type AutoscalingV2Alpha1 added in v0.3.0

type AutoscalingV2Alpha1 struct {
	// contains filtered or unexported fields
}

AutoscalingV2Alpha1 is a client for interacting with the autoscaling/v2alpha1 API group.

func (*AutoscalingV2Alpha1) CreateHorizontalPodAutoscaler added in v0.3.0

func (*AutoscalingV2Alpha1) DeleteHorizontalPodAutoscaler added in v0.3.0

func (c *AutoscalingV2Alpha1) DeleteHorizontalPodAutoscaler(ctx context.Context, name string, namespace string) error

func (*AutoscalingV2Alpha1) GetHorizontalPodAutoscaler added in v0.3.0

func (c *AutoscalingV2Alpha1) GetHorizontalPodAutoscaler(ctx context.Context, name, namespace string) (*autoscalingv2alpha1.HorizontalPodAutoscaler, error)

func (*AutoscalingV2Alpha1) ListHorizontalPodAutoscalers added in v0.3.0

func (c *AutoscalingV2Alpha1) ListHorizontalPodAutoscalers(ctx context.Context, namespace string, options ...Option) (*autoscalingv2alpha1.HorizontalPodAutoscalerList, error)

func (*AutoscalingV2Alpha1) UpdateHorizontalPodAutoscaler added in v0.3.0

func (*AutoscalingV2Alpha1) WatchHorizontalPodAutoscalers added in v0.3.0

func (c *AutoscalingV2Alpha1) WatchHorizontalPodAutoscalers(ctx context.Context, namespace string, options ...Option) (*AutoscalingV2Alpha1HorizontalPodAutoscalerWatcher, error)

type AutoscalingV2Alpha1HorizontalPodAutoscalerWatcher added in v0.3.0

type AutoscalingV2Alpha1HorizontalPodAutoscalerWatcher struct {
	// contains filtered or unexported fields
}

func (*AutoscalingV2Alpha1HorizontalPodAutoscalerWatcher) Close added in v0.3.0

func (*AutoscalingV2Alpha1HorizontalPodAutoscalerWatcher) Next added in v0.3.0

type BatchV1

type BatchV1 struct {
	// contains filtered or unexported fields
}

BatchV1 is a client for interacting with the batch/v1 API group.

func (*BatchV1) CreateJob

func (c *BatchV1) CreateJob(ctx context.Context, obj *batchv1.Job) (*batchv1.Job, error)

func (*BatchV1) DeleteJob

func (c *BatchV1) DeleteJob(ctx context.Context, name string, namespace string) error

func (*BatchV1) GetJob

func (c *BatchV1) GetJob(ctx context.Context, name, namespace string) (*batchv1.Job, error)

func (*BatchV1) ListJobs

func (c *BatchV1) ListJobs(ctx context.Context, namespace string, options ...Option) (*batchv1.JobList, error)

func (*BatchV1) UpdateJob

func (c *BatchV1) UpdateJob(ctx context.Context, obj *batchv1.Job) (*batchv1.Job, error)

func (*BatchV1) WatchJobs

func (c *BatchV1) WatchJobs(ctx context.Context, namespace string, options ...Option) (*BatchV1JobWatcher, error)

type BatchV1JobWatcher

type BatchV1JobWatcher struct {
	// contains filtered or unexported fields
}

func (*BatchV1JobWatcher) Close

func (w *BatchV1JobWatcher) Close() error

func (*BatchV1JobWatcher) Next

type BatchV2Alpha1

type BatchV2Alpha1 struct {
	// contains filtered or unexported fields
}

BatchV2Alpha1 is a client for interacting with the batch/v2alpha1 API group.

func (*BatchV2Alpha1) CreateCronJob

func (c *BatchV2Alpha1) CreateCronJob(ctx context.Context, obj *batchv2alpha1.CronJob) (*batchv2alpha1.CronJob, error)

func (*BatchV2Alpha1) CreateJobTemplate

func (*BatchV2Alpha1) DeleteCronJob

func (c *BatchV2Alpha1) DeleteCronJob(ctx context.Context, name string, namespace string) error

func (*BatchV2Alpha1) DeleteJobTemplate

func (c *BatchV2Alpha1) DeleteJobTemplate(ctx context.Context, name string, namespace string) error

func (*BatchV2Alpha1) GetCronJob

func (c *BatchV2Alpha1) GetCronJob(ctx context.Context, name, namespace string) (*batchv2alpha1.CronJob, error)

func (*BatchV2Alpha1) GetJobTemplate

func (c *BatchV2Alpha1) GetJobTemplate(ctx context.Context, name, namespace string) (*batchv2alpha1.JobTemplate, error)

func (*BatchV2Alpha1) ListCronJobs

func (c *BatchV2Alpha1) ListCronJobs(ctx context.Context, namespace string, options ...Option) (*batchv2alpha1.CronJobList, error)

func (*BatchV2Alpha1) UpdateCronJob

func (c *BatchV2Alpha1) UpdateCronJob(ctx context.Context, obj *batchv2alpha1.CronJob) (*batchv2alpha1.CronJob, error)

func (*BatchV2Alpha1) UpdateJobTemplate

func (*BatchV2Alpha1) WatchCronJobs

func (c *BatchV2Alpha1) WatchCronJobs(ctx context.Context, namespace string, options ...Option) (*BatchV2Alpha1CronJobWatcher, error)

type BatchV2Alpha1CronJobWatcher

type BatchV2Alpha1CronJobWatcher struct {
	// contains filtered or unexported fields
}

func (*BatchV2Alpha1CronJobWatcher) Close

func (*BatchV2Alpha1CronJobWatcher) Next

type CertificatesV1Alpha1

type CertificatesV1Alpha1 struct {
	// contains filtered or unexported fields
}

CertificatesV1Alpha1 is a client for interacting with the certificates.k8s.io/v1alpha1 API group.

func (*CertificatesV1Alpha1) DeleteCertificateSigningRequest

func (c *CertificatesV1Alpha1) DeleteCertificateSigningRequest(ctx context.Context, name string) error

func (*CertificatesV1Alpha1) GetCertificateSigningRequest

func (c *CertificatesV1Alpha1) GetCertificateSigningRequest(ctx context.Context, name string) (*certificatesv1alpha1.CertificateSigningRequest, error)

func (*CertificatesV1Alpha1) ListCertificateSigningRequests

func (c *CertificatesV1Alpha1) ListCertificateSigningRequests(ctx context.Context, options ...Option) (*certificatesv1alpha1.CertificateSigningRequestList, error)

func (*CertificatesV1Alpha1) WatchCertificateSigningRequests

func (c *CertificatesV1Alpha1) WatchCertificateSigningRequests(ctx context.Context, options ...Option) (*CertificatesV1Alpha1CertificateSigningRequestWatcher, error)

type CertificatesV1Alpha1CertificateSigningRequestWatcher

type CertificatesV1Alpha1CertificateSigningRequestWatcher struct {
	// contains filtered or unexported fields
}

func (*CertificatesV1Alpha1CertificateSigningRequestWatcher) Close

func (*CertificatesV1Alpha1CertificateSigningRequestWatcher) Next

type CertificatesV1Beta1 added in v0.3.0

type CertificatesV1Beta1 struct {
	// contains filtered or unexported fields
}

CertificatesV1Beta1 is a client for interacting with the certificates.k8s.io/v1beta1 API group.

func (*CertificatesV1Beta1) CreateCertificateSigningRequest added in v0.3.0

func (*CertificatesV1Beta1) DeleteCertificateSigningRequest added in v0.3.0

func (c *CertificatesV1Beta1) DeleteCertificateSigningRequest(ctx context.Context, name string) error

func (*CertificatesV1Beta1) GetCertificateSigningRequest added in v0.3.0

func (c *CertificatesV1Beta1) GetCertificateSigningRequest(ctx context.Context, name string) (*certificatesv1beta1.CertificateSigningRequest, error)

func (*CertificatesV1Beta1) ListCertificateSigningRequests added in v0.3.0

func (c *CertificatesV1Beta1) ListCertificateSigningRequests(ctx context.Context, options ...Option) (*certificatesv1beta1.CertificateSigningRequestList, error)

func (*CertificatesV1Beta1) UpdateCertificateSigningRequest added in v0.3.0

func (*CertificatesV1Beta1) WatchCertificateSigningRequests added in v0.3.0

func (c *CertificatesV1Beta1) WatchCertificateSigningRequests(ctx context.Context, options ...Option) (*CertificatesV1Beta1CertificateSigningRequestWatcher, error)

type CertificatesV1Beta1CertificateSigningRequestWatcher added in v0.3.0

type CertificatesV1Beta1CertificateSigningRequestWatcher struct {
	// contains filtered or unexported fields
}

func (*CertificatesV1Beta1CertificateSigningRequestWatcher) Close added in v0.3.0

func (*CertificatesV1Beta1CertificateSigningRequestWatcher) Next added in v0.3.0

type Client

type Client struct {
	// The URL of the API server.
	Endpoint string

	// Default namespaces for objects that don't supply a namespace in
	// their object metadata.
	Namespace string

	// SetHeaders provides a hook for modifying the HTTP headers of all requests.
	//
	//		client, err := k8s.NewClient(config)
	//		if err != nil {
	//			// handle error
	//		}
	//		client.SetHeaders = func(h http.Header) error {
	//			h.Set("Authorization", "Bearer "+mytoken)
	//			return nil
	//		}
	//
	SetHeaders func(h http.Header) error

	Client *http.Client
}

Client is a Kuberntes client.

func NewClient

func NewClient(config *Config) (*Client, error)

NewClient initializes a client from a client config.

func NewInClusterClient

func NewInClusterClient() (*Client, error)

NewInClusterClient returns a client that uses the service account bearer token mounted into Kubernetes pods.

func (*Client) AppsV1Alpha1

func (c *Client) AppsV1Alpha1() *AppsV1Alpha1

AppsV1Alpha1 returns a client for interacting with the apps/v1alpha1 API group.

func (*Client) AppsV1Beta1

func (c *Client) AppsV1Beta1() *AppsV1Beta1

AppsV1Beta1 returns a client for interacting with the apps/v1beta1 API group.

func (*Client) AuthenticationV1 added in v0.3.0

func (c *Client) AuthenticationV1() *AuthenticationV1

AuthenticationV1 returns a client for interacting with the authentication.k8s.io/v1 API group.

func (*Client) AuthenticationV1Beta1

func (c *Client) AuthenticationV1Beta1() *AuthenticationV1Beta1

AuthenticationV1Beta1 returns a client for interacting with the authentication.k8s.io/v1beta1 API group.

func (*Client) AuthorizationV1 added in v0.3.0

func (c *Client) AuthorizationV1() *AuthorizationV1

AuthorizationV1 returns a client for interacting with the authorization.k8s.io/v1 API group.

func (*Client) AuthorizationV1Beta1

func (c *Client) AuthorizationV1Beta1() *AuthorizationV1Beta1

AuthorizationV1Beta1 returns a client for interacting with the authorization.k8s.io/v1beta1 API group.

func (*Client) AutoscalingV1

func (c *Client) AutoscalingV1() *AutoscalingV1

AutoscalingV1 returns a client for interacting with the autoscaling/v1 API group.

func (*Client) AutoscalingV2Alpha1 added in v0.3.0

func (c *Client) AutoscalingV2Alpha1() *AutoscalingV2Alpha1

AutoscalingV2Alpha1 returns a client for interacting with the autoscaling/v2alpha1 API group.

func (*Client) BatchV1

func (c *Client) BatchV1() *BatchV1

BatchV1 returns a client for interacting with the batch/v1 API group.

func (*Client) BatchV2Alpha1

func (c *Client) BatchV2Alpha1() *BatchV2Alpha1

BatchV2Alpha1 returns a client for interacting with the batch/v2alpha1 API group.

func (*Client) CertificatesV1Alpha1

func (c *Client) CertificatesV1Alpha1() *CertificatesV1Alpha1

CertificatesV1Alpha1 returns a client for interacting with the certificates.k8s.io/v1alpha1 API group.

func (*Client) CertificatesV1Beta1 added in v0.3.0

func (c *Client) CertificatesV1Beta1() *CertificatesV1Beta1

CertificatesV1Beta1 returns a client for interacting with the certificates.k8s.io/v1beta1 API group.

func (*Client) CoreV1

func (c *Client) CoreV1() *CoreV1

CoreV1 returns a client for interacting with the /v1 API group.

func (*Client) Discovery

func (c *Client) Discovery() *Discovery

func (*Client) ExtensionsV1Beta1

func (c *Client) ExtensionsV1Beta1() *ExtensionsV1Beta1

ExtensionsV1Beta1 returns a client for interacting with the extensions/v1beta1 API group.

func (*Client) ImagepolicyV1Alpha1

func (c *Client) ImagepolicyV1Alpha1() *ImagepolicyV1Alpha1

ImagepolicyV1Alpha1 returns a client for interacting with the imagepolicy/v1alpha1 API group.

func (*Client) PolicyV1Alpha1

func (c *Client) PolicyV1Alpha1() *PolicyV1Alpha1

PolicyV1Alpha1 returns a client for interacting with the policy/v1alpha1 API group.

func (*Client) PolicyV1Beta1

func (c *Client) PolicyV1Beta1() *PolicyV1Beta1

PolicyV1Beta1 returns a client for interacting with the policy/v1beta1 API group.

func (*Client) RBACV1Alpha1

func (c *Client) RBACV1Alpha1() *RBACV1Alpha1

RBACV1Alpha1 returns a client for interacting with the rbac.authorization.k8s.io/v1alpha1 API group.

func (*Client) RBACV1Beta1 added in v0.3.0

func (c *Client) RBACV1Beta1() *RBACV1Beta1

RBACV1Beta1 returns a client for interacting with the rbac.authorization.k8s.io/v1beta1 API group.

func (*Client) SettingsV1Alpha1 added in v0.3.0

func (c *Client) SettingsV1Alpha1() *SettingsV1Alpha1

SettingsV1Alpha1 returns a client for interacting with the settings/v1alpha1 API group.

func (*Client) StorageV1 added in v0.3.0

func (c *Client) StorageV1() *StorageV1

StorageV1 returns a client for interacting with the storage.k8s.io/v1 API group.

func (*Client) StorageV1Beta1

func (c *Client) StorageV1Beta1() *StorageV1Beta1

StorageV1Beta1 returns a client for interacting with the storage.k8s.io/v1beta1 API group.

func (*Client) ThirdPartyResources

func (c *Client) ThirdPartyResources(apiGroup, apiVersion string) *ThirdPartyResources

ThirdPartyResources returns a client for interacting with a ThirdPartyResource API group.

type Cluster

type Cluster struct {
	// Server is the address of the kubernetes cluster (https://hostname:port).
	Server string `json:"server"`
	// APIVersion is the preferred api version for communicating with the kubernetes cluster (v1, v2, etc).
	// +optional
	APIVersion string `json:"api-version,omitempty"`
	// InsecureSkipTLSVerify skips the validity check for the server's certificate. This will make your HTTPS connections insecure.
	// +optional
	InsecureSkipTLSVerify bool `json:"insecure-skip-tls-verify,omitempty"`
	// CertificateAuthority is the path to a cert file for the certificate authority.
	// +optional
	CertificateAuthority string `json:"certificate-authority,omitempty"`
	// CertificateAuthorityData contains PEM-encoded certificate authority certificates. Overrides CertificateAuthority
	// +optional
	CertificateAuthorityData []byte `json:"certificate-authority-data,omitempty"`
	// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
	// +optional
	Extensions []NamedExtension `json:"extensions,omitempty"`
}

Cluster contains information about how to communicate with a kubernetes cluster

type Config

type Config struct {
	// Legacy field from pkg/api/types.go TypeMeta.
	// TODO(jlowdermilk): remove this after eliminating downstream dependencies.
	// +optional
	Kind string `json:"kind,omitempty"`
	// DEPRECATED: APIVersion is the preferred api version for communicating with the kubernetes cluster (v1, v2, etc).
	// Because a cluster can run multiple API groups and potentially multiple versions of each, it no longer makes sense to specify
	// a single value for the cluster version.
	// This field isn't really needed anyway, so we are deprecating it without replacement.
	// It will be ignored if it is present.
	// +optional
	APIVersion string `json:"apiVersion,omitempty"`
	// Preferences holds general information to be use for cli interactions
	Preferences Preferences `json:"preferences"`
	// Clusters is a map of referencable names to cluster configs
	Clusters []NamedCluster `json:"clusters"`
	// AuthInfos is a map of referencable names to user configs
	AuthInfos []NamedAuthInfo `json:"users"`
	// Contexts is a map of referencable names to context configs
	Contexts []NamedContext `json:"contexts"`
	// CurrentContext is the name of the context that you would like to use by default
	CurrentContext string `json:"current-context"`
	// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
	// +optional
	Extensions []NamedExtension `json:"extensions,omitempty"`
}

Config holds the information needed to build connect to remote kubernetes clusters as a given user

type Context

type Context struct {
	// Cluster is the name of the cluster for this context
	Cluster string `json:"cluster"`
	// AuthInfo is the name of the authInfo for this context
	AuthInfo string `json:"user"`
	// Namespace is the default namespace to use on unspecified requests
	// +optional
	Namespace string `json:"namespace,omitempty"`
	// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
	// +optional
	Extensions []NamedExtension `json:"extensions,omitempty"`
}

Context is a tuple of references to a cluster (how do I communicate with a kubernetes cluster), a user (how do I identify myself), and a namespace (what subset of resources do I want to work with)

type CoreV1

type CoreV1 struct {
	// contains filtered or unexported fields
}

CoreV1 is a client for interacting with the /v1 API group.

func (*CoreV1) CreateBinding

func (c *CoreV1) CreateBinding(ctx context.Context, obj *apiv1.Binding) (*apiv1.Binding, error)

func (*CoreV1) CreateComponentStatus

func (c *CoreV1) CreateComponentStatus(ctx context.Context, obj *apiv1.ComponentStatus) (*apiv1.ComponentStatus, error)

func (*CoreV1) CreateConfigMap

func (c *CoreV1) CreateConfigMap(ctx context.Context, obj *apiv1.ConfigMap) (*apiv1.ConfigMap, error)

func (*CoreV1) CreateEndpoints

func (c *CoreV1) CreateEndpoints(ctx context.Context, obj *apiv1.Endpoints) (*apiv1.Endpoints, error)

func (*CoreV1) CreateEvent

func (c *CoreV1) CreateEvent(ctx context.Context, obj *apiv1.Event) (*apiv1.Event, error)

func (*CoreV1) CreateLimitRange

func (c *CoreV1) CreateLimitRange(ctx context.Context, obj *apiv1.LimitRange) (*apiv1.LimitRange, error)

func (*CoreV1) CreateNamespace

func (c *CoreV1) CreateNamespace(ctx context.Context, obj *apiv1.Namespace) (*apiv1.Namespace, error)

func (*CoreV1) CreateNode

func (c *CoreV1) CreateNode(ctx context.Context, obj *apiv1.Node) (*apiv1.Node, error)

func (*CoreV1) CreatePersistentVolume

func (c *CoreV1) CreatePersistentVolume(ctx context.Context, obj *apiv1.PersistentVolume) (*apiv1.PersistentVolume, error)

func (*CoreV1) CreatePersistentVolumeClaim

func (c *CoreV1) CreatePersistentVolumeClaim(ctx context.Context, obj *apiv1.PersistentVolumeClaim) (*apiv1.PersistentVolumeClaim, error)

func (*CoreV1) CreatePod

func (c *CoreV1) CreatePod(ctx context.Context, obj *apiv1.Pod) (*apiv1.Pod, error)

func (*CoreV1) CreatePodStatusResult

func (c *CoreV1) CreatePodStatusResult(ctx context.Context, obj *apiv1.PodStatusResult) (*apiv1.PodStatusResult, error)

func (*CoreV1) CreatePodTemplate

func (c *CoreV1) CreatePodTemplate(ctx context.Context, obj *apiv1.PodTemplate) (*apiv1.PodTemplate, error)

func (*CoreV1) CreatePodTemplateSpec

func (c *CoreV1) CreatePodTemplateSpec(ctx context.Context, obj *apiv1.PodTemplateSpec) (*apiv1.PodTemplateSpec, error)

func (*CoreV1) CreateRangeAllocation

func (c *CoreV1) CreateRangeAllocation(ctx context.Context, obj *apiv1.RangeAllocation) (*apiv1.RangeAllocation, error)

func (*CoreV1) CreateReplicationController

func (c *CoreV1) CreateReplicationController(ctx context.Context, obj *apiv1.ReplicationController) (*apiv1.ReplicationController, error)

func (*CoreV1) CreateResourceQuota

func (c *CoreV1) CreateResourceQuota(ctx context.Context, obj *apiv1.ResourceQuota) (*apiv1.ResourceQuota, error)

func (*CoreV1) CreateSecret

func (c *CoreV1) CreateSecret(ctx context.Context, obj *apiv1.Secret) (*apiv1.Secret, error)

func (*CoreV1) CreateService

func (c *CoreV1) CreateService(ctx context.Context, obj *apiv1.Service) (*apiv1.Service, error)

func (*CoreV1) CreateServiceAccount

func (c *CoreV1) CreateServiceAccount(ctx context.Context, obj *apiv1.ServiceAccount) (*apiv1.ServiceAccount, error)

func (*CoreV1) DeleteBinding

func (c *CoreV1) DeleteBinding(ctx context.Context, name string, namespace string) error

func (*CoreV1) DeleteComponentStatus

func (c *CoreV1) DeleteComponentStatus(ctx context.Context, name string) error

func (*CoreV1) DeleteConfigMap

func (c *CoreV1) DeleteConfigMap(ctx context.Context, name string, namespace string) error

func (*CoreV1) DeleteEndpoints

func (c *CoreV1) DeleteEndpoints(ctx context.Context, name string, namespace string) error

func (*CoreV1) DeleteEvent

func (c *CoreV1) DeleteEvent(ctx context.Context, name string, namespace string) error

func (*CoreV1) DeleteLimitRange

func (c *CoreV1) DeleteLimitRange(ctx context.Context, name string, namespace string) error

func (*CoreV1) DeleteNamespace

func (c *CoreV1) DeleteNamespace(ctx context.Context, name string) error

func (*CoreV1) DeleteNode

func (c *CoreV1) DeleteNode(ctx context.Context, name string) error

func (*CoreV1) DeletePersistentVolume

func (c *CoreV1) DeletePersistentVolume(ctx context.Context, name string) error

func (*CoreV1) DeletePersistentVolumeClaim

func (c *CoreV1) DeletePersistentVolumeClaim(ctx context.Context, name string, namespace string) error

func (*CoreV1) DeletePod

func (c *CoreV1) DeletePod(ctx context.Context, name string, namespace string) error

func (*CoreV1) DeletePodStatusResult

func (c *CoreV1) DeletePodStatusResult(ctx context.Context, name string, namespace string) error

func (*CoreV1) DeletePodTemplate

func (c *CoreV1) DeletePodTemplate(ctx context.Context, name string, namespace string) error

func (*CoreV1) DeletePodTemplateSpec

func (c *CoreV1) DeletePodTemplateSpec(ctx context.Context, name string, namespace string) error

func (*CoreV1) DeleteRangeAllocation

func (c *CoreV1) DeleteRangeAllocation(ctx context.Context, name string, namespace string) error

func (*CoreV1) DeleteReplicationController

func (c *CoreV1) DeleteReplicationController(ctx context.Context, name string, namespace string) error

func (*CoreV1) DeleteResourceQuota

func (c *CoreV1) DeleteResourceQuota(ctx context.Context, name string, namespace string) error

func (*CoreV1) DeleteSecret

func (c *CoreV1) DeleteSecret(ctx context.Context, name string, namespace string) error

func (*CoreV1) DeleteService

func (c *CoreV1) DeleteService(ctx context.Context, name string, namespace string) error

func (*CoreV1) DeleteServiceAccount

func (c *CoreV1) DeleteServiceAccount(ctx context.Context, name string, namespace string) error

func (*CoreV1) GetBinding

func (c *CoreV1) GetBinding(ctx context.Context, name, namespace string) (*apiv1.Binding, error)

func (*CoreV1) GetComponentStatus

func (c *CoreV1) GetComponentStatus(ctx context.Context, name string) (*apiv1.ComponentStatus, error)

func (*CoreV1) GetConfigMap

func (c *CoreV1) GetConfigMap(ctx context.Context, name, namespace string) (*apiv1.ConfigMap, error)

func (*CoreV1) GetEndpoints

func (c *CoreV1) GetEndpoints(ctx context.Context, name, namespace string) (*apiv1.Endpoints, error)

func (*CoreV1) GetEvent

func (c *CoreV1) GetEvent(ctx context.Context, name, namespace string) (*apiv1.Event, error)

func (*CoreV1) GetLimitRange

func (c *CoreV1) GetLimitRange(ctx context.Context, name, namespace string) (*apiv1.LimitRange, error)

func (*CoreV1) GetNamespace

func (c *CoreV1) GetNamespace(ctx context.Context, name string) (*apiv1.Namespace, error)

func (*CoreV1) GetNode

func (c *CoreV1) GetNode(ctx context.Context, name string) (*apiv1.Node, error)

func (*CoreV1) GetPersistentVolume

func (c *CoreV1) GetPersistentVolume(ctx context.Context, name string) (*apiv1.PersistentVolume, error)

func (*CoreV1) GetPersistentVolumeClaim

func (c *CoreV1) GetPersistentVolumeClaim(ctx context.Context, name, namespace string) (*apiv1.PersistentVolumeClaim, error)

func (*CoreV1) GetPod

func (c *CoreV1) GetPod(ctx context.Context, name, namespace string) (*apiv1.Pod, error)

func (*CoreV1) GetPodStatusResult

func (c *CoreV1) GetPodStatusResult(ctx context.Context, name, namespace string) (*apiv1.PodStatusResult, error)

func (*CoreV1) GetPodTemplate

func (c *CoreV1) GetPodTemplate(ctx context.Context, name, namespace string) (*apiv1.PodTemplate, error)

func (*CoreV1) GetPodTemplateSpec

func (c *CoreV1) GetPodTemplateSpec(ctx context.Context, name, namespace string) (*apiv1.PodTemplateSpec, error)

func (*CoreV1) GetRangeAllocation

func (c *CoreV1) GetRangeAllocation(ctx context.Context, name, namespace string) (*apiv1.RangeAllocation, error)

func (*CoreV1) GetReplicationController

func (c *CoreV1) GetReplicationController(ctx context.Context, name, namespace string) (*apiv1.ReplicationController, error)

func (*CoreV1) GetResourceQuota

func (c *CoreV1) GetResourceQuota(ctx context.Context, name, namespace string) (*apiv1.ResourceQuota, error)

func (*CoreV1) GetSecret

func (c *CoreV1) GetSecret(ctx context.Context, name, namespace string) (*apiv1.Secret, error)

func (*CoreV1) GetService

func (c *CoreV1) GetService(ctx context.Context, name, namespace string) (*apiv1.Service, error)

func (*CoreV1) GetServiceAccount

func (c *CoreV1) GetServiceAccount(ctx context.Context, name, namespace string) (*apiv1.ServiceAccount, error)

func (*CoreV1) ListComponentStatuses

func (c *CoreV1) ListComponentStatuses(ctx context.Context, options ...Option) (*apiv1.ComponentStatusList, error)

func (*CoreV1) ListConfigMaps

func (c *CoreV1) ListConfigMaps(ctx context.Context, namespace string, options ...Option) (*apiv1.ConfigMapList, error)

func (*CoreV1) ListEndpoints added in v0.2.0

func (c *CoreV1) ListEndpoints(ctx context.Context, namespace string, options ...Option) (*apiv1.EndpointsList, error)

func (*CoreV1) ListEvents

func (c *CoreV1) ListEvents(ctx context.Context, namespace string, options ...Option) (*apiv1.EventList, error)

func (*CoreV1) ListLimitRanges

func (c *CoreV1) ListLimitRanges(ctx context.Context, namespace string, options ...Option) (*apiv1.LimitRangeList, error)

func (*CoreV1) ListNamespaces

func (c *CoreV1) ListNamespaces(ctx context.Context, options ...Option) (*apiv1.NamespaceList, error)

func (*CoreV1) ListNodes

func (c *CoreV1) ListNodes(ctx context.Context, options ...Option) (*apiv1.NodeList, error)

func (*CoreV1) ListPersistentVolumeClaims

func (c *CoreV1) ListPersistentVolumeClaims(ctx context.Context, namespace string, options ...Option) (*apiv1.PersistentVolumeClaimList, error)

func (*CoreV1) ListPersistentVolumes

func (c *CoreV1) ListPersistentVolumes(ctx context.Context, options ...Option) (*apiv1.PersistentVolumeList, error)

func (*CoreV1) ListPodTemplates

func (c *CoreV1) ListPodTemplates(ctx context.Context, namespace string, options ...Option) (*apiv1.PodTemplateList, error)

func (*CoreV1) ListPods

func (c *CoreV1) ListPods(ctx context.Context, namespace string, options ...Option) (*apiv1.PodList, error)

func (*CoreV1) ListReplicationControllers

func (c *CoreV1) ListReplicationControllers(ctx context.Context, namespace string, options ...Option) (*apiv1.ReplicationControllerList, error)

func (*CoreV1) ListResourceQuotas

func (c *CoreV1) ListResourceQuotas(ctx context.Context, namespace string, options ...Option) (*apiv1.ResourceQuotaList, error)

func (*CoreV1) ListSecrets

func (c *CoreV1) ListSecrets(ctx context.Context, namespace string, options ...Option) (*apiv1.SecretList, error)

func (*CoreV1) ListServiceAccounts

func (c *CoreV1) ListServiceAccounts(ctx context.Context, namespace string, options ...Option) (*apiv1.ServiceAccountList, error)

func (*CoreV1) ListServices

func (c *CoreV1) ListServices(ctx context.Context, namespace string, options ...Option) (*apiv1.ServiceList, error)

func (*CoreV1) UpdateBinding

func (c *CoreV1) UpdateBinding(ctx context.Context, obj *apiv1.Binding) (*apiv1.Binding, error)

func (*CoreV1) UpdateComponentStatus

func (c *CoreV1) UpdateComponentStatus(ctx context.Context, obj *apiv1.ComponentStatus) (*apiv1.ComponentStatus, error)

func (*CoreV1) UpdateConfigMap

func (c *CoreV1) UpdateConfigMap(ctx context.Context, obj *apiv1.ConfigMap) (*apiv1.ConfigMap, error)

func (*CoreV1) UpdateEndpoints

func (c *CoreV1) UpdateEndpoints(ctx context.Context, obj *apiv1.Endpoints) (*apiv1.Endpoints, error)

func (*CoreV1) UpdateEvent

func (c *CoreV1) UpdateEvent(ctx context.Context, obj *apiv1.Event) (*apiv1.Event, error)

func (*CoreV1) UpdateLimitRange

func (c *CoreV1) UpdateLimitRange(ctx context.Context, obj *apiv1.LimitRange) (*apiv1.LimitRange, error)

func (*CoreV1) UpdateNamespace

func (c *CoreV1) UpdateNamespace(ctx context.Context, obj *apiv1.Namespace) (*apiv1.Namespace, error)

func (*CoreV1) UpdateNode

func (c *CoreV1) UpdateNode(ctx context.Context, obj *apiv1.Node) (*apiv1.Node, error)

func (*CoreV1) UpdatePersistentVolume

func (c *CoreV1) UpdatePersistentVolume(ctx context.Context, obj *apiv1.PersistentVolume) (*apiv1.PersistentVolume, error)

func (*CoreV1) UpdatePersistentVolumeClaim

func (c *CoreV1) UpdatePersistentVolumeClaim(ctx context.Context, obj *apiv1.PersistentVolumeClaim) (*apiv1.PersistentVolumeClaim, error)

func (*CoreV1) UpdatePod

func (c *CoreV1) UpdatePod(ctx context.Context, obj *apiv1.Pod) (*apiv1.Pod, error)

func (*CoreV1) UpdatePodStatusResult

func (c *CoreV1) UpdatePodStatusResult(ctx context.Context, obj *apiv1.PodStatusResult) (*apiv1.PodStatusResult, error)

func (*CoreV1) UpdatePodTemplate

func (c *CoreV1) UpdatePodTemplate(ctx context.Context, obj *apiv1.PodTemplate) (*apiv1.PodTemplate, error)

func (*CoreV1) UpdatePodTemplateSpec

func (c *CoreV1) UpdatePodTemplateSpec(ctx context.Context, obj *apiv1.PodTemplateSpec) (*apiv1.PodTemplateSpec, error)

func (*CoreV1) UpdateRangeAllocation

func (c *CoreV1) UpdateRangeAllocation(ctx context.Context, obj *apiv1.RangeAllocation) (*apiv1.RangeAllocation, error)

func (*CoreV1) UpdateReplicationController

func (c *CoreV1) UpdateReplicationController(ctx context.Context, obj *apiv1.ReplicationController) (*apiv1.ReplicationController, error)

func (*CoreV1) UpdateResourceQuota

func (c *CoreV1) UpdateResourceQuota(ctx context.Context, obj *apiv1.ResourceQuota) (*apiv1.ResourceQuota, error)

func (*CoreV1) UpdateSecret

func (c *CoreV1) UpdateSecret(ctx context.Context, obj *apiv1.Secret) (*apiv1.Secret, error)

func (*CoreV1) UpdateService

func (c *CoreV1) UpdateService(ctx context.Context, obj *apiv1.Service) (*apiv1.Service, error)

func (*CoreV1) UpdateServiceAccount

func (c *CoreV1) UpdateServiceAccount(ctx context.Context, obj *apiv1.ServiceAccount) (*apiv1.ServiceAccount, error)

func (*CoreV1) WatchComponentStatuses

func (c *CoreV1) WatchComponentStatuses(ctx context.Context, options ...Option) (*CoreV1ComponentStatusWatcher, error)

func (*CoreV1) WatchConfigMaps

func (c *CoreV1) WatchConfigMaps(ctx context.Context, namespace string, options ...Option) (*CoreV1ConfigMapWatcher, error)

func (*CoreV1) WatchEndpoints added in v0.2.0

func (c *CoreV1) WatchEndpoints(ctx context.Context, namespace string, options ...Option) (*CoreV1EndpointsWatcher, error)

func (*CoreV1) WatchEvents

func (c *CoreV1) WatchEvents(ctx context.Context, namespace string, options ...Option) (*CoreV1EventWatcher, error)

func (*CoreV1) WatchLimitRanges

func (c *CoreV1) WatchLimitRanges(ctx context.Context, namespace string, options ...Option) (*CoreV1LimitRangeWatcher, error)

func (*CoreV1) WatchNamespaces

func (c *CoreV1) WatchNamespaces(ctx context.Context, options ...Option) (*CoreV1NamespaceWatcher, error)

func (*CoreV1) WatchNodes

func (c *CoreV1) WatchNodes(ctx context.Context, options ...Option) (*CoreV1NodeWatcher, error)

func (*CoreV1) WatchPersistentVolumeClaims

func (c *CoreV1) WatchPersistentVolumeClaims(ctx context.Context, namespace string, options ...Option) (*CoreV1PersistentVolumeClaimWatcher, error)

func (*CoreV1) WatchPersistentVolumes

func (c *CoreV1) WatchPersistentVolumes(ctx context.Context, options ...Option) (*CoreV1PersistentVolumeWatcher, error)

func (*CoreV1) WatchPodTemplates

func (c *CoreV1) WatchPodTemplates(ctx context.Context, namespace string, options ...Option) (*CoreV1PodTemplateWatcher, error)

func (*CoreV1) WatchPods

func (c *CoreV1) WatchPods(ctx context.Context, namespace string, options ...Option) (*CoreV1PodWatcher, error)

func (*CoreV1) WatchReplicationControllers

func (c *CoreV1) WatchReplicationControllers(ctx context.Context, namespace string, options ...Option) (*CoreV1ReplicationControllerWatcher, error)

func (*CoreV1) WatchResourceQuotas

func (c *CoreV1) WatchResourceQuotas(ctx context.Context, namespace string, options ...Option) (*CoreV1ResourceQuotaWatcher, error)

func (*CoreV1) WatchSecrets

func (c *CoreV1) WatchSecrets(ctx context.Context, namespace string, options ...Option) (*CoreV1SecretWatcher, error)

func (*CoreV1) WatchServiceAccounts

func (c *CoreV1) WatchServiceAccounts(ctx context.Context, namespace string, options ...Option) (*CoreV1ServiceAccountWatcher, error)

func (*CoreV1) WatchServices

func (c *CoreV1) WatchServices(ctx context.Context, namespace string, options ...Option) (*CoreV1ServiceWatcher, error)

type CoreV1ComponentStatusWatcher

type CoreV1ComponentStatusWatcher struct {
	// contains filtered or unexported fields
}

func (*CoreV1ComponentStatusWatcher) Close

func (*CoreV1ComponentStatusWatcher) Next

type CoreV1ConfigMapWatcher

type CoreV1ConfigMapWatcher struct {
	// contains filtered or unexported fields
}

func (*CoreV1ConfigMapWatcher) Close

func (w *CoreV1ConfigMapWatcher) Close() error

func (*CoreV1ConfigMapWatcher) Next

type CoreV1EndpointsWatcher

type CoreV1EndpointsWatcher struct {
	// contains filtered or unexported fields
}

func (*CoreV1EndpointsWatcher) Close

func (w *CoreV1EndpointsWatcher) Close() error

func (*CoreV1EndpointsWatcher) Next

type CoreV1EventWatcher

type CoreV1EventWatcher struct {
	// contains filtered or unexported fields
}

func (*CoreV1EventWatcher) Close

func (w *CoreV1EventWatcher) Close() error

func (*CoreV1EventWatcher) Next

type CoreV1LimitRangeWatcher

type CoreV1LimitRangeWatcher struct {
	// contains filtered or unexported fields
}

func (*CoreV1LimitRangeWatcher) Close

func (w *CoreV1LimitRangeWatcher) Close() error

func (*CoreV1LimitRangeWatcher) Next

type CoreV1NamespaceWatcher

type CoreV1NamespaceWatcher struct {
	// contains filtered or unexported fields
}

func (*CoreV1NamespaceWatcher) Close

func (w *CoreV1NamespaceWatcher) Close() error

func (*CoreV1NamespaceWatcher) Next

type CoreV1NodeWatcher

type CoreV1NodeWatcher struct {
	// contains filtered or unexported fields
}

func (*CoreV1NodeWatcher) Close

func (w *CoreV1NodeWatcher) Close() error

func (*CoreV1NodeWatcher) Next

func (w *CoreV1NodeWatcher) Next() (*versioned.Event, *apiv1.Node, error)

type CoreV1PersistentVolumeClaimWatcher

type CoreV1PersistentVolumeClaimWatcher struct {
	// contains filtered or unexported fields
}

func (*CoreV1PersistentVolumeClaimWatcher) Close

func (*CoreV1PersistentVolumeClaimWatcher) Next

type CoreV1PersistentVolumeWatcher

type CoreV1PersistentVolumeWatcher struct {
	// contains filtered or unexported fields
}

func (*CoreV1PersistentVolumeWatcher) Close

func (*CoreV1PersistentVolumeWatcher) Next

type CoreV1PodTemplateWatcher

type CoreV1PodTemplateWatcher struct {
	// contains filtered or unexported fields
}

func (*CoreV1PodTemplateWatcher) Close

func (w *CoreV1PodTemplateWatcher) Close() error

func (*CoreV1PodTemplateWatcher) Next

type CoreV1PodWatcher

type CoreV1PodWatcher struct {
	// contains filtered or unexported fields
}

func (*CoreV1PodWatcher) Close

func (w *CoreV1PodWatcher) Close() error

func (*CoreV1PodWatcher) Next

func (w *CoreV1PodWatcher) Next() (*versioned.Event, *apiv1.Pod, error)

type CoreV1ReplicationControllerWatcher

type CoreV1ReplicationControllerWatcher struct {
	// contains filtered or unexported fields
}

func (*CoreV1ReplicationControllerWatcher) Close

func (*CoreV1ReplicationControllerWatcher) Next

type CoreV1ResourceQuotaWatcher

type CoreV1ResourceQuotaWatcher struct {
	// contains filtered or unexported fields
}

func (*CoreV1ResourceQuotaWatcher) Close

func (w *CoreV1ResourceQuotaWatcher) Close() error

func (*CoreV1ResourceQuotaWatcher) Next

type CoreV1SecretWatcher

type CoreV1SecretWatcher struct {
	// contains filtered or unexported fields
}

func (*CoreV1SecretWatcher) Close

func (w *CoreV1SecretWatcher) Close() error

func (*CoreV1SecretWatcher) Next

type CoreV1ServiceAccountWatcher

type CoreV1ServiceAccountWatcher struct {
	// contains filtered or unexported fields
}

func (*CoreV1ServiceAccountWatcher) Close

func (*CoreV1ServiceAccountWatcher) Next

type CoreV1ServiceWatcher

type CoreV1ServiceWatcher struct {
	// contains filtered or unexported fields
}

func (*CoreV1ServiceWatcher) Close

func (w *CoreV1ServiceWatcher) Close() error

func (*CoreV1ServiceWatcher) Next

type Discovery

type Discovery struct {
	// contains filtered or unexported fields
}

Discovery is a client used to determine the API version and supported resources of the server.

func (*Discovery) APIGroup

func (d *Discovery) APIGroup(ctx context.Context, name string) (*unversioned.APIGroup, error)

func (*Discovery) APIGroups

func (d *Discovery) APIGroups(ctx context.Context) (*unversioned.APIGroupList, error)

func (*Discovery) APIResources

func (d *Discovery) APIResources(ctx context.Context, groupName, groupVersion string) (*unversioned.APIResourceList, error)

func (*Discovery) Version

func (d *Discovery) Version(ctx context.Context) (*Version, error)

type ExtensionsV1Beta1

type ExtensionsV1Beta1 struct {
	// contains filtered or unexported fields
}

ExtensionsV1Beta1 is a client for interacting with the extensions/v1beta1 API group.

func (*ExtensionsV1Beta1) CreateDaemonSet

func (*ExtensionsV1Beta1) CreateDeployment

func (*ExtensionsV1Beta1) CreateIngress

func (*ExtensionsV1Beta1) CreateNetworkPolicy

func (*ExtensionsV1Beta1) CreatePodSecurityPolicy

func (*ExtensionsV1Beta1) CreateReplicaSet

func (*ExtensionsV1Beta1) CreateScale

func (*ExtensionsV1Beta1) DeleteDaemonSet

func (c *ExtensionsV1Beta1) DeleteDaemonSet(ctx context.Context, name string, namespace string) error

func (*ExtensionsV1Beta1) DeleteDeployment

func (c *ExtensionsV1Beta1) DeleteDeployment(ctx context.Context, name string, namespace string) error

func (*ExtensionsV1Beta1) DeleteIngress

func (c *ExtensionsV1Beta1) DeleteIngress(ctx context.Context, name string, namespace string) error

func (*ExtensionsV1Beta1) DeleteNetworkPolicy

func (c *ExtensionsV1Beta1) DeleteNetworkPolicy(ctx context.Context, name string, namespace string) error

func (*ExtensionsV1Beta1) DeletePodSecurityPolicy

func (c *ExtensionsV1Beta1) DeletePodSecurityPolicy(ctx context.Context, name string) error

func (*ExtensionsV1Beta1) DeleteReplicaSet

func (c *ExtensionsV1Beta1) DeleteReplicaSet(ctx context.Context, name string, namespace string) error

func (*ExtensionsV1Beta1) DeleteScale

func (c *ExtensionsV1Beta1) DeleteScale(ctx context.Context, name string, namespace string) error

func (*ExtensionsV1Beta1) DeleteThirdPartyResource

func (c *ExtensionsV1Beta1) DeleteThirdPartyResource(ctx context.Context, name string) error

func (*ExtensionsV1Beta1) DeleteThirdPartyResourceData

func (c *ExtensionsV1Beta1) DeleteThirdPartyResourceData(ctx context.Context, name string, namespace string) error

func (*ExtensionsV1Beta1) GetDaemonSet

func (c *ExtensionsV1Beta1) GetDaemonSet(ctx context.Context, name, namespace string) (*extensionsv1beta1.DaemonSet, error)

func (*ExtensionsV1Beta1) GetDeployment

func (c *ExtensionsV1Beta1) GetDeployment(ctx context.Context, name, namespace string) (*extensionsv1beta1.Deployment, error)

func (*ExtensionsV1Beta1) GetIngress

func (c *ExtensionsV1Beta1) GetIngress(ctx context.Context, name, namespace string) (*extensionsv1beta1.Ingress, error)

func (*ExtensionsV1Beta1) GetNetworkPolicy

func (c *ExtensionsV1Beta1) GetNetworkPolicy(ctx context.Context, name, namespace string) (*extensionsv1beta1.NetworkPolicy, error)

func (*ExtensionsV1Beta1) GetPodSecurityPolicy

func (c *ExtensionsV1Beta1) GetPodSecurityPolicy(ctx context.Context, name string) (*extensionsv1beta1.PodSecurityPolicy, error)

func (*ExtensionsV1Beta1) GetReplicaSet

func (c *ExtensionsV1Beta1) GetReplicaSet(ctx context.Context, name, namespace string) (*extensionsv1beta1.ReplicaSet, error)

func (*ExtensionsV1Beta1) GetScale

func (c *ExtensionsV1Beta1) GetScale(ctx context.Context, name, namespace string) (*extensionsv1beta1.Scale, error)

func (*ExtensionsV1Beta1) GetThirdPartyResource

func (c *ExtensionsV1Beta1) GetThirdPartyResource(ctx context.Context, name string) (*extensionsv1beta1.ThirdPartyResource, error)

func (*ExtensionsV1Beta1) GetThirdPartyResourceData

func (c *ExtensionsV1Beta1) GetThirdPartyResourceData(ctx context.Context, name, namespace string) (*extensionsv1beta1.ThirdPartyResourceData, error)

func (*ExtensionsV1Beta1) ListDaemonSets

func (c *ExtensionsV1Beta1) ListDaemonSets(ctx context.Context, namespace string, options ...Option) (*extensionsv1beta1.DaemonSetList, error)

func (*ExtensionsV1Beta1) ListDeployments

func (c *ExtensionsV1Beta1) ListDeployments(ctx context.Context, namespace string, options ...Option) (*extensionsv1beta1.DeploymentList, error)

func (*ExtensionsV1Beta1) ListIngresses

func (c *ExtensionsV1Beta1) ListIngresses(ctx context.Context, namespace string, options ...Option) (*extensionsv1beta1.IngressList, error)

func (*ExtensionsV1Beta1) ListNetworkPolicies

func (c *ExtensionsV1Beta1) ListNetworkPolicies(ctx context.Context, namespace string, options ...Option) (*extensionsv1beta1.NetworkPolicyList, error)

func (*ExtensionsV1Beta1) ListPodSecurityPolicies

func (c *ExtensionsV1Beta1) ListPodSecurityPolicies(ctx context.Context, options ...Option) (*extensionsv1beta1.PodSecurityPolicyList, error)

func (*ExtensionsV1Beta1) ListReplicaSets

func (c *ExtensionsV1Beta1) ListReplicaSets(ctx context.Context, namespace string, options ...Option) (*extensionsv1beta1.ReplicaSetList, error)

func (*ExtensionsV1Beta1) ListThirdPartyResourceDatas

func (c *ExtensionsV1Beta1) ListThirdPartyResourceDatas(ctx context.Context, namespace string, options ...Option) (*extensionsv1beta1.ThirdPartyResourceDataList, error)

func (*ExtensionsV1Beta1) ListThirdPartyResources

func (c *ExtensionsV1Beta1) ListThirdPartyResources(ctx context.Context, options ...Option) (*extensionsv1beta1.ThirdPartyResourceList, error)

func (*ExtensionsV1Beta1) UpdateDaemonSet

func (*ExtensionsV1Beta1) UpdateDeployment

func (*ExtensionsV1Beta1) UpdateIngress

func (*ExtensionsV1Beta1) UpdateNetworkPolicy

func (*ExtensionsV1Beta1) UpdatePodSecurityPolicy

func (*ExtensionsV1Beta1) UpdateReplicaSet

func (*ExtensionsV1Beta1) UpdateScale

func (*ExtensionsV1Beta1) WatchDaemonSets

func (c *ExtensionsV1Beta1) WatchDaemonSets(ctx context.Context, namespace string, options ...Option) (*ExtensionsV1Beta1DaemonSetWatcher, error)

func (*ExtensionsV1Beta1) WatchDeployments

func (c *ExtensionsV1Beta1) WatchDeployments(ctx context.Context, namespace string, options ...Option) (*ExtensionsV1Beta1DeploymentWatcher, error)

func (*ExtensionsV1Beta1) WatchIngresses

func (c *ExtensionsV1Beta1) WatchIngresses(ctx context.Context, namespace string, options ...Option) (*ExtensionsV1Beta1IngressWatcher, error)

func (*ExtensionsV1Beta1) WatchNetworkPolicies

func (c *ExtensionsV1Beta1) WatchNetworkPolicies(ctx context.Context, namespace string, options ...Option) (*ExtensionsV1Beta1NetworkPolicyWatcher, error)

func (*ExtensionsV1Beta1) WatchPodSecurityPolicies

func (c *ExtensionsV1Beta1) WatchPodSecurityPolicies(ctx context.Context, options ...Option) (*ExtensionsV1Beta1PodSecurityPolicyWatcher, error)

func (*ExtensionsV1Beta1) WatchReplicaSets

func (c *ExtensionsV1Beta1) WatchReplicaSets(ctx context.Context, namespace string, options ...Option) (*ExtensionsV1Beta1ReplicaSetWatcher, error)

func (*ExtensionsV1Beta1) WatchThirdPartyResourceDatas

func (c *ExtensionsV1Beta1) WatchThirdPartyResourceDatas(ctx context.Context, namespace string, options ...Option) (*ExtensionsV1Beta1ThirdPartyResourceDataWatcher, error)

func (*ExtensionsV1Beta1) WatchThirdPartyResources

func (c *ExtensionsV1Beta1) WatchThirdPartyResources(ctx context.Context, options ...Option) (*ExtensionsV1Beta1ThirdPartyResourceWatcher, error)

type ExtensionsV1Beta1DaemonSetWatcher

type ExtensionsV1Beta1DaemonSetWatcher struct {
	// contains filtered or unexported fields
}

func (*ExtensionsV1Beta1DaemonSetWatcher) Close

func (*ExtensionsV1Beta1DaemonSetWatcher) Next

type ExtensionsV1Beta1DeploymentWatcher

type ExtensionsV1Beta1DeploymentWatcher struct {
	// contains filtered or unexported fields
}

func (*ExtensionsV1Beta1DeploymentWatcher) Close

func (*ExtensionsV1Beta1DeploymentWatcher) Next

type ExtensionsV1Beta1IngressWatcher

type ExtensionsV1Beta1IngressWatcher struct {
	// contains filtered or unexported fields
}

func (*ExtensionsV1Beta1IngressWatcher) Close

func (*ExtensionsV1Beta1IngressWatcher) Next

type ExtensionsV1Beta1NetworkPolicyWatcher

type ExtensionsV1Beta1NetworkPolicyWatcher struct {
	// contains filtered or unexported fields
}

func (*ExtensionsV1Beta1NetworkPolicyWatcher) Close

func (*ExtensionsV1Beta1NetworkPolicyWatcher) Next

type ExtensionsV1Beta1PodSecurityPolicyWatcher

type ExtensionsV1Beta1PodSecurityPolicyWatcher struct {
	// contains filtered or unexported fields
}

func (*ExtensionsV1Beta1PodSecurityPolicyWatcher) Close

func (*ExtensionsV1Beta1PodSecurityPolicyWatcher) Next

type ExtensionsV1Beta1ReplicaSetWatcher

type ExtensionsV1Beta1ReplicaSetWatcher struct {
	// contains filtered or unexported fields
}

func (*ExtensionsV1Beta1ReplicaSetWatcher) Close

func (*ExtensionsV1Beta1ReplicaSetWatcher) Next

type ExtensionsV1Beta1ThirdPartyResourceDataWatcher

type ExtensionsV1Beta1ThirdPartyResourceDataWatcher struct {
	// contains filtered or unexported fields
}

func (*ExtensionsV1Beta1ThirdPartyResourceDataWatcher) Close

func (*ExtensionsV1Beta1ThirdPartyResourceDataWatcher) Next

type ExtensionsV1Beta1ThirdPartyResourceWatcher

type ExtensionsV1Beta1ThirdPartyResourceWatcher struct {
	// contains filtered or unexported fields
}

func (*ExtensionsV1Beta1ThirdPartyResourceWatcher) Close

func (*ExtensionsV1Beta1ThirdPartyResourceWatcher) Next

type ImagepolicyV1Alpha1

type ImagepolicyV1Alpha1 struct {
	// contains filtered or unexported fields
}

ImagepolicyV1Alpha1 is a client for interacting with the imagepolicy/v1alpha1 API group.

func (*ImagepolicyV1Alpha1) CreateImageReview

func (*ImagepolicyV1Alpha1) DeleteImageReview

func (c *ImagepolicyV1Alpha1) DeleteImageReview(ctx context.Context, name string) error

func (*ImagepolicyV1Alpha1) GetImageReview

func (*ImagepolicyV1Alpha1) UpdateImageReview

type LabelSelector

type LabelSelector struct {
	// contains filtered or unexported fields
}

LabelSelector represents a Kubernetes label selector.

Any values that don't conform to Kubernetes label value restrictions will be silently dropped.

l := new(k8s.LabelSelector)
l.Eq("component", "frontend")
l.In("type", "prod", "staging")

func (*LabelSelector) Eq

func (l *LabelSelector) Eq(key, val string)

Eq selects labels which have the key and the key has the provide value.

func (*LabelSelector) In

func (l *LabelSelector) In(key string, vals ...string)

In selects labels which have the key and the key has one of the provided values.

func (*LabelSelector) NotEq

func (l *LabelSelector) NotEq(key, val string)

NotEq selects labels where the key is present and has a different value than the value provided.

func (*LabelSelector) NotIn

func (l *LabelSelector) NotIn(key string, vals ...string)

NotIn selects labels which have the key and the key is not one of the provided values.

func (*LabelSelector) Selector

func (l *LabelSelector) Selector() Option

type NamedAuthInfo

type NamedAuthInfo struct {
	// Name is the nickname for this AuthInfo
	Name string `json:"name"`
	// AuthInfo holds the auth information
	AuthInfo AuthInfo `json:"user"`
}

NamedAuthInfo relates nicknames to auth information

type NamedCluster

type NamedCluster struct {
	// Name is the nickname for this Cluster
	Name string `json:"name"`
	// Cluster holds the cluster information
	Cluster Cluster `json:"cluster"`
}

NamedCluster relates nicknames to cluster information

type NamedContext

type NamedContext struct {
	// Name is the nickname for this Context
	Name string `json:"name"`
	// Context holds the context information
	Context Context `json:"context"`
}

NamedContext relates nicknames to context information

type NamedExtension

type NamedExtension struct {
	// Name is the nickname for this Extension
	Name string `json:"name"`
	// Extension holds the extension information
	Extension runtime.RawExtension `json:"extension"`
}

NamedExtension relates nicknames to extension information

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option represents optional call parameters, such as label selectors.

func ResourceVersion

func ResourceVersion(resourceVersion string) Option

ResourceVersion causes watch operations to only show changes since a particular version of a resource.

func Timeout

func Timeout(d time.Duration) Option

Timeout declares the timeout for list and watch operations. Timeout is only accurate to the second.

type PolicyV1Alpha1

type PolicyV1Alpha1 struct {
	// contains filtered or unexported fields
}

PolicyV1Alpha1 is a client for interacting with the policy/v1alpha1 API group.

func (*PolicyV1Alpha1) CreateEviction

func (*PolicyV1Alpha1) CreatePodDisruptionBudget

func (*PolicyV1Alpha1) DeleteEviction

func (c *PolicyV1Alpha1) DeleteEviction(ctx context.Context, name string, namespace string) error

func (*PolicyV1Alpha1) DeletePodDisruptionBudget

func (c *PolicyV1Alpha1) DeletePodDisruptionBudget(ctx context.Context, name string, namespace string) error

func (*PolicyV1Alpha1) GetEviction

func (c *PolicyV1Alpha1) GetEviction(ctx context.Context, name, namespace string) (*policyv1alpha1.Eviction, error)

func (*PolicyV1Alpha1) GetPodDisruptionBudget

func (c *PolicyV1Alpha1) GetPodDisruptionBudget(ctx context.Context, name, namespace string) (*policyv1alpha1.PodDisruptionBudget, error)

func (*PolicyV1Alpha1) ListPodDisruptionBudgets

func (c *PolicyV1Alpha1) ListPodDisruptionBudgets(ctx context.Context, namespace string, options ...Option) (*policyv1alpha1.PodDisruptionBudgetList, error)

func (*PolicyV1Alpha1) UpdateEviction

func (*PolicyV1Alpha1) UpdatePodDisruptionBudget

func (*PolicyV1Alpha1) WatchPodDisruptionBudgets

func (c *PolicyV1Alpha1) WatchPodDisruptionBudgets(ctx context.Context, namespace string, options ...Option) (*PolicyV1Alpha1PodDisruptionBudgetWatcher, error)

type PolicyV1Alpha1PodDisruptionBudgetWatcher

type PolicyV1Alpha1PodDisruptionBudgetWatcher struct {
	// contains filtered or unexported fields
}

func (*PolicyV1Alpha1PodDisruptionBudgetWatcher) Close

func (*PolicyV1Alpha1PodDisruptionBudgetWatcher) Next

type PolicyV1Beta1

type PolicyV1Beta1 struct {
	// contains filtered or unexported fields
}

PolicyV1Beta1 is a client for interacting with the policy/v1beta1 API group.

func (*PolicyV1Beta1) CreateEviction

func (*PolicyV1Beta1) CreatePodDisruptionBudget

func (*PolicyV1Beta1) DeleteEviction

func (c *PolicyV1Beta1) DeleteEviction(ctx context.Context, name string, namespace string) error

func (*PolicyV1Beta1) DeletePodDisruptionBudget

func (c *PolicyV1Beta1) DeletePodDisruptionBudget(ctx context.Context, name string, namespace string) error

func (*PolicyV1Beta1) GetEviction

func (c *PolicyV1Beta1) GetEviction(ctx context.Context, name, namespace string) (*policyv1beta1.Eviction, error)

func (*PolicyV1Beta1) GetPodDisruptionBudget

func (c *PolicyV1Beta1) GetPodDisruptionBudget(ctx context.Context, name, namespace string) (*policyv1beta1.PodDisruptionBudget, error)

func (*PolicyV1Beta1) ListPodDisruptionBudgets

func (c *PolicyV1Beta1) ListPodDisruptionBudgets(ctx context.Context, namespace string, options ...Option) (*policyv1beta1.PodDisruptionBudgetList, error)

func (*PolicyV1Beta1) UpdateEviction

func (*PolicyV1Beta1) UpdatePodDisruptionBudget

func (*PolicyV1Beta1) WatchPodDisruptionBudgets

func (c *PolicyV1Beta1) WatchPodDisruptionBudgets(ctx context.Context, namespace string, options ...Option) (*PolicyV1Beta1PodDisruptionBudgetWatcher, error)

type PolicyV1Beta1PodDisruptionBudgetWatcher

type PolicyV1Beta1PodDisruptionBudgetWatcher struct {
	// contains filtered or unexported fields
}

func (*PolicyV1Beta1PodDisruptionBudgetWatcher) Close

func (*PolicyV1Beta1PodDisruptionBudgetWatcher) Next

type Preferences

type Preferences struct {
	// +optional
	Colors bool `json:"colors,omitempty"`
	// Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields
	// +optional
	Extensions []NamedExtension `json:"extensions,omitempty"`
}

type RBACV1Alpha1

type RBACV1Alpha1 struct {
	// contains filtered or unexported fields
}

RBACV1Alpha1 is a client for interacting with the rbac.authorization.k8s.io/v1alpha1 API group.

func (*RBACV1Alpha1) CreateClusterRole

func (c *RBACV1Alpha1) CreateClusterRole(ctx context.Context, obj *rbacv1alpha1.ClusterRole) (*rbacv1alpha1.ClusterRole, error)

func (*RBACV1Alpha1) CreateClusterRoleBinding

func (*RBACV1Alpha1) CreateRole

func (c *RBACV1Alpha1) CreateRole(ctx context.Context, obj *rbacv1alpha1.Role) (*rbacv1alpha1.Role, error)

func (*RBACV1Alpha1) CreateRoleBinding

func (c *RBACV1Alpha1) CreateRoleBinding(ctx context.Context, obj *rbacv1alpha1.RoleBinding) (*rbacv1alpha1.RoleBinding, error)

func (*RBACV1Alpha1) DeleteClusterRole

func (c *RBACV1Alpha1) DeleteClusterRole(ctx context.Context, name string) error

func (*RBACV1Alpha1) DeleteClusterRoleBinding

func (c *RBACV1Alpha1) DeleteClusterRoleBinding(ctx context.Context, name string) error

func (*RBACV1Alpha1) DeleteRole

func (c *RBACV1Alpha1) DeleteRole(ctx context.Context, name string, namespace string) error

func (*RBACV1Alpha1) DeleteRoleBinding

func (c *RBACV1Alpha1) DeleteRoleBinding(ctx context.Context, name string, namespace string) error

func (*RBACV1Alpha1) GetClusterRole

func (c *RBACV1Alpha1) GetClusterRole(ctx context.Context, name string) (*rbacv1alpha1.ClusterRole, error)

func (*RBACV1Alpha1) GetClusterRoleBinding

func (c *RBACV1Alpha1) GetClusterRoleBinding(ctx context.Context, name string) (*rbacv1alpha1.ClusterRoleBinding, error)

func (*RBACV1Alpha1) GetRole

func (c *RBACV1Alpha1) GetRole(ctx context.Context, name, namespace string) (*rbacv1alpha1.Role, error)

func (*RBACV1Alpha1) GetRoleBinding

func (c *RBACV1Alpha1) GetRoleBinding(ctx context.Context, name, namespace string) (*rbacv1alpha1.RoleBinding, error)

func (*RBACV1Alpha1) ListClusterRoleBindings

func (c *RBACV1Alpha1) ListClusterRoleBindings(ctx context.Context, options ...Option) (*rbacv1alpha1.ClusterRoleBindingList, error)

func (*RBACV1Alpha1) ListClusterRoles

func (c *RBACV1Alpha1) ListClusterRoles(ctx context.Context, options ...Option) (*rbacv1alpha1.ClusterRoleList, error)

func (*RBACV1Alpha1) ListRoleBindings

func (c *RBACV1Alpha1) ListRoleBindings(ctx context.Context, namespace string, options ...Option) (*rbacv1alpha1.RoleBindingList, error)

func (*RBACV1Alpha1) ListRoles

func (c *RBACV1Alpha1) ListRoles(ctx context.Context, namespace string, options ...Option) (*rbacv1alpha1.RoleList, error)

func (*RBACV1Alpha1) UpdateClusterRole

func (c *RBACV1Alpha1) UpdateClusterRole(ctx context.Context, obj *rbacv1alpha1.ClusterRole) (*rbacv1alpha1.ClusterRole, error)

func (*RBACV1Alpha1) UpdateClusterRoleBinding

func (*RBACV1Alpha1) UpdateRole

func (c *RBACV1Alpha1) UpdateRole(ctx context.Context, obj *rbacv1alpha1.Role) (*rbacv1alpha1.Role, error)

func (*RBACV1Alpha1) UpdateRoleBinding

func (c *RBACV1Alpha1) UpdateRoleBinding(ctx context.Context, obj *rbacv1alpha1.RoleBinding) (*rbacv1alpha1.RoleBinding, error)

func (*RBACV1Alpha1) WatchClusterRoleBindings

func (c *RBACV1Alpha1) WatchClusterRoleBindings(ctx context.Context, options ...Option) (*RBACV1Alpha1ClusterRoleBindingWatcher, error)

func (*RBACV1Alpha1) WatchClusterRoles

func (c *RBACV1Alpha1) WatchClusterRoles(ctx context.Context, options ...Option) (*RBACV1Alpha1ClusterRoleWatcher, error)

func (*RBACV1Alpha1) WatchRoleBindings

func (c *RBACV1Alpha1) WatchRoleBindings(ctx context.Context, namespace string, options ...Option) (*RBACV1Alpha1RoleBindingWatcher, error)

func (*RBACV1Alpha1) WatchRoles

func (c *RBACV1Alpha1) WatchRoles(ctx context.Context, namespace string, options ...Option) (*RBACV1Alpha1RoleWatcher, error)

type RBACV1Alpha1ClusterRoleBindingWatcher

type RBACV1Alpha1ClusterRoleBindingWatcher struct {
	// contains filtered or unexported fields
}

func (*RBACV1Alpha1ClusterRoleBindingWatcher) Close

func (*RBACV1Alpha1ClusterRoleBindingWatcher) Next

type RBACV1Alpha1ClusterRoleWatcher

type RBACV1Alpha1ClusterRoleWatcher struct {
	// contains filtered or unexported fields
}

func (*RBACV1Alpha1ClusterRoleWatcher) Close

func (*RBACV1Alpha1ClusterRoleWatcher) Next

type RBACV1Alpha1RoleBindingWatcher

type RBACV1Alpha1RoleBindingWatcher struct {
	// contains filtered or unexported fields
}

func (*RBACV1Alpha1RoleBindingWatcher) Close

func (*RBACV1Alpha1RoleBindingWatcher) Next

type RBACV1Alpha1RoleWatcher

type RBACV1Alpha1RoleWatcher struct {
	// contains filtered or unexported fields
}

func (*RBACV1Alpha1RoleWatcher) Close

func (w *RBACV1Alpha1RoleWatcher) Close() error

func (*RBACV1Alpha1RoleWatcher) Next

type RBACV1Beta1 added in v0.3.0

type RBACV1Beta1 struct {
	// contains filtered or unexported fields
}

RBACV1Beta1 is a client for interacting with the rbac.authorization.k8s.io/v1beta1 API group.

func (*RBACV1Beta1) CreateClusterRole added in v0.3.0

func (c *RBACV1Beta1) CreateClusterRole(ctx context.Context, obj *rbacv1beta1.ClusterRole) (*rbacv1beta1.ClusterRole, error)

func (*RBACV1Beta1) CreateClusterRoleBinding added in v0.3.0

func (c *RBACV1Beta1) CreateClusterRoleBinding(ctx context.Context, obj *rbacv1beta1.ClusterRoleBinding) (*rbacv1beta1.ClusterRoleBinding, error)

func (*RBACV1Beta1) CreateRole added in v0.3.0

func (c *RBACV1Beta1) CreateRole(ctx context.Context, obj *rbacv1beta1.Role) (*rbacv1beta1.Role, error)

func (*RBACV1Beta1) CreateRoleBinding added in v0.3.0

func (c *RBACV1Beta1) CreateRoleBinding(ctx context.Context, obj *rbacv1beta1.RoleBinding) (*rbacv1beta1.RoleBinding, error)

func (*RBACV1Beta1) DeleteClusterRole added in v0.3.0

func (c *RBACV1Beta1) DeleteClusterRole(ctx context.Context, name string) error

func (*RBACV1Beta1) DeleteClusterRoleBinding added in v0.3.0

func (c *RBACV1Beta1) DeleteClusterRoleBinding(ctx context.Context, name string) error

func (*RBACV1Beta1) DeleteRole added in v0.3.0

func (c *RBACV1Beta1) DeleteRole(ctx context.Context, name string, namespace string) error

func (*RBACV1Beta1) DeleteRoleBinding added in v0.3.0

func (c *RBACV1Beta1) DeleteRoleBinding(ctx context.Context, name string, namespace string) error

func (*RBACV1Beta1) GetClusterRole added in v0.3.0

func (c *RBACV1Beta1) GetClusterRole(ctx context.Context, name string) (*rbacv1beta1.ClusterRole, error)

func (*RBACV1Beta1) GetClusterRoleBinding added in v0.3.0

func (c *RBACV1Beta1) GetClusterRoleBinding(ctx context.Context, name string) (*rbacv1beta1.ClusterRoleBinding, error)

func (*RBACV1Beta1) GetRole added in v0.3.0

func (c *RBACV1Beta1) GetRole(ctx context.Context, name, namespace string) (*rbacv1beta1.Role, error)

func (*RBACV1Beta1) GetRoleBinding added in v0.3.0

func (c *RBACV1Beta1) GetRoleBinding(ctx context.Context, name, namespace string) (*rbacv1beta1.RoleBinding, error)

func (*RBACV1Beta1) ListClusterRoleBindings added in v0.3.0

func (c *RBACV1Beta1) ListClusterRoleBindings(ctx context.Context, options ...Option) (*rbacv1beta1.ClusterRoleBindingList, error)

func (*RBACV1Beta1) ListClusterRoles added in v0.3.0

func (c *RBACV1Beta1) ListClusterRoles(ctx context.Context, options ...Option) (*rbacv1beta1.ClusterRoleList, error)

func (*RBACV1Beta1) ListRoleBindings added in v0.3.0

func (c *RBACV1Beta1) ListRoleBindings(ctx context.Context, namespace string, options ...Option) (*rbacv1beta1.RoleBindingList, error)

func (*RBACV1Beta1) ListRoles added in v0.3.0

func (c *RBACV1Beta1) ListRoles(ctx context.Context, namespace string, options ...Option) (*rbacv1beta1.RoleList, error)

func (*RBACV1Beta1) UpdateClusterRole added in v0.3.0

func (c *RBACV1Beta1) UpdateClusterRole(ctx context.Context, obj *rbacv1beta1.ClusterRole) (*rbacv1beta1.ClusterRole, error)

func (*RBACV1Beta1) UpdateClusterRoleBinding added in v0.3.0

func (c *RBACV1Beta1) UpdateClusterRoleBinding(ctx context.Context, obj *rbacv1beta1.ClusterRoleBinding) (*rbacv1beta1.ClusterRoleBinding, error)

func (*RBACV1Beta1) UpdateRole added in v0.3.0

func (c *RBACV1Beta1) UpdateRole(ctx context.Context, obj *rbacv1beta1.Role) (*rbacv1beta1.Role, error)

func (*RBACV1Beta1) UpdateRoleBinding added in v0.3.0

func (c *RBACV1Beta1) UpdateRoleBinding(ctx context.Context, obj *rbacv1beta1.RoleBinding) (*rbacv1beta1.RoleBinding, error)

func (*RBACV1Beta1) WatchClusterRoleBindings added in v0.3.0

func (c *RBACV1Beta1) WatchClusterRoleBindings(ctx context.Context, options ...Option) (*RBACV1Beta1ClusterRoleBindingWatcher, error)

func (*RBACV1Beta1) WatchClusterRoles added in v0.3.0

func (c *RBACV1Beta1) WatchClusterRoles(ctx context.Context, options ...Option) (*RBACV1Beta1ClusterRoleWatcher, error)

func (*RBACV1Beta1) WatchRoleBindings added in v0.3.0

func (c *RBACV1Beta1) WatchRoleBindings(ctx context.Context, namespace string, options ...Option) (*RBACV1Beta1RoleBindingWatcher, error)

func (*RBACV1Beta1) WatchRoles added in v0.3.0

func (c *RBACV1Beta1) WatchRoles(ctx context.Context, namespace string, options ...Option) (*RBACV1Beta1RoleWatcher, error)

type RBACV1Beta1ClusterRoleBindingWatcher added in v0.3.0

type RBACV1Beta1ClusterRoleBindingWatcher struct {
	// contains filtered or unexported fields
}

func (*RBACV1Beta1ClusterRoleBindingWatcher) Close added in v0.3.0

func (*RBACV1Beta1ClusterRoleBindingWatcher) Next added in v0.3.0

type RBACV1Beta1ClusterRoleWatcher added in v0.3.0

type RBACV1Beta1ClusterRoleWatcher struct {
	// contains filtered or unexported fields
}

func (*RBACV1Beta1ClusterRoleWatcher) Close added in v0.3.0

func (*RBACV1Beta1ClusterRoleWatcher) Next added in v0.3.0

type RBACV1Beta1RoleBindingWatcher added in v0.3.0

type RBACV1Beta1RoleBindingWatcher struct {
	// contains filtered or unexported fields
}

func (*RBACV1Beta1RoleBindingWatcher) Close added in v0.3.0

func (*RBACV1Beta1RoleBindingWatcher) Next added in v0.3.0

type RBACV1Beta1RoleWatcher added in v0.3.0

type RBACV1Beta1RoleWatcher struct {
	// contains filtered or unexported fields
}

func (*RBACV1Beta1RoleWatcher) Close added in v0.3.0

func (w *RBACV1Beta1RoleWatcher) Close() error

func (*RBACV1Beta1RoleWatcher) Next added in v0.3.0

type SettingsV1Alpha1 added in v0.3.0

type SettingsV1Alpha1 struct {
	// contains filtered or unexported fields
}

SettingsV1Alpha1 is a client for interacting with the settings/v1alpha1 API group.

func (*SettingsV1Alpha1) CreatePodPreset added in v0.3.0

func (*SettingsV1Alpha1) DeletePodPreset added in v0.3.0

func (c *SettingsV1Alpha1) DeletePodPreset(ctx context.Context, name string, namespace string) error

func (*SettingsV1Alpha1) GetPodPreset added in v0.3.0

func (c *SettingsV1Alpha1) GetPodPreset(ctx context.Context, name, namespace string) (*settingsv1alpha1.PodPreset, error)

func (*SettingsV1Alpha1) ListPodPresets added in v0.3.0

func (c *SettingsV1Alpha1) ListPodPresets(ctx context.Context, namespace string, options ...Option) (*settingsv1alpha1.PodPresetList, error)

func (*SettingsV1Alpha1) UpdatePodPreset added in v0.3.0

func (*SettingsV1Alpha1) WatchPodPresets added in v0.3.0

func (c *SettingsV1Alpha1) WatchPodPresets(ctx context.Context, namespace string, options ...Option) (*SettingsV1Alpha1PodPresetWatcher, error)

type SettingsV1Alpha1PodPresetWatcher added in v0.3.0

type SettingsV1Alpha1PodPresetWatcher struct {
	// contains filtered or unexported fields
}

func (*SettingsV1Alpha1PodPresetWatcher) Close added in v0.3.0

func (*SettingsV1Alpha1PodPresetWatcher) Next added in v0.3.0

type StorageV1 added in v0.3.0

type StorageV1 struct {
	// contains filtered or unexported fields
}

StorageV1 is a client for interacting with the storage.k8s.io/v1 API group.

func (*StorageV1) CreateStorageClass added in v0.3.0

func (c *StorageV1) CreateStorageClass(ctx context.Context, obj *storagev1.StorageClass) (*storagev1.StorageClass, error)

func (*StorageV1) DeleteStorageClass added in v0.3.0

func (c *StorageV1) DeleteStorageClass(ctx context.Context, name string) error

func (*StorageV1) GetStorageClass added in v0.3.0

func (c *StorageV1) GetStorageClass(ctx context.Context, name string) (*storagev1.StorageClass, error)

func (*StorageV1) ListStorageClasses added in v0.3.0

func (c *StorageV1) ListStorageClasses(ctx context.Context, options ...Option) (*storagev1.StorageClassList, error)

func (*StorageV1) UpdateStorageClass added in v0.3.0

func (c *StorageV1) UpdateStorageClass(ctx context.Context, obj *storagev1.StorageClass) (*storagev1.StorageClass, error)

func (*StorageV1) WatchStorageClasses added in v0.3.0

func (c *StorageV1) WatchStorageClasses(ctx context.Context, options ...Option) (*StorageV1StorageClassWatcher, error)

type StorageV1Beta1

type StorageV1Beta1 struct {
	// contains filtered or unexported fields
}

StorageV1Beta1 is a client for interacting with the storage.k8s.io/v1beta1 API group.

func (*StorageV1Beta1) CreateStorageClass

func (*StorageV1Beta1) DeleteStorageClass

func (c *StorageV1Beta1) DeleteStorageClass(ctx context.Context, name string) error

func (*StorageV1Beta1) GetStorageClass

func (c *StorageV1Beta1) GetStorageClass(ctx context.Context, name string) (*storagev1beta1.StorageClass, error)

func (*StorageV1Beta1) ListStorageClasses

func (c *StorageV1Beta1) ListStorageClasses(ctx context.Context, options ...Option) (*storagev1beta1.StorageClassList, error)

func (*StorageV1Beta1) UpdateStorageClass

func (*StorageV1Beta1) WatchStorageClasses

func (c *StorageV1Beta1) WatchStorageClasses(ctx context.Context, options ...Option) (*StorageV1Beta1StorageClassWatcher, error)

type StorageV1Beta1StorageClassWatcher

type StorageV1Beta1StorageClassWatcher struct {
	// contains filtered or unexported fields
}

func (*StorageV1Beta1StorageClassWatcher) Close

func (*StorageV1Beta1StorageClassWatcher) Next

type StorageV1StorageClassWatcher added in v0.3.0

type StorageV1StorageClassWatcher struct {
	// contains filtered or unexported fields
}

func (*StorageV1StorageClassWatcher) Close added in v0.3.0

func (*StorageV1StorageClassWatcher) Next added in v0.3.0

type ThirdPartyResources

type ThirdPartyResources struct {
	// contains filtered or unexported fields
}

ThirdPartyResources is a client used for interacting with user defined API groups. It uses JSON encoding instead of protobufs which are unsupported for these APIs.

Users are expected to define their own third party resources.

const metricsResource = "metrics"

// First, define a third party resources with TypeMeta
// and ObjectMeta fields.
type Metric struct {
	*unversioned.TypeMeta   `json:",inline"`
	*v1.ObjectMeta          `json:"metadata,omitempty"`

	Timestamp time.Time `json:"timestamp"`
	Value     []byte    `json:"value"`
}

// Define a list wrapper.
type MetricsList struct {
	*unversioned.TypeMeta `json:",inline"`
	*unversioned.ListMeta `json:"metadata,omitempty"`

	Items []Metric `json:"items"`
}

Register the new resource by creating a ThirdPartyResource type.

// Create a ThirdPartyResource
tpr := &v1beta1.ThirdPartyResource{
	Metadata: &v1.ObjectMeta{
		Name: k8s.String("metric.metrics.example.com"),
	},
	Description: k8s.String("A custom third party resource"),
	Versions:    []*v1beta1.APIVersion{
		{Name: k8s.String("v1")},
	},
}
_, err := client.ExtensionsV1Beta1().CreateThirdPartyResource(ctx, trp)
if err != nil {
	// handle error
}

After creating the resource type, create a ThirdPartyResources client then use interact with it like any other API group. For example to create a third party resource:

metricsClient := client.ThirdPartyResources("metrics.example.com", "v1")

metric := &Metric{
	ObjectMeta: &v1.ObjectMeta{
		Name: k8s.String("foo"),
	},
	Timestamp: time.Now(),
	Value:     42,
}

err = metricsClient.Create(ctx, metricsResource, client.Namespace, metric, metric)
if err != nil {
	// handle error
}

List a set of third party resources:

var metrics MetricsList
metricsClient.List(ctx, metricsResource, &metrics)

Or delete:

tprClient.Delete(ctx, metricsResource, client.Namespace, *metric.Name)

func (*ThirdPartyResources) Create

func (t *ThirdPartyResources) Create(ctx context.Context, resource, namespace string, req, resp interface{}) error

func (*ThirdPartyResources) Delete

func (t *ThirdPartyResources) Delete(ctx context.Context, resource, namespace, name string) error

func (*ThirdPartyResources) Get

func (t *ThirdPartyResources) Get(ctx context.Context, resource, namespace, name string, resp interface{}) error

func (*ThirdPartyResources) List

func (t *ThirdPartyResources) List(ctx context.Context, resource, namespace string, resp interface{}) error

func (*ThirdPartyResources) Update

func (t *ThirdPartyResources) Update(ctx context.Context, resource, namespace, name string, req, resp interface{}) error

type Version

type Version struct {
	Major        string `json:"major"`
	Minor        string `json:"minor"`
	GitVersion   string `json:"gitVersion"`
	GitCommit    string `json:"gitCommit"`
	GitTreeState string `json:"gitTreeState"`
	BuildDate    string `json:"buildDate"`
	GoVersion    string `json:"goVersion"`
	Compiler     string `json:"compiler"`
	Platform     string `json:"platform"`
}

Directories

Path Synopsis
api
resource
Package resource is a generated protocol buffer package.
Package resource is a generated protocol buffer package.
unversioned
Package unversioned is a generated protocol buffer package.
Package unversioned is a generated protocol buffer package.
v1
Package v1 is a generated protocol buffer package.
Package v1 is a generated protocol buffer package.
apis
apps/v1alpha1
Package v1alpha1 is a generated protocol buffer package.
Package v1alpha1 is a generated protocol buffer package.
apps/v1beta1
Package v1beta1 is a generated protocol buffer package.
Package v1beta1 is a generated protocol buffer package.
authentication/v1
Package v1 is a generated protocol buffer package.
Package v1 is a generated protocol buffer package.
authentication/v1beta1
Package v1beta1 is a generated protocol buffer package.
Package v1beta1 is a generated protocol buffer package.
authorization/v1
Package v1 is a generated protocol buffer package.
Package v1 is a generated protocol buffer package.
authorization/v1beta1
Package v1beta1 is a generated protocol buffer package.
Package v1beta1 is a generated protocol buffer package.
autoscaling/v1
Package v1 is a generated protocol buffer package.
Package v1 is a generated protocol buffer package.
autoscaling/v2alpha1
Package v2alpha1 is a generated protocol buffer package.
Package v2alpha1 is a generated protocol buffer package.
batch/v1
Package v1 is a generated protocol buffer package.
Package v1 is a generated protocol buffer package.
batch/v2alpha1
Package v2alpha1 is a generated protocol buffer package.
Package v2alpha1 is a generated protocol buffer package.
certificates/v1alpha1
Package v1alpha1 is a generated protocol buffer package.
Package v1alpha1 is a generated protocol buffer package.
certificates/v1beta1
Package v1beta1 is a generated protocol buffer package.
Package v1beta1 is a generated protocol buffer package.
extensions/v1beta1
Package v1beta1 is a generated protocol buffer package.
Package v1beta1 is a generated protocol buffer package.
imagepolicy/v1alpha1
Package v1alpha1 is a generated protocol buffer package.
Package v1alpha1 is a generated protocol buffer package.
meta/v1
Package v1 is a generated protocol buffer package.
Package v1 is a generated protocol buffer package.
policy/v1alpha1
Package v1alpha1 is a generated protocol buffer package.
Package v1alpha1 is a generated protocol buffer package.
policy/v1beta1
Package v1beta1 is a generated protocol buffer package.
Package v1beta1 is a generated protocol buffer package.
rbac/v1alpha1
Package v1alpha1 is a generated protocol buffer package.
Package v1alpha1 is a generated protocol buffer package.
rbac/v1beta1
Package v1beta1 is a generated protocol buffer package.
Package v1beta1 is a generated protocol buffer package.
settings/v1alpha1
Package v1alpha1 is a generated protocol buffer package.
Package v1alpha1 is a generated protocol buffer package.
storage/v1
Package v1 is a generated protocol buffer package.
Package v1 is a generated protocol buffer package.
storage/v1beta1
Package v1beta1 is a generated protocol buffer package.
Package v1beta1 is a generated protocol buffer package.
Package runtime is a generated protocol buffer package.
Package runtime is a generated protocol buffer package.
schema
Package schema is a generated protocol buffer package.
Package schema is a generated protocol buffer package.
util
intstr
Package intstr is a generated protocol buffer package.
Package intstr is a generated protocol buffer package.
watch
versioned
Package versioned is a generated protocol buffer package.
Package versioned is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL