Documentation ¶
Overview ¶
Package kubernetes implements a convenience wrapper around Kubernetes clients.
Index ¶
- func CreateNamespace(client client.Client, name string) error
- func DeleteNamespace(client client.Client, name string) error
- type ClusterRole
- type ClusterRoleBinding
- type Node
- type PersistentVolumeClaim
- func GetPersistentVolumeClaim(client client.Client, name string, namespace string) (PersistentVolumeClaim, error)
- func ListPersistentVolumeClaims(client client.Client, namespace string) ([]PersistentVolumeClaim, error)
- func NewPersistentVolumeClaim(client client.Client, persistentvolumeclaim corev1.PersistentVolumeClaim) (PersistentVolumeClaim, error)
- type Pod
- type Role
- type RoleBinding
- type Secret
- type SecretBuilder
- func (builder SecretBuilder) Do(client client.Client) (Secret, error)
- func (builder SecretBuilder) WithData(data map[string][]byte) SecretBuilder
- func (builder SecretBuilder) WithNamespace(namespace string) SecretBuilder
- func (builder SecretBuilder) WithStringData(data map[string]string) SecretBuilder
- type Service
- type ServiceAccount
- type StatefulSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateNamespace ¶
CreateNamespace creates a namespace.
Types ¶
type ClusterRole ¶ added in v0.2.4
type ClusterRole struct { rbacv1.ClusterRole // contains filtered or unexported fields }
ClusterRole wraps a Kubernetes ClusterRole.
func GetClusterRole ¶ added in v0.2.4
func GetClusterRole(client client.Client, name string) (ClusterRole, error)
GetClusterRole gets a clusterrole.
func ListClusterRoles ¶ added in v0.2.4
func ListClusterRoles(client client.Client) ([]ClusterRole, error)
ListClusterRoles lists all clusterroles.
func NewClusterRole ¶ added in v0.2.4
func NewClusterRole(client client.Client, clusterrole rbacv1.ClusterRole) (ClusterRole, error)
NewClusterRole creates a ClusterRole from its Kubernetes ClusterRole.
func (ClusterRole) Delete ¶ added in v0.2.4
func (clusterrole ClusterRole) Delete() error
Delete deletes a ClusterRole from the Kubernetes cluster.
func (*ClusterRole) Save ¶ added in v0.5.0
func (clusterrole *ClusterRole) Save() error
Save saves the current ClusterRole.
func (*ClusterRole) Update ¶ added in v0.2.4
func (clusterrole *ClusterRole) Update() error
Update gets the current ClusterRole status.
type ClusterRoleBinding ¶ added in v0.2.4
type ClusterRoleBinding struct { rbacv1.ClusterRoleBinding // contains filtered or unexported fields }
ClusterRoleBinding wraps a Kubernetes ClusterRoleBinding.
func GetClusterRoleBinding ¶ added in v0.2.4
func GetClusterRoleBinding(client client.Client, name string) (ClusterRoleBinding, error)
GetClusterRoleBinding gets a clusterrolebinding.
func ListClusterRoleBindings ¶ added in v0.2.4
func ListClusterRoleBindings(client client.Client) ([]ClusterRoleBinding, error)
ListClusterRoleBindings lists all clusterrolebindings.
func NewClusterRoleBinding ¶ added in v0.2.4
func NewClusterRoleBinding(client client.Client, clusterrolebinding rbacv1.ClusterRoleBinding) (ClusterRoleBinding, error)
NewClusterRoleBinding creates a ClusterRoleBinding from its Kubernetes ClusterRoleBinding.
func (ClusterRoleBinding) Delete ¶ added in v0.2.4
func (clusterrolebinding ClusterRoleBinding) Delete() error
Delete deletes a ClusterRoleBinding from the Kubernetes cluster.
func (*ClusterRoleBinding) Save ¶ added in v0.5.0
func (clusterrolebinding *ClusterRoleBinding) Save() error
Save saves the current ClusterRoleBinding.
func (*ClusterRoleBinding) Update ¶ added in v0.2.4
func (clusterrolebinding *ClusterRoleBinding) Update() error
Update gets the current ClusterRoleBinding status.
type Node ¶ added in v0.4.1
Node wraps a Kubernetes Node.
type PersistentVolumeClaim ¶ added in v0.2.0
type PersistentVolumeClaim struct { corev1.PersistentVolumeClaim // contains filtered or unexported fields }
PersistentVolumeClaim wraps a Kubernetes PersistentVolumeClaim.
func GetPersistentVolumeClaim ¶ added in v0.2.0
func GetPersistentVolumeClaim(client client.Client, name string, namespace string) (PersistentVolumeClaim, error)
GetPersistentVolumeClaim gets a persistentvolumeclaim in a namespace.
func ListPersistentVolumeClaims ¶ added in v0.2.0
func ListPersistentVolumeClaims(client client.Client, namespace string) ([]PersistentVolumeClaim, error)
ListPersistentVolumeClaims lists all persistentvolumeclaims in a namespace.
func NewPersistentVolumeClaim ¶ added in v0.2.0
func NewPersistentVolumeClaim(client client.Client, persistentvolumeclaim corev1.PersistentVolumeClaim) (PersistentVolumeClaim, error)
NewPersistentVolumeClaim creates a PersistentVolumeClaim from its Kubernetes PersistentVolumeClaim.
func (PersistentVolumeClaim) Delete ¶ added in v0.2.0
func (persistentvolumeclaim PersistentVolumeClaim) Delete() error
Delete deletes a PersistentVolumeClaim from the Kubernetes cluster.
func (*PersistentVolumeClaim) Save ¶ added in v0.5.0
func (persistentvolumeclaim *PersistentVolumeClaim) Save() error
Save saves the current PersistentVolumeClaim.
func (*PersistentVolumeClaim) Update ¶ added in v0.2.0
func (persistentvolumeclaim *PersistentVolumeClaim) Update() error
Update gets the current PersistentVolumeClaim status.
type Pod ¶
Pod wraps a Kubernetes Pod.
func (Pod) ContainerExec ¶
ContainerExec runs a command in a pod's container.
func (Pod) ContainerLogs ¶
ContainerLogs returns the (current) logs of a pod's container.
type Role ¶ added in v0.2.4
Role wraps a Kubernetes Role.
type RoleBinding ¶ added in v0.2.4
type RoleBinding struct { rbacv1.RoleBinding // contains filtered or unexported fields }
RoleBinding wraps a Kubernetes RoleBinding.
func GetRoleBinding ¶ added in v0.2.4
GetRoleBinding gets a rolebinding in a namespace.
func ListRoleBindings ¶ added in v0.2.4
func ListRoleBindings(client client.Client, namespace string) ([]RoleBinding, error)
ListRoleBindings lists all rolebindings in a namespace.
func NewRoleBinding ¶ added in v0.2.4
func NewRoleBinding(client client.Client, rolebinding rbacv1.RoleBinding) (RoleBinding, error)
NewRoleBinding creates a RoleBinding from its Kubernetes RoleBinding.
func (RoleBinding) Delete ¶ added in v0.2.4
func (rolebinding RoleBinding) Delete() error
Delete deletes a RoleBinding from the Kubernetes cluster.
func (*RoleBinding) Save ¶ added in v0.5.0
func (rolebinding *RoleBinding) Save() error
Save saves the current RoleBinding.
func (*RoleBinding) Update ¶ added in v0.2.4
func (rolebinding *RoleBinding) Update() error
Update gets the current RoleBinding status.
type Secret ¶ added in v0.2.0
Secret wraps a Kubernetes Secret.
func ListSecrets ¶ added in v0.2.0
ListSecrets lists all secrets in a namespace.
type SecretBuilder ¶ added in v0.2.0
type SecretBuilder struct { Name string Namespace string Data map[string][]byte StringData map[string]string }
SecretBuilder tracks the options set for a secret.
func CreateSecret ¶ added in v0.2.0
func CreateSecret(name string) SecretBuilder
CreateSecret creates a secret. Additional parameters can be added to this call. The creation is started by calling 'Do'.
func (SecretBuilder) Do ¶ added in v0.2.0
func (builder SecretBuilder) Do(client client.Client) (Secret, error)
Do creates the secret in the cluster.
func (SecretBuilder) WithData ¶ added in v0.2.0
func (builder SecretBuilder) WithData(data map[string][]byte) SecretBuilder
WithData sets the data the secret should hold.
func (SecretBuilder) WithNamespace ¶ added in v0.2.0
func (builder SecretBuilder) WithNamespace(namespace string) SecretBuilder
WithNamespace sets the namespace in which the secret will be created.
func (SecretBuilder) WithStringData ¶ added in v0.2.2
func (builder SecretBuilder) WithStringData(data map[string]string) SecretBuilder
WithStringData sets the data the secret should hold as string
type Service ¶ added in v0.2.0
Service wraps a Kubernetes Service.
func GetService ¶ added in v0.2.0
GetService gets a service in a namespace.
func ListServices ¶ added in v0.2.0
ListServices lists all services in a namespace.
func NewService ¶ added in v0.2.0
NewService creates a Service from its Kubernetes Service.
type ServiceAccount ¶ added in v0.2.4
type ServiceAccount struct { corev1.ServiceAccount // contains filtered or unexported fields }
ServiceAccount wraps a Kubernetes ServiceAccount.
func GetServiceAccount ¶ added in v0.2.4
GetServiceAccount gets a serviceaccount in a namespace.
func ListServiceAccounts ¶ added in v0.2.4
func ListServiceAccounts(client client.Client, namespace string) ([]ServiceAccount, error)
ListServiceAccounts lists all serviceaccounts in a namespace.
func NewServiceAccount ¶ added in v0.2.4
func NewServiceAccount(client client.Client, serviceaccount corev1.ServiceAccount) (ServiceAccount, error)
NewServiceAccount creates a ServiceAccount from its Kubernetes ServiceAccount.
func (ServiceAccount) Delete ¶ added in v0.2.4
func (serviceaccount ServiceAccount) Delete() error
Delete deletes a ServiceAccount from the Kubernetes cluster.
func (*ServiceAccount) Save ¶ added in v0.5.0
func (serviceaccount *ServiceAccount) Save() error
Save saves the current ServiceAccount.
func (*ServiceAccount) Update ¶ added in v0.2.4
func (serviceaccount *ServiceAccount) Update() error
Update gets the current ServiceAccount status.
type StatefulSet ¶ added in v0.2.0
type StatefulSet struct { appsv1.StatefulSet // contains filtered or unexported fields }
StatefulSet wraps a Kubernetes StatefulSet.
func GetStatefulSet ¶ added in v0.2.0
GetStatefulSet gets a statefulset in a namespace.
func ListStatefulSets ¶ added in v0.2.0
func ListStatefulSets(client client.Client, namespace string) ([]StatefulSet, error)
ListStatefulSets lists all statefulsets in a namespace.
func NewStatefulSet ¶ added in v0.2.0
func NewStatefulSet(client client.Client, statefulset appsv1.StatefulSet) (StatefulSet, error)
NewStatefulSet creates a StatefulSet from its Kubernetes StatefulSet.
func (StatefulSet) Delete ¶ added in v0.2.0
func (statefulset StatefulSet) Delete() error
Delete deletes a StatefulSet from the Kubernetes cluster.
func (*StatefulSet) Save ¶ added in v0.5.0
func (statefulset *StatefulSet) Save() error
Save saves the current StatefulSet.
func (*StatefulSet) Update ¶ added in v0.2.0
func (statefulset *StatefulSet) Update() error
Update gets the current StatefulSet status.
Source Files ¶
- clusterrole.generated.go
- clusterrole.go
- clusterrolebinding.generated.go
- clusterrolebinding.go
- kubernetes.go
- namespace.go
- node.generated.go
- node.go
- persistentvolumeclaim.generated.go
- persistentvolumeclaim.go
- pod.generated.go
- pod.go
- role.generated.go
- role.go
- rolebinding.generated.go
- rolebinding.go
- secret.generated.go
- secret.go
- service.generated.go
- service.go
- serviceaccount.generated.go
- serviceaccount.go
- statefulset.generated.go
- statefulset.go