Documentation ¶
Index ¶
- func Main(ctx context.Context, version string, args ...string) error
- func QName(obj kates.Object) string
- type Extraction
- func (ex *Extraction) CaptureEnviron(ctx context.Context)
- func (ex *Extraction) CaptureLogs(ctx context.Context, pods []*kates.Pod) func() PodLogs
- func (ex *Extraction) CaptureRemoteSnapshots(ctx context.Context, pods []*kates.Pod) error
- func (ex *Extraction) CaptureResources(ctx context.Context) error
- func (ex *Extraction) CaptureSnapshot(ctx context.Context)
- func (ex *Extraction) ListAmbassadorPods(ctx context.Context) []*kates.Pod
- func (ex *Extraction) Printf(ctx context.Context, format string, args ...interface{})
- func (ex *Extraction) Warnf(ctx context.Context, err error, format string, args ...interface{})
- func (ex *Extraction) WriteArchive(ctx context.Context, filename string, podLogs PodLogs) error
- type LogEntry
- type PodLogs
- type Repro
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Extraction ¶
type Extraction struct { ExtractionLog []*LogEntry // A log of the extraction process itsef. Snapshots map[string][]byte // Snapshots from all pods in the cluster. Resources []*kates.Unstructured // Interesting resources in the cluster that may not be included in snapshots. Environ map[string]string // Capture the environment if we are invoked in the cluster. // contains filtered or unexported fields }
func NewExtraction ¶
func NewExtraction(client *kates.Client) *Extraction
func (*Extraction) CaptureEnviron ¶
func (ex *Extraction) CaptureEnviron(ctx context.Context)
CaptureEnviron captures the environment while redacting any secrets.
func (*Extraction) CaptureLogs ¶
CaptureLogs will capture the current and previous logs from all the listed pods. It operates asynchronously and returns a function that can be used to access the final result (i.e. a poor mans future).
func (*Extraction) CaptureRemoteSnapshots ¶
CaptureRemoteSnapshots will exec grab-snapshots on all the supplied pods and capture the resulting tarballs.
func (*Extraction) CaptureResources ¶
func (ex *Extraction) CaptureResources(ctx context.Context) error
CaptureResources will capture and sanitize as many resources as permitted by the RBAC of the system account running the extraction. The code is careful to redact both secrets and config maps as well as the enviornment variables of any unrecognized deployments. For ambassador deployments only the environment variables that contain AUTH and/or PASSWORD are redacted.
func (*Extraction) CaptureSnapshot ¶
func (ex *Extraction) CaptureSnapshot(ctx context.Context)
CaptureSnapshot captures the local snapshot if we are in cluster.
func (*Extraction) ListAmbassadorPods ¶
func (ex *Extraction) ListAmbassadorPods(ctx context.Context) []*kates.Pod
ListAmbassadorPods will search the entire cluster for ambassador pods resulting from either a helm based or manifest based install. It does this by using the service=ambassador labeling used by the manifests and the product=aes labeling used by the helm charts. This may get more pods than just edge-stack, e.g. it may pull in the redis logs since they have the product=aes label, but that is ok we would rather grab more debugging info than less.
func (*Extraction) Printf ¶
func (ex *Extraction) Printf(ctx context.Context, format string, args ...interface{})
func (*Extraction) Warnf ¶
func (ex *Extraction) Warnf(ctx context.Context, err error, format string, args ...interface{})
func (*Extraction) WriteArchive ¶
WriteArchive saves all the extracted info into a tarball.
type Repro ¶
type Repro struct { Resources map[string][]*kates.Unstructured Namespaces map[string]bool Ports map[string]bool Processed []*kates.Unstructured }
func (*Repro) OrderedKinds ¶
OrderedKinds returns all the k8s kinds in the proper order to avoid dangling references.