GithubHelp home page GithubHelp logo

piochelepiotr / k8s-webhook-cert-manager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from newrelic/k8s-webhook-cert-manager

0.0 1.0 0.0 33 KB

Generate certificate suitable for use with any Kubernetes Mutating Webhook.

License: Other

Dockerfile 6.10% Shell 86.98% Makefile 6.92%

k8s-webhook-cert-manager's Introduction

Kubernetes Webhook Certificate Manager

Build Status

Script to generate a certificate suitable for use with any Kubernetes Mutating Webhook.

To be able to execute the script in a Kubernetes cluster, it's released as a docker image and can be executed, for instance, as a Kubernetes Job.

This is a detailed list of steps the script is executing:

  • Generate a server key.
  • If there is any previous CSR (certificate signing request) for this key, it is deleted.
  • Generate a CSR for such key.
  • The signature of the key is then approved.
  • The server's certificate is fetched from the CSR and then encoded.
  • A secret of type tls is created with the server certificate and key.
  • The k8s extension api server's CA bundle is fetched.
  • The mutating webhook configuration for the webhook server is patched with the k8s api server's CA bundle from the previous step. This CA bundle will be used by the k8s extension api server when calling our webhook.

If you wish to learn more about TLS certificates management inside Kubernetes, check out the official documentation for Managing TLS Certificate in a Cluster.

Usage example

The script expects multiple mandatory arguments. This is an example:

./generate_certificate.sh --service ${WEBHOOK_SERVICE_NAME} --webhook
${WEBHOOK_NAME} --secret ${SECRET_NAME} --namespace ${WEBHOOK_NAMESPACE} 

Development setup

This script is designed to run in Kubernetes clusters. For development purposes, we recommend using Minikube.

Contributing

We welcome code contributions (in the form of pull requests) from our user community. Before submitting a pull request please review these guidelines

Following these helps us efficiently review and incorporate your contribution and avoid breaking your code with future changes.

k8s-webhook-cert-manager's People

Contributors

smoya avatar areina avatar douglascamata avatar piochelepiotr avatar cristianciutea avatar jsbnr avatar varas avatar

Watchers

James Cloos 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.