This plugin allows Sauron to query Kubernetes api and retrieve the annotations, labels and env vars assigned to the resources specified in the configuration and dump the value to the DataSet.
This plugin uses the following configuration:
sauron.plugins:
kubernetesapi-report:
serviceLabel: "label/service.name" # The label that will used as a selector to find the resource by serviceName
# When checks are needed in different clusters:
# - Set up a kube config file, see https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/.
# - Set up an association between the environment name and the name of a context in the kube config file.
# - Optionally, use kubeConfigFile to set the location of the kube config file. Defaults to "$HOME/.kube/config" if not set.
apiClientConfig:
default: "default"
environmentName: "kubeConfigContextName"
kubeConfigFile: "/home/user/.kube/config"
selectors:
pod:
- label
- annotation
deployment:
- label
- annotation
environmentVariablesCheck:
- MY_ENV_VAR
# Reading values from Property files:
# - [/path/to/file_a.props] - is the path to a file in a POD
# "THE_OUTPUT_KEY" - is the output key to be appended in the input dataset
# "the.prop.key.in.the.file" - is the prop key used to extract the value from the property file.
propertiesFilesCheck:
"[/path/to/file_a.props]":
"THE_OUTPUT_KEY": "the.prop.key.in.the.file"
"[/path/to/file_b.env]":
"ANOTHER_OUTPUT_KEY": "the.prop.key.in.the.file"
containersCheck:
- liveness
- readinessThe possible selectors can be found in KubernetesResources.
- serviceName: ServiceName that will be used to filter kubernetes resources by
serviceLabel
- All the selector's value that can be found assigned to the specified resources
- All the environment variables and its values that were found in the running pod
- All the values found in the property files for the running pod