Skip to main content

Kubernetes File

The KubernetesFile config type is used to scrape configurations contained in your specified resource e.g Pod.

k8s-file-scraper.yaml
apiVersion: configs.flanksource.com/v1
kind: ScrapeConfig
metadata:
name: k8s-file-scraper
spec:
kubernetesFile:
- selector:
namespace: demo
kind: Statefulset
name: postgresql
files:
- path:
- /var/lib/postgresql/data/pgdata/postgresql.conf
format: properties

Scraper

FieldDescriptionSchemeRequired
logLevelSpecify the level of logging.string
scheduleSpecify the interval to scrape in cron format. Defaults to every 60 minutes.string
fullSet to true to extract changes from scraped configurations. Defaults to false.bool
retentionSettings for retaining changes, analysis and scraped itemsRetention
kubernetesFileSpecifies the list of Kubernetes File configurations to scrape.[]KubernetesFile

KubernetesFile

FieldDescriptionSchemeRequired
idA static value or JSONPath expression to use as the ID for the resource.stringtrue
nameA static value or JSONPath expression to use as the Name for the resource. Default value is the id.string
typeA static value or JSONPath expression to use as the type for the resource.stringtrue
itemsA JSONPath expression to use to extract individual items from the resourcestring
containerSet container namestring
createFieldsCreateFields is a list of JSONPath expression used to identify the created time of the config. If multiple fields are specified, the first non-empty value will be used[]string
deleteFieldsDeleteFields is a JSONPath expression used to identify the deleted time of the config. If multiple fields are specified, the first non-empty value will be used[]string
filesSpecify path to file contained in Pod[]File
formatFormat of config item, defaults to JSON, available options are JSONstring
selectorSpecify Kubernetes resource for configuration based on namespace, kind, name and more.ResourceSelectortrue
timestampFormatTimestampFormat is a Go time format string used to parse timestamps in createFields and DeletedFields. If not specified, the default is RFC3339.string
transformField to transform resultTransform
tagsset custom tags on the scraped config itemsmap[string]string
propertiesCustom templatable properties for the scraped config items.[]ConfigProperty

File

FieldDescriptionSchemeRequired
pathSet path to file contained in Pod[]string
formatSpecify format of filestring

Transform

FieldDescriptionSchemeRequired
gotemplateGo template to transform the scraped config itemstring
javascriptJavascript to transform the scraped config itemstring
jsonpathSpecify JSONPathjsonpath
exprSpecify Cel expressioncel-expression
changesApply transformation on the scraped changes[]Changes
excludeFields to remove from the config, useful for removing sensitive data and fields that change often without a material impact i.e. Last Scraped Time[]Exclude
maskSpecify configurations to replace sensitive fields with hash functions or static string.[]Mask
relationshipForm relationships between config items using selectors[]RelationshipConfig
info

Both the go template and javascript receive ScrapeResult as the template variable.