kubernetes

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 23 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"
	SaFilePath        = "/var/run/secrets/infra-engine-anonymous/token"
)

Variables

View Source
var EndpointExclude = map[string]bool{
	"127.0.0.1":                            true,
	"0.0.0.0":                              true,
	"localhost":                            true,
	"kubernetes.default.svc.cluster.local": true,
	"kubernetes.default.svc.cluster":       true,
	"kubernetes.default.svc":               true,
	"kubernetes.default":                   true,
	"kubernetes":                           true,
}

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 Ingress and Service manifests

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) SaToken

func (k *Kubernetes) SaToken() (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