Documentation
¶
Overview ¶
Package kubernetes is the API implementation on kubernetes.
Index ¶
- func IsClusterKind(kind string) bool
- func IsNamespaceKind(kind string) bool
- func StructedClusterRole(data []byte) (*rbacV1.ClusterRole, error)
- func StructedClusterRoleBinding(data []byte) (*rbacV1.ClusterRoleBinding, error)
- func StructedNode(data []byte) (*coreV1.Node, error)
- func StructedPod(data []byte) (*coreV1.Pod, error)
- func StructedRole(data []byte) (*rbacV1.Role, error)
- func StructedRoleBinding(data []byte) (*rbacV1.RoleBinding, error)
- func StructedSecret(data []byte) (*coreV1.Secret, error)
- func StructedService(data []byte) (*coreV1.Service, error)
- type ClusterKind
- type Kubernetes
- func (k *Kubernetes) Close() error
- func (k *Kubernetes) ConfigBytes() []byte
- func (k *Kubernetes) ConfigPath() string
- func (k *Kubernetes) InCluster() bool
- func (k *Kubernetes) ListNamespaces() ([]string, error)
- func (k *Kubernetes) Resource(namespace string, kind string) (api.ClusterResource, error)
- func (k *Kubernetes) Version() string
- type NamespaceKind
- type NewOption
- type Resource
- func (r Resource) Close() error
- func (r Resource) Create(ctx context.Context, resource []byte) error
- func (r Resource) Get(ctx context.Context, name string) ([]byte, error)
- func (r Resource) Kind() string
- func (r Resource) List(ctx context.Context) ([]string, error)
- func (r Resource) Update(ctx context.Context, resource []byte) error
- func (r Resource) Watch(ctx context.Context) (watch.Interface, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsClusterKind ¶
func IsNamespaceKind ¶
func StructedClusterRole ¶
func StructedClusterRole(data []byte) (*rbacV1.ClusterRole, error)
func StructedClusterRoleBinding ¶
func StructedClusterRoleBinding(data []byte) (*rbacV1.ClusterRoleBinding, error)
func StructedRoleBinding ¶
func StructedRoleBinding(data []byte) (*rbacV1.RoleBinding, error)
Types ¶
type ClusterKind ¶
type ClusterKind string
const ( ComponentStatus ClusterKind = "componentstatuses" Nodes ClusterKind = "nodes" Namespaces ClusterKind = "namespaces" PersistentVolumes ClusterKind = "persistentvolumes" ClusterRoles ClusterKind = "clusterroles" ClusterRoleBindings ClusterKind = "clusterrolebindings" PodSecurityPolicies ClusterKind = "podsecuritypolicies" )
func GetClusterKinds ¶
func GetClusterKinds() []ClusterKind
func (ClusterKind) String ¶
func (k ClusterKind) String() string
type Kubernetes ¶
type Kubernetes struct {
// contains filtered or unexported fields
}
func New ¶
func New(options ...NewOption) (*Kubernetes, error)
func (*Kubernetes) Close ¶
func (k *Kubernetes) Close() error
func (*Kubernetes) ConfigBytes ¶ added in v1.3.3
func (k *Kubernetes) ConfigBytes() []byte
func (*Kubernetes) ConfigPath ¶
func (k *Kubernetes) ConfigPath() string
func (*Kubernetes) InCluster ¶
func (k *Kubernetes) InCluster() bool
func (*Kubernetes) ListNamespaces ¶
func (k *Kubernetes) ListNamespaces() ([]string, error)
func (*Kubernetes) Resource ¶
func (k *Kubernetes) Resource(namespace string, kind string) (api.ClusterResource, error)
func (*Kubernetes) Version ¶ added in v1.3.7
func (k *Kubernetes) Version() string
type NamespaceKind ¶
type NamespaceKind string
const ( Deployments NamespaceKind = "deployments" ReplicaSets NamespaceKind = "replicasets" ReplicationControllers NamespaceKind = "replicationcontrollers" StatefulSets NamespaceKind = "statefulsets" DaemonSets NamespaceKind = "daemonsets" CronJobs NamespaceKind = "cronjobs" Services NamespaceKind = "services" Jobs NamespaceKind = "jobs" Pods NamespaceKind = "pods" ConfigMaps NamespaceKind = "configmaps" Roles NamespaceKind = "roles" RoleBindings NamespaceKind = "rolebindings" NetworkPolicys NamespaceKind = "networkpolicies" Ingresss NamespaceKind = "ingresses" ResourceQuotas NamespaceKind = "resourcequotas" LimitRanges NamespaceKind = "limitranges" Secrets NamespaceKind = "secrets" )
func GetNamespaceKinds ¶
func GetNamespaceKinds() []NamespaceKind
func (NamespaceKind) String ¶
func (k NamespaceKind) String() string
type NewOption ¶
type NewOption func(kubernetes *Kubernetes) error
func WithInCluster ¶
func WithInCluster() NewOption
func WithKubeConfigBytes ¶ added in v1.3.3
func WithKubeConfigPath ¶ added in v1.3.3
Click to show internal directories.
Click to hide internal directories.