Skip to content

[FEATURE_REQUEST] How to define Environment variables in YAML configuration file #476

Open
@jeraldsm

Description

@jeraldsm

Description of the problem/feature request
It would be nice to have an option in the kube-linter YAML configuration to accept environment variables.

Description of the existing behavior vs. expected behavior
In order to define values specific to an application or an environment in the kube-linter YAML configuration file. I need to create separate kube-linter configuration file with the values specific for that use case.

If we can use the YAML configuration as a template with environment variables defined. It would be much easier to pass the variables to the configuration file

  - name: required-label-env
    template: required-label
    params:
      key: ENV
      value: $ENV
    scope:
      objectKinds:
        - DeploymentLike
    remediation: Please set the label ENV in deployment objects

  - name: required-label-app
    template: required-label
    params:
      key: APP
      value: $APP
    scope:
      objectKinds:
        - DeploymentLike
    remediation: Please set the label ENV in deployment objects

Example: kube-linter lint --config .kube-linter.yaml --env APP=EXAMPLEAPP --env ENV=dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededneeds designIndicates that the proposed enhancement needs more thought on design

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions