Giter Club home page Giter Club logo

cert-manager-verifier's Introduction

cert-manager-verifier

Helps you properly wait for cert-manager installation to be ready to use.

All versions of cert-manager are supported down to 1.0

Motivation

Pretty much every kubernetes installation nowadays depends on cert-manager for certificate provisioning. But at the same time, I've seen a lot of flakiness in several projects that were caused by inproperly implemented wait on cert-manager to be ready.

Currently the right way to do this is documented in installation guide. It consists of several steps and typically in a CI or automated environment, you don't want to execute those manually and that's where this project aims to help.

Usage

There are two ways how to use the verifier - CLI and as a go library and your choice depends on what your cluster installation tooling looks like.

CLI integration

The CLI is just another binary you call from your CI/CD pipeline or cluster installation scripts. When it returns exitcode 0 you know cert-manager is ready to use.

It expects kubeconfig/user that is allowed to create namespace in the default settings (it creates and cleans up cert-manager-test ns to deploy the test certificates). See cm-verifier --help for more information about how to configure this.

    ./cm-verifier
    Waiting for following deployments in namespace cert-manager:
    	- cert-manager
    	- cert-manager-cainjector
    	- cert-manager-webhook
    Deployment cert-manager READY! ヽ(•‿•)ノ
    Deployment cert-manager-cainjector READY! ヽ(•‿•)ノ
    Deployment cert-manager-webhook READY! ヽ(•‿•)ノ
    Resource cert-manager-test created
    Resource test-selfsigned created
    Resource selfsigned-cert created
    ヽ(•‿•)ノ Cert-manager is READY!%

You can configure what the CLI does via flags:

--debug 'print out debug logs as well'
--namespace 'namespace into which cert-manager is installed'
--timeout 'set timeout after which we give up waiting for cert-manager'

As a library

For a full example see examples/main.go

import "github.com/alenkacz/cert-manager-verifier/pkg/verify"

...

result, err := verify.Verify(ctx, config, &verify.Options{CertManagerNamespace: "cert-manager"})
if err != nil {
    log.Fatal(err)
}
if result.Success {
    fmt.Println("Success!!!")
} else {
    fmt.Println("Failure :-(")
}

cert-manager-verifier's People

Contributors

alenkacz avatar prozachj avatar

Watchers

 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.