kubernetes

package
v0.0.0-...-5ec3a36 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2018 License: Apache-2.0, UPL-1.0 Imports: 6 Imported by: 0

README

# Kubernetes

For now this is just a library to load and parse metadata provided by the
downward API, this should be our standard layout:

```
spec:
  template:
    spec:
      volumes:
        - name: podinfo
          downwardAPI:
            items:
              - path: "labels"
                fieldRef:
                  fieldPath: metadata.labels
              - path: "name"
                fieldRef:
                  fieldPath: metadata.name
              - path: "namespace"
                fieldRef:
                  fieldPath: metadata.namespace

      containers:
        volumeMounts:
          - name: podinfo
            mountPath: /metadata
```

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	Root string // root dir, defaults to /metadata
	// contains filtered or unexported fields
}

Metadata holds all the data exposed by the Downward API

func (*Metadata) Fields

func (m *Metadata) Fields() log.Fields

Fields gives back our metadata as log.Fields

func (*Metadata) Labels

func (m *Metadata) Labels() (map[string]string, error)

Labels looks like

app="kiddie-pool" branch="logging" commit="64f78e45dbe3eb886f0f24da5447f0dedaaaf665" pod-template-hash="1222321528"

func (*Metadata) LoadAll

func (m *Metadata) LoadAll()

LoadAll loads all of the metadata we can find

func (*Metadata) Name

func (m *Metadata) Name() (string, error)

func (*Metadata) Namespace

func (m *Metadata) Namespace() (string, error)

Jump to

Keyboard shortcuts

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