All Projects → tazjin → Kubernetes Letsencrypt

tazjin / Kubernetes Letsencrypt

Licence: mit
A Kubernetes controller to retrieve Let's Encrypt certificates based on service annotations (unmaintained)

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Kubernetes Letsencrypt

Acme client
Java ACME Client application
Stars: ✭ 77 (-34.19%)
Mutual labels:  letsencrypt
Certs
A Let's Encrypt certificates manager for Kubernetes
Stars: ✭ 96 (-17.95%)
Mutual labels:  letsencrypt
Rails Letsencrypt
The Let's Encrypt certificate manager for rails
Stars: ✭ 104 (-11.11%)
Mutual labels:  letsencrypt
Mailserver
⚠️ UNMAINTAINED - Simple and full-featured mail server using Docker
Stars: ✭ 1,267 (+982.91%)
Mutual labels:  letsencrypt
Certbot
Dockerized HTTPS with Let's Encrypt
Stars: ✭ 91 (-22.22%)
Mutual labels:  letsencrypt
Certbot Plugin Gandi
Certbot plugin for authentication using Gandi LiveDNS
Stars: ✭ 98 (-16.24%)
Mutual labels:  letsencrypt
Dockerfiles
lots of dockerfiles, based on alpine
Stars: ✭ 69 (-41.03%)
Mutual labels:  letsencrypt
K8gb
A cloud native Kubernetes Global Balancer
Stars: ✭ 113 (-3.42%)
Mutual labels:  kubernetes-controller
Instance Manager
Create and manage instance groups with Kubernetes
Stars: ✭ 95 (-18.8%)
Mutual labels:  kubernetes-controller
Community
AWS Controllers for Kubernetes (ACK) is a project enabling you to manage AWS services from Kubernetes
Stars: ✭ 1,390 (+1088.03%)
Mutual labels:  kubernetes-controller
Certificaat
General-purpose ACME client
Stars: ✭ 88 (-24.79%)
Mutual labels:  letsencrypt
Dockerweb
A docker-powered bash script for shared web hosting management. The ultimate Docker LAMP/LEMP Stack.
Stars: ✭ 89 (-23.93%)
Mutual labels:  letsencrypt
Acme Dns Certbot Joohoi
Certbot client hook for acme-dns
Stars: ✭ 99 (-15.38%)
Mutual labels:  letsencrypt
Letscertbot
Let's Certbot is a tool builds automated scripts base on Certbot for obtaining, renewing, deploying SSL certificates.
Stars: ✭ 84 (-28.21%)
Mutual labels:  letsencrypt
Spark On K8s Operator
Kubernetes operator for managing the lifecycle of Apache Spark applications on Kubernetes.
Stars: ✭ 1,780 (+1421.37%)
Mutual labels:  kubernetes-controller
Acmesharp
An ACME client library and PowerShell client for the .NET platform (Let's Encrypt)
Stars: ✭ 1,161 (+892.31%)
Mutual labels:  letsencrypt
Chef Acme
Chef cookbook to request SSL certificates at Let's Encrypt
Stars: ✭ 98 (-16.24%)
Mutual labels:  letsencrypt
Docker Nginx Gunicorn Flask Letsencrypt
Boilerplate code for setting up Nginx + Gunicorn + Flask + automated LetsEncrypt certificates (https) using docker-compose.
Stars: ✭ 117 (+0%)
Mutual labels:  letsencrypt
Acmesmith
An effective ACME v2 client: Manage keys on the cloud (e.g. S3)
Stars: ✭ 109 (-6.84%)
Mutual labels:  letsencrypt
Acme
Async ACME library written in PHP based on the Amp concurrency framework.
Stars: ✭ 102 (-12.82%)
Mutual labels:  letsencrypt

Kubernetes Letsencrypt Controller

Build Status

This implements a Kubernetes controller that automatically requests and refreshes Letsencrypt certificates based on service annotations.

This controller currently supports Amazon Route 53 and Google Cloud DNS as the DNS targets.

Setup

Launch the controller into your cluster using

kubectl apply -f letsencrypt-controller.yaml

This will use a release or snapshot version (depending on your git checkout) hosted on my Docker Hub account.

The pod must run with the permissions required for updating records in the DNS zones that you maintain.

On AWS, consider using a project such as kube2iam to grant permissions to individual pods.

Please refer to the 'Building' section for using your own image.

Configuration

The controller currently supports three configuration options via environment variables:

  • ACME_URL: This can be set to an alternative ACME directory URL, for example the Letsencrypt staging server if you only want to test out the controller.
  • CLOUD_PLATFORM: This can be set to either GCP or AWS to override the automatic platform detection. You can use this to for example use Route53 as the DNS backend with a cluster running on Google's Cloud Platform. If you override this option you must provide credentials for the DNS backend, for example via the environment variables for the Google Cloud Java SDK or the AWS Java SDK
  • LOG_LEVEL: This can be used to set the log level to something other than the default (INFO).

Usage

Simply add an annotation to your services, for example:

---
apiVersion: v1
kind: Service
metadata:
  name: my-app
  labels:
    app: my-app
  annotations:
    acme/certificate: www.yourdomain.com
spec:
  type: LoadBalancer
[...]

The controller will notice this and, assuming you have a matching hosted zone, create a certificate and store it as a secret named www-yourdomain-com-tls.

You can override the name of the secret by specifying an annotation called acme/secretName.

You may specify multiple domains to include in a certificate as a JSON array. This requires setting the acme/secretName annotation. For example:

[...]
metadata:
  annotations:
    acme/certificate: '["yourdomain.com", "www.yourdomain.com"]'
    acme/secretName: mydomain-certificate
[...]

The certificate secret will contain four files named certificate.pem, chain.pem, key.pem and fullchain.pem. You can mount these into whatever application you use to terminate TLS.

If required, you can configure these file names via the environment variables, CERTIFICATE_FILENAME, CHAIN_FILENAME, KEY_FILENAME, FULLCHAIN_FILENAME.

The secret will always be created in the same namespace as your service. Removing the annotation will never remove a secret.

Certificate renewals

Every secret will be annotated with the certificate expiry date. The controller will refresh the certificate and update the secret once the expiry date is close.

Currently this update happens within 1-2 days of expiry. The reason for the short time-interval is that Letsencrypt has a long-term desire to reduce the certificate lifespans so I am trying to be future-proof here.

Overview

The controller first attempts to find a secret in the Kubernetes kube-system namespace with the name letsencrypt-keypair. This secret is expected to contain the key pair used for authentication with the Letsencrypt service.

If no such key pair is found the controller will create one and store it as a secret.

On startup the controller will check all existing services for an annotation

Building

All build lifecycle steps are handled in Gradle. After determining your desired image name, you can build a new image with:

# Run test suite
./gradlew test

# Create local Docker image
./gradlew dockerBuildImage

This will build an image locally with the tag tazjin/letsencrypt-controller:${VERSION}, where ${VERSION} is the one specified in build.gradle.kts.

Contributing

Feel free to contribute pull requests, file bugs and open issues with feature suggestions!

Please follow the code of conduct.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].