GithubHelp home page GithubHelp logo

isabella232 / gke-policy-automation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from google/gke-policy-automation

0.0 0.0 0.0 1.01 MB

Tool and policy library for reviewing GKE clusters against best practices

License: Apache License 2.0

Makefile 1.35% Open Policy Agent 23.42% Go 71.91% Shell 0.74% Dockerfile 0.55% Python 2.03%

gke-policy-automation's Introduction

GKE Policy Automation

This is not an officially supported Google product.

This repository contains the tool and policy library for validating selected GKE clusters against configuration best practices.

Build Policy tests Version Go Report Card GoDoc GitHub


Table of Contents

Install

make

or

make build

Usage

Tool can be used from command line with gcloud CLI installed. CLI can be previously authenticated with gcloud auth application-default login command, or credentials may be passed with --creds parameter.

Parameters for GKE cluster review can be provided as command parameters or via configuration .yaml file.

gke-policy [global options] command [command options] [arguments...]

For cluster review with manually provided parameters:

./gke-policy cluster review -p <GCP_PROJECT_ID> -n <CLUSTER_NAME> -l <CLUSTER_LOCATION>

and with .yaml file with format:

silent: true
credentialsFile: ./test_credentials.json
clusters:
  - name: my-cluster
    project: my-project
    location: europe-central2
  - name: another
    project: my-project
    location: europe-central2
policies:
  - local: /tmp
outputs:
  - file: /some/file.json

Custom policies can be provided via local directory or remote Github repository. Example for local directory:

./gke-policy cluster review -p my_project -n my_cluster -l europe-central2-a \
--local-policy-dir ./gke-policies/policy

and for Github repository:

./gke-policy cluster review -p my_project -n my_cluster -l europe-central2-a \
--git-policy-repo "https://github.com/google/gke-policy-automation" \
--git-policy-branch main \
--git-policy-dir gka-policies

Test

Testing policy files with OPA Policy testing framework

opa test <POLICY_DIR>

for project policy folder:

opa test gke-policies

Contributing

Please check out Contributing and Code of Conduct docs before contributing. See also README for policies

License

Apache License 2.0

gke-policy-automation's People

Contributors

danielmarzini avatar ewojtach avatar mikouaj avatar rickygodoy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.