istio: istio.io/istio/tools/bug-report/pkg/config Index | Files

package config

import "istio.io/istio/tools/bug-report/pkg/config"

Index

Package Files

config.go

type BugReportConfig Uses

type BugReportConfig struct {
    // KubeConfigPath is the path to kube config file.
    KubeConfigPath string `json:"kubeConfigPath,omitempty"`
    // Context is the cluster Context in the kube config
    Context string `json:"context,omitempty"`

    // IstioNamespace is the namespace where the istio control plane is installed.
    IstioNamespace string `json:"istioNamespace,omitempty"`

    // DryRun controls whether logs are actually captured and saved.
    DryRun bool `json:"dryRun,omitempty"`

    // FullSecrets controls whether secret contents are included.
    FullSecrets bool `json:"fullSecrets,omitempty"`

    // CommandTimeout is the maximum amount of time running the command
    // before giving up, even if not all logs are captured. Upon timeout,
    // the command creates an archive with only the logs captured so far.
    CommandTimeout Duration `json:"commandTimeout,omitempty"`

    // Include is a list of SelectionSpec entries for resources to include.
    Include SelectionSpecs `json:"include,omitempty"`
    // Exclude is a list of SelectionSpec entries for resources t0 exclude.
    Exclude SelectionSpecs `json:"exclude,omitempty"`

    // StartTime is the start time the the log capture time range.
    // If set, Since must be unset.
    StartTime time.Time `json:"startTime,omitempty"`
    // EndTime is the end time the the log capture time range.
    // Default is now.
    EndTime time.Time `json:"endTime,omitempty"`
    // Since defines the start time the the log capture time range.
    // StartTime is set to EndTime - Since.
    // If set, StartTime must be unset.
    Since Duration `json:"since,omitempty"`

    // CriticalErrors is a list of glob pattern matches for errors that,
    // if found in a log, set the highest priority for the log to ensure
    // that it is Include in the capture archive.
    CriticalErrors []string `json:"criticalErrors,omitempty"`
    // IgnoredErrors are glob error patterns which are ignored when
    // calculating the error heuristic for a log.
    IgnoredErrors []string `json:"ignoredErrors,omitempty"`
}

BugReportConfig controls what is captured and Include in the kube-capture tool archive.

func (*BugReportConfig) String Uses

func (b *BugReportConfig) String() string

type Duration Uses

type Duration time.Duration

func (Duration) MarshalJSON Uses

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON Uses

func (d *Duration) UnmarshalJSON(b []byte) error

type SelectionSpec Uses

type SelectionSpec struct {
    Namespaces  []string          `json:"namespaces,omitempty"`
    Deployments []string          `json:"deployments,omitempty"`
    Pods        []string          `json:"pods,omitempty"`
    Containers  []string          `json:"containers,omitempty"`
    Labels      map[string]string `json:"labels,omitempty"`
    Annotations map[string]string `json:"annotations,omitempty"`
}

SelectionSpec is a spec for pods that will be Include in the capture archive. The format is:

Namespace1,Namespace2../Deployments/Pods/Label1,Label2.../Annotation1,Annotation2.../ContainerName1,ContainerName2...

Namespace, pod and container names are pattern matching while labels and annotations may have pattern in the values with exact match for keys. All labels and annotations in the list must match. All fields are optional, if they are not specified, all values match. Pattern matching style is glob. Exclusions have a higher precedence than inclusions. Ordering defines pod priority for cases where the archive exceeds the maximum size and some logs must be dropped.

Examples:

1. All pods in test-namespace with label "test=foo" but without label "private" (with any value):

include:
  test-namespace/*/*/test=foo
exclude:
  test-namespace/*/*/private

2. Pods in all namespaces except "kube-system" with annotation "revision" matching wildcard 1.6*:

exclude:
  kube-system/*/*/*/revision=1.6*

3. Pods with "prometheus" in the name, except those with the annotation "internal=true":

include:
  */*/*prometheus*
exclude:
  */*/*prometheus*/*/internal=true

4. Container logs for all containers called "istio-proxy":

include:
  */*/*/*/*/istio-proxy

func (*SelectionSpec) MarshalJSON Uses

func (s *SelectionSpec) MarshalJSON() ([]byte, error)

func (*SelectionSpec) UnmarshalJSON Uses

func (s *SelectionSpec) UnmarshalJSON(b []byte) error

type SelectionSpecs Uses

type SelectionSpecs []*SelectionSpec

func (SelectionSpecs) String Uses

func (s SelectionSpecs) String() string

Package config imports 7 packages (graph) and is imported by 3 packages. Updated 2020-11-14. Refresh now. Tools for package owners.