forked from cert-manager/webhook-example
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
359 additions
and
595 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,72 @@ | ||
# ACME webhook example | ||
|
||
The ACME issuer type supports an optional 'webhook' solver, which can be used | ||
to implement custom DNS01 challenge solving logic. | ||
|
||
This is useful if you need to use cert-manager with a DNS provider that is not | ||
officially supported in cert-manager core. | ||
|
||
## Why not in core? | ||
|
||
As the project & adoption has grown, there has been an influx of DNS provider | ||
pull requests to our core codebase. As this number has grown, the test matrix | ||
has become un-maintainable and so, it's not possible for us to certify that | ||
providers work to a sufficient level. | ||
|
||
By creating this 'interface' between cert-manager and DNS providers, we allow | ||
users to quickly iterate and test out new integrations, and then packaging | ||
those up themselves as 'extensions' to cert-manager. | ||
|
||
We can also then provide a standardised 'testing framework', or set of | ||
conformance tests, which allow us to validate the a DNS provider works as | ||
expected. | ||
|
||
## Creating your own webhook | ||
|
||
Webhook's themselves are deployed as Kubernetes API services, in order to allow | ||
administrators to restrict access to webhooks with Kubernetes RBAC. | ||
|
||
This is important, as otherwise it'd be possible for anyone with access to your | ||
webhook to complete ACME challenge validations and obtain certificates. | ||
|
||
To make the set up of these webhook's easier, we provide a template repository | ||
that can be used to get started quickly. | ||
|
||
### Creating your own repository | ||
|
||
### Running the test suite | ||
# Porkbun Webhook solver for Cert Manager | ||
|
||
This is an unofficial webhook solver for [Cert Manager](https://cert-manager.io/) and [Porkbun](https://porkbun.com/). | ||
|
||
## Usage | ||
|
||
1. Deploy the webhook: | ||
|
||
``` | ||
helm install porkbun-webhook ./deploy/porkbun-webhook \ | ||
--set groupName=<your group> | ||
``` | ||
|
||
2. Create a secret containing your [API key](https://porkbun.com/account/api): | ||
|
||
``` | ||
kubectl create secret generic porkbun-key \ | ||
--from-literal=api-key=<your key> \ | ||
--from-literal=secret-key=<your key> | ||
``` | ||
|
||
3. Create a role and role binding: | ||
|
||
``` | ||
kubectl apply -f rbac.yaml | ||
``` | ||
|
||
4. Configure a certificate issuer: | ||
|
||
```yaml | ||
apiVersion: cert-manager.io/v1 | ||
kind: ClusterIssuer | ||
metadata: | ||
name: letsencrypt | ||
spec: | ||
acme: | ||
server: https://acme-v02.api.letsencrypt.org/directory | ||
email: <your e-mail> | ||
privateKeySecretRef: | ||
name: letsencrypt-key | ||
solvers: | ||
- selector: | ||
dnsZones: | ||
- <your domain> | ||
dns01: | ||
webhook: | ||
groupName: <your group> | ||
solverName: porkbun | ||
config: | ||
apiKeySecretRef: | ||
name: porkbun-key | ||
key: api-key | ||
secretKeySecretRef: | ||
name: porkbun-key | ||
key: secret-key | ||
``` | ||
|
||
## Running the test suite | ||
|
||
All DNS providers **must** run the DNS01 provider conformance testing suite, | ||
else they will have undetermined behaviour when used with cert-manager. | ||
|
||
**It is essential that you configure and run the test suite when creating a | ||
DNS01 webhook.** | ||
|
||
An example Go test file has been provided in [main_test.go](https://github.com/jetstack/cert-manager-webhook-example/blob/master/main_test.go). | ||
To run the tests, first put your api key into testdata/porkbun-solver/porkbun-secret.yaml. | ||
|
||
You can run the test suite with: | ||
Then you can run the test suite with: | ||
|
||
```bash | ||
$ TEST_ZONE_NAME=example.com. make test | ||
TEST_ZONE_NAME=<your domain>. make test | ||
``` | ||
|
||
The example file has a number of areas you must fill in and replace with your | ||
own options in order for tests to pass. |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v1 | ||
appVersion: "1.0" | ||
description: A Porkbun solver for Cert Manager. | ||
name: porkbun-webhook | ||
version: 0.1.0 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.