Coder Social home page Coder Social logo

kubernetes-letsencrypt's Introduction

deprecated

I've moved over to kube-lego for my cert retrieval, so I guess that means this project is unmaintained. They're integrated with a couple ingress controllers and autogenerate certs based on ingresses and other cool stuff like that.

This project is still maybe useful if you're on a quest to string some bash scripts together and get TLS certs for whatever reason.

kubernetes-letsencrypt

This project aims to be a painless way to get letsencrypt SSL certificates into your Kubernetes cluster.

Usage

  1. Create a letsencrypt ReplicationController and service. You can customize the ones provided in the "example" folder. The environment variables in the ReplicationController will determine the user parameters of your SSL certificate.

  2. Configure your load balancer so that HTTP requests to the directory /.well-known go to the letsencrypt service. This process will vary depending on your cluster's load balancer.

    server {
      listen 80;
      location /.well-known {
        proxy_pass http://letsencrypt.default.svc.cluster.local;
      }
    }
    
  3. Customize example/run.sh with the list of domains for which you'd like to generate a certificate. Now you're ready to start generating certificates.

  4. Execute your run.sh file. It will run the command to generate the certificates in the appropriate pod, and save the certificates into a secret called letsencrypt-ssl.

  5. Configure your load balancer pod to mount those newly-generated secrets. Your ReplicationController might look something like this:

    apiVersion: v1
    kind: ReplicationController
    metadata:
      name: load-balancer
    spec:
      replicas: 1
      selector:
        app: load-balancer
      template:
        metadata:
          labels:
            app: load-balancer
        spec:
          volumes:
            - name: ssl
              secret:
                secretName: letsencrypt-ssl
          containers:
            - name: "load-balancer"
              image: "your-user/your-nginx"
              imagePullPolicy: Always
              volumeMounts:
                - name: ssl
                  mountPath: /keys
                  readOnly: true
    
  6. Configure your load balancer to use those newly-mounted certificates. An nginx config might look something like this:

      ssl_certificate /keys/certchain.pem;
      ssl_certificate_key /keys/key.pem;
    
  7. You're done! You should probably set up something somewhere to regenerate your certificates monthly or so.

Secret format

When kubernetes-letsencrypt generates a key and certificate, it saves it in a secret. By default, this secret is named letsencrypt-ssl. This secret contains four files:

  • key.pem - Contains the newly generated secret key.
  • cert.pem - Contains the newly generated certificate, signed by Let's Encrypt. (This is what Apache uses.)
  • chain.pem - Contains the certificate vendor chain necessary to validate the certificate.
  • certchain.pem - Concatins a concatenation of cert.pem and chain.pem. (This is what nginx uses.)

kubernetes-letsencrypt's People

Contributors

iameli avatar mre-fog avatar

Watchers

 avatar  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.