Skip to content
README.md 3.87 KiB
Newer Older
Fabian Leonhardt's avatar
Fabian Leonhardt committed
# Ionos webhook for cert manager
Fabian Leonhardt's avatar
Fabian Leonhardt committed
Cert-manager ACME DNS webhook provider for ionos.
fabmade's avatar
fabmade committed
see: https://cert-manager.io/docs/configuration/acme/dns01/webhook/
Fabian Leonhardt's avatar
Fabian Leonhardt committed
## Install
Fabian Leonhardt's avatar
Fabian Leonhardt committed
### Install cert manager
Fabian Leonhardt's avatar
Fabian Leonhardt committed
see: https://cert-manager.io/docs/installation/kubernetes/
Fabian Leonhardt's avatar
Fabian Leonhardt committed
### Install webhook 
Fabian Leonhardt's avatar
Fabian Leonhardt committed
install helm chart

`helm install cert-manager-webhook-ionos ./deploy/cert-manager-webhook-ionos -ncert-manager`

add secret

```
apiVersion: v1
stringData:
fabmade's avatar
fabmade committed
  IONOS_PUBLIC_PREFIX: <your-public-key>
  IONOS_SECRET: <your-private-key>
Fabian Leonhardt's avatar
Fabian Leonhardt committed
kind: Secret
metadata:
fabmade's avatar
fabmade committed
  name: ionos-secret
  namespace: cert-manager
Fabian Leonhardt's avatar
Fabian Leonhardt committed
type: Opaque
```

add staging issuer

```
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
  name: letsencrypt-ionos-staging
spec:
  acme:
    # The ACME server URL
    server: https://acme-staging-v02.api.letsencrypt.org/directory
    # Email address used for ACME registration
    email: <your-email>
    # Name of a secret used to store the ACME account private key
    privateKeySecretRef:
      name: letsencrypt-ionos-staging-key
    # Enable the dns01 challenge provider
    solvers:
      - dns01:
          webhook:
            groupName: acme.fabmade.de
Fabian Leonhardt's avatar
Fabian Leonhardt committed
            solverName: ionos
Fabian Leonhardt's avatar
Fabian Leonhardt committed
            config:
              apiUrl: https://api.hosting.ionos.com/dns/v1
              publicKeySecretRef:
                key: IONOS_PUBLIC_PREFIX
Fabian Leonhardt's avatar
Fabian Leonhardt committed
                name: ionos-secret
Fabian Leonhardt's avatar
Fabian Leonhardt committed
              secretKeySecretRef:
                key: IONOS_SECRET
Fabian Leonhardt's avatar
Fabian Leonhardt committed
                name: ionos-secret
Fabian Leonhardt's avatar
Fabian Leonhardt committed
```
add prod issuer

```
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
Fabian Leonhardt's avatar
Fabian Leonhardt committed
  name: letsencrypt-ionos-prod
  spec:
      acme:
        # The ACME server URL
        server: https://acme-v02.api.letsencrypt.org/directory
        # Email address used for ACME registration
        email: <your-email-address>
        # Name of a secret used to store the ACME account private key
        privateKeySecretRef:
          name: letsencrypt-ionos-prod
        # Enable the dns01 challenge provider
        solvers:
          - dns01:
              webhook:
                groupName: acme.fabmade.de
                solverName: ionos
                config:
                  apiUrl: https://api.hosting.ionos.com/dns/v1
                  publicKeySecretRef:
                    key: IONOS_PUBLIC_PREFIX
                    name: ionos-secret
                  secretKeySecretRef:
                    key: IONOS_SECRET
                    name: ionos-secret
Fabian Leonhardt's avatar
Fabian Leonhardt committed
```

add ingress or certificate

Fabian Leonhardt's avatar
Fabian Leonhardt committed
```
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: example-test-com
spec:
  dnsNames:
    - '*.example.com'
  issuerRef:
    name: letsencrypt-ionos-staging
  secretName: example-test-com-tls
```

Fabian Leonhardt's avatar
Fabian Leonhardt committed
```
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    cert-manager.io/issuer: letsencrypt-ionos-staging
  name: example-wildcard-ingress
spec:
  rules:
    - host: '*.example.com'
      http:
        paths:
          - backend:
              service:
                name: mybackend
                port:
                  number: 80
            path: /
            pathType: Prefix
  tls:
    - hosts:
        - '*.example.com'
      secretName: example-ionos-tls-prod
```

Fabian Leonhardt's avatar
Fabian Leonhardt committed
share secrets accross namespaces (optional)
Fabian Leonhardt's avatar
Fabian Leonhardt committed
https://cert-manager.io/docs/faq/kubed/

### Uninstall webhook

```helm uninstall cert-manager-webhook-ionos -ncert-manager```

### 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).

You can run the test suite with:

```bash
$ TEST_ZONE_NAME=example.com. 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.