kubernetes

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NamespaceFilePath = "/var/run/secrets/kubernetes.io/serviceaccount/namespace"
	CaFilePath        = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KubeSecretReader

type KubeSecretReader struct {
	Namespace string
}

func (*KubeSecretReader) Get

func (ksr *KubeSecretReader) Get(secretName string, client *kubernetes.Clientset) (string, error)

Get returns a K8s secret object with the specified name from a Kubernetes configuration if it exists

type Kubernetes

type Kubernetes struct {
	Config       *rest.Config
	SecretReader SecretReader
	// contains filtered or unexported fields
}

func NewKubernetes

func NewKubernetes() (*Kubernetes, error)

func (*Kubernetes) CA

func (k *Kubernetes) CA() ([]byte, error)

func (*Kubernetes) Endpoint

func (k *Kubernetes) Endpoint() (string, error)

Find a suitable Endpoint to use by inspecting the engine's Service objects

func (*Kubernetes) GetSecret

func (k *Kubernetes) GetSecret(secret string) (string, error)

GetSecret returns a K8s secret object with the specified name from the current namespace if it exists

func (*Kubernetes) Name

func (k *Kubernetes) Name() (string, error)

func (*Kubernetes) Namespace

func (k *Kubernetes) Namespace() (string, error)

func (*Kubernetes) UpdateRoles

func (k *Kubernetes) UpdateRoles(roles []api.Role) error

UpdateRoles converts API roles to role-bindings in the current cluster

type RoleBinding

type RoleBinding struct {
	Role  string
	Users []string
}

type SecretReader

type SecretReader interface {
	Get(secretName string, client *kubernetes.Clientset) (string, error)
}

func NewSecretReader

func NewSecretReader(namespace string) SecretReader

Jump to

Keyboard shortcuts

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