drifter

command module
v0.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

README

Drift

Find configuration drifts on Kubernetes resources or Helm charts running in your cluster.

Drifter scans your cluster for installed kubernetes components , installed Helm charts, then cross-checks them against the passed expectation file .

Installing

Using Drifter is easy. First, use go get to install the latest version of the library.

go get -u github.com/ajayk/drifter@latest

Next, include Drifter in your application:

import "github.com/ajayk/drifter"

Usage

drifter check -k /Users/drifter/.kube/config -c  examples/gcp-gke-check.yaml

Drifter check returns either an exit code of 0 (pass) or 2 (fail)

Usage Demo

asciicast

Drifter Schema:

Drifter yaml is easy to configure to check the expectations Currently supports 10 different type of validators

  • helm
  • namespaces
  • deployments
  • daemonsets
  • statefulsets
  • secrets
  • configmaps
  • ingress classes
  • storage classes
  • serviceaccounts
  • clusterroles

check examples directory for each different type of validator

helm:
  components:
    - name: ingress-nginx
      version: 4.2.3
      appVersion: 1.2.0
    - name: external-secrets-operator
      version: 0.6.8 # just chart version check not checking for appVersion here 

kubernetes:
  namespaces:
    - name: kube-system
    - name: es

  daemonsets:
    - namespace: kube-system
      names:
        - anetd
        - nvidia-gpu-device-plugin
    - namespace: gmp-public
      names:
        - node-exporter

  deployments:
    - namespace: kube-system
      names:
        - kube-dns

  statefulsets:
    - namespace: gkebackup
      names:
        - gkebackup-agent

  storage:
    classes:
      - filestore-premium-rwx
      - filestore-standard-rwx

  ingress:
    classes:
      - nginx

Documentation

Overview

Copyright © 2022 Ajay K <ajaykemparaj@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
Package cmd Copyright © 2022 Ajay K <ajaykemparaj@gmail.com>
Package cmd Copyright © 2022 Ajay K <ajaykemparaj@gmail.com>
pkg
helm
Package helm Copyright © 2022 Ajay K <ajaykemparaj@gmail.com>
Package helm Copyright © 2022 Ajay K <ajaykemparaj@gmail.com>
kubernetes
Package kubernetes Copyright © 2022 Ajay K <ajaykemparaj@gmail.com>
Package kubernetes Copyright © 2022 Ajay K <ajaykemparaj@gmail.com>
model
Package model Copyright © 2022 Ajay K <ajaykemparaj@gmail.com>
Package model Copyright © 2022 Ajay K <ajaykemparaj@gmail.com>

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL