All Projects → cloud66-oss → Copper

cloud66-oss / Copper

Licence: apache-2.0
A configuration file validator for Kubernetes.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Copper

Envconfig
Small library to read your configuration from environment variables
Stars: ✭ 194 (-13%)
Mutual labels:  configuration
.tmux
🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
Stars: ✭ 15,594 (+6892.83%)
Mutual labels:  configuration
Environ Config
Python Application Configuration With Environment Variables
Stars: ✭ 210 (-5.83%)
Mutual labels:  configuration
Sharec
📦 Store your configs in one place and share between projects without any pain
Stars: ✭ 198 (-11.21%)
Mutual labels:  configuration
Medalla
Ethereum 2.0 Multi-Client Testnets Schlesi, Witti, Altona, and the official, public Medalla network.
Stars: ✭ 204 (-8.52%)
Mutual labels:  configuration
Iobroker.admin
user interface for configuration and administration
Stars: ✭ 207 (-7.17%)
Mutual labels:  configuration
Go Flagz
Dynamic flag management for Go.
Stars: ✭ 191 (-14.35%)
Mutual labels:  configuration
Ini
Package ini provides INI file read and write functionality in Go
Stars: ✭ 2,771 (+1142.6%)
Mutual labels:  configuration
Heyui
🎉UI Toolkit for Web, Vue2.0 http://www.heyui.top
Stars: ✭ 2,373 (+964.13%)
Mutual labels:  validator
Hass Configurator
Configuration UI for Home Assistant
Stars: ✭ 211 (-5.38%)
Mutual labels:  configuration
Xmlschema
XML Schema validator and data conversion library for Python
Stars: ✭ 201 (-9.87%)
Mutual labels:  validator
Config
🛠 A configuration library for Go that parses environment variables, JSON files, and reloads automatically on SIGHUP
Stars: ✭ 203 (-8.97%)
Mutual labels:  configuration
Drago
A flexible configuration manager for Wireguard networks
Stars: ✭ 204 (-8.52%)
Mutual labels:  configuration
Validot
Validot is a performance-first, compact library for advanced model validation. Using a simple declarative fluent interface, it efficiently handles classes, structs, nested members, collections, nullables, plus any relation or combination of them. It also supports translations, custom logic extensions with tests, and DI containers.
Stars: ✭ 198 (-11.21%)
Mutual labels:  validator
Run Aspnetcore Realworld
E-Commerce real world example of run-aspnetcore ASP.NET Core web application. Implemented e-commerce domain with clean architecture for ASP.NET Core reference application, demonstrating a layered application architecture with DDD best practices. Download 100+ page eBook PDF from here ->
Stars: ✭ 208 (-6.73%)
Mutual labels:  configuration
Golib
Go Library [DEPRECATED]
Stars: ✭ 194 (-13%)
Mutual labels:  configuration
Validr
A simple, fast, extensible python library for data validation.
Stars: ✭ 205 (-8.07%)
Mutual labels:  validator
Bork
the Bash-Operated Reconciling Kludge
Stars: ✭ 222 (-0.45%)
Mutual labels:  configuration
Routinator
An RPKI Validator written in Rust
Stars: ✭ 215 (-3.59%)
Mutual labels:  validator
Collector Sidecar
Manage log collectors through Graylog
Stars: ✭ 209 (-6.28%)
Mutual labels:  configuration

Copper

Copper is a simple tool for validate your configuration files. This is specifically useful with Kubernetes configuration files to enforce best practices, apply policies and compliance requirements.

NOTE: This is Copper v2.0 which is a rewrite of Copper v1.0 (and not an in-place upgrade). Copper v2.0 uses Javascript as it's scripting language instead of Copper v1.0's custom DSL. At the moment, we don't offer any upgrades for old Copper v1 scripts to Copper v2.

Copper Logo

Installation

Head to the releases section of this repository and download the latest version of Copper. You can update Copper using copper update command at any time. By default, you will be running the stable releases. To change the channel, you can use the --channel argument in copper update.

Usage

copper validate --in samples/sample.yml --validator samples/no_latest.js

This will run no_latest.js script to validate sample.yml (both available in this repository).

Copper supports YAML configuration files. By default, it loads the entire input YAML file into the $$ variable that's available to your scripts. Each section of your YAML file is one item in the $$ array.

Here is an example on how to stop using latest as the image tag.

$$.forEach(function($){
    if ($.kind === 'Deployment') {
        $.spec.template.spec.containers.forEach(function(container) {
            var image = new DockerImage(container.image);
            if (image.tag === 'latest') {
                errors.add_error('no_latest',"latest is used in " + $.metadata.name, 1)
            }
        });
    }
});

As you can see, for each section in the YAML, we check if the item is a Deployment, if it is use one of Copper's internal helper classes DocerkImage to load the image name and parse it. DockerImage understands the intricacies of Docker image names (default tag names, default repos, etc). If the tag is latest we push an error into the errors list.

Once our script has run, Copper will check errors for any errors.

Each validation error should have 3 attributes: check_name: The name of the check we just performed title: Some explanation about this error severity: A numerical representation of the severity of this error.

You can set the maximum allowed severity when running Copper using the --threshold argument.

Helpers

To see what helpers are available for you to use in your scripts, see the files in the libjs folder in the repository. All these files are loaded before your script is run and therefore are available to use within your scripts.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].